For reducing fee, batch processing for transfer is needed.
| Name | Detail | Interface |
|---|---|---|
transfer |
transfer eth multiple times with same amount | transfer(address[] memory recipient, uint256 amount) |
transferEthWithDifferentValue |
transfer eth multiple times with a different value | transferEthWithDifferentValue(address[] memory recipient, uint256[] memory amount) |
batch |
transfer erc20s multiple times with a different value | batch(address[] memory recipient, string[] memory token, uint256[] memory amount) |
addToken |
add token type to the contract | addToken(string name, IERC20 token) |
addAdmin |
add administrator of the contract | addAdmin(address newAdmin) |
withdraw |
withdraw erc20-token from this account | withdraw(uint256 amount, string token) |
blockAddable |
block the feature of adding admin forever | blockAddable() |
Need to install truffle, nodejs, ganache
git clone https://github.com/suhwanggyu/batch-transfer.git
npm install
truffle test --network ganache
or
truffle console --network ganache
migrate --compile-all --reset
test
- Send eth 8 times with same amount
- Send eth 8 times with different amount
- Send ERC20 100 times with different amount / different type of token