This repo contains a drippable ERC20 token implementation plus a deployment script to easily get test ERC20 tokens in any EVM compatible chain.
The drip function automatically performs any decimal scaling needed so it's very simple and easy to drip tokens without having to do manual conversions beforehand.
Don't see a deployment you need? Deploying the tokens on any given network is dead simple: just follow the instructions below and open a PR to add your deployment(s) to the table above.
The project is developed with Foundry, so the first step is to have that installed on your system.
A couple things (such as formatting/commit hooks) are also managed using JS
packages, so you'll need to install the project's dependencies using npm
.
In order to deploy the test tokens to a target network you can then go ahead and
create a .env
file exporting the following env variables:
export PRIVATE_KEY=""
export ETHERSCAN_API_KEY="" # optional
export BLOCKSCOUT_INSTANCE_URL="" # optional
export RPC_ENDPOINT=""
Here's what each env does:
PRIVATE_KEY
is private key of the account that will perform the deploymentETHERSCAN_API_KEY
will optionally be used to verify the source code on EtherscanBLOCKSCOUT_INSTANCE_URL
will optionally be used to verify the source code on Blockscount. This should point to the Blockscount instance you want to verify the contracts on.RPC_ENDPOINT
is the RPC endpoint that will be used to broadcast transactions (it will also determine the network where the deployment will happen, so pay attention).
Once you have the .env
file ready you can finally execute the following
command to initiate the deployment of the 3 default test tokens (AAA, BBB, CCC):
// to verify on etherscan
forge script --rpc-url $RPC_ENDPOINT --broadcast --verify Deploy
// if you instead want to verify on blockscout
forge script --rpc-url $RPC_ENDPOINT --broadcast --verify --verifier blockscout --verifier-url $BLOCKSCOUT_INSTANCE_URL/api? Deploy
If you instead want to deploy standalone test tokens with custom name, symbol or decimals, simply execute the following command:
forge script --rpc-url $RPC_ENDPOINT --broadcast --verify --sig 'run(string,string,uint8)' DeployStandalone <TOKEN_NAME> <TOKEN_SYMBOL> <TOKEN_DECIMALS>
replacing <TOKEN_NAME>
, <TOKEN_SYMBOL>
and <TOKEN_DECIMALS>
with the
values you want.