MakerDao has published instructions in GitHub for deploying your own DAI test token to a testnet. However, there were some details missing. Below are the same information with some of the missing details provided.
Please refer to https://github.com/dapphub/dapptools#installation
source: https://github.com/dapphub/dapptools/tree/master/src/ethsign
export ETH_KEYSTORE=~/keys
: Define where your keys are storedethsign import
: Enter the private key of your test account, in order to generate this account in the keystore
source: https://github.com/makerdao/developerguides/blob/master/dai/dai-token/dai-token.md#deploy-on-testnet
git clone
https://github.com/makerdao/dsscd dss
git checkout 1.0.1
(to insure you're on the version deployed on mainnet)dapp update
dapp --use solc:0.5.12 build
(to insure you're using the needed version of the compiler)export SETH_CHAIN=rinkeby
export ETH_KEYSTORE=~/keys
: Define where your keys are storeexport ETH_FROM=<address>
: Set your test accountexport ETH_RPC_URL=<RPC URL>
: Set the URL for a testnet RPC node (Infura or other)export chainid=$(seth --to-uint256 4)
: Deploying the contract requires passing the chain id, for use with the permit function. For Rinkeby, the id is 4.export ETH_GAS=2500000
to increase the gasLimit enough to deploy this contractdapp create Dai $chainid
: To deploy the contract. If successful, this will return the address of your new contract.
If you want to verify your contract on Etherscan, use the output of
hevm flatten --source-file src/dai.sol --json-file out/dapp.sol.json
and specify the content of $chainid
as the ABI formatted constructor (without the '0x')
Once deployed, you may test your contract
export DAIK=<deployed contract address>
seth call $DAIK 'wards(address)' $ETH_FROM:
Should return 1 because the adress that deployed the contract is part of wards by default.seth send $DAIK 'mint(address,uint256)' $ETH_FROM $(seth --to-uint256 $(seth --to-wei 100000000 eth))
: Will mint yourself 100,000,000 test-DAIseth --from-wei $(seth --to-dec $(seth call $DAIK 'balanceOf(address)' $ETH_FROM))
: To see your test-Dai balance