An ERC20 Token with wholesome memes
Provides a standard ERC20 token interface plus DSAuth-protected
mint
and burn
functions; binary approval via MAX_UINT
; as well as
push
, pull
and move
aliases for transferFrom
operations.
credit tokens at an address whilst simultaniously increasing totalSupply
(requires auth)
debit tokens at an address whilst simultaniously decreasing totalSupply
(requires auth)
transfer an amount from msg.sender
to a given address (requires trust or
approval)
transfer an amount from a given address to msg.sender
(requires trust or
approval)
transfer an amount from a given src
address to a given dst
address (requires
trust or approval)
When deploying, use the following environment:
- Ubuntu 18.04 LTS
- A user in the
sudoers
group - NixOS v2.11.1
Creating a new user:
- Create a new user
adduser ubuntu
- Add the user to
sudoers
groupusermod -aG sudo ubuntu
- Optionally, if you don't want to enter your password each time the installation process asks, run
sudo visudo
- Add the following line at the end of the file:
ubuntu ALL=(ALL) NOPASSWD: ALL
Preparing deployment environment:
- Install Nix environment
curl -L https://nixos.org/nix/install | sh
- Run this or login again to use Nix
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
- Clone this repo and cd into it
- Drop into a Nix Bash shell with all dependency installed
nix-shell -p
- Install dapp tools
curl https://dapp.tools/install | sh
- Use ETH v3 encoded private key and copy JSON part to
./keystore/me.json
- Copy the password from the step above to
./keystore/pwd
First configure token name and decimals in contract code.
Compile contracts:
dapp build --optimize
Deploy token contract:
ETH_FROM={deployer_address} \
ETH_PASSWORD=./keystore/pwd \
ETH_KEYSTORE=./keystore \
ETH_GAS=2000000 \
ETH_GAS_PRICE={gas_price_in_wei} \
ETH_RPC_URL=https://{eth_network}.infura.io/v3/{infura_project_id} \
TMPDIR=/tmp \
dapp create DSToken "$(seth --to-bytes32 "$(seth --from-ascii "{token_symbol}")")"
export ETH_RPC_URL=https://{eth_network}.infura.io/v3/{infura_project_id}
export ETHERSCAN_API_KEY={etherscan_api_key}
dapp verify-contract src/token.sol:DSToken {token_contract_address} {constructor_args}