🐊
Token Allocator
Allocator.sol distributes tokens to addresses on a ratio defined by Governor.sol
Author: Austin Griffith
Source code: https://github.com/scaffole-eth/scaffold-eth-examples/tree/new-allocator
Intended audience: Intermediate
Topics: Scaffold-eth, ERC-20 token
Allocator.sol to distribute tokens/ETH at a predefined ratio to a number of addresses.
Allows the community to send funds to a neutral token distributor.
git clone https://github.com/scaffold-eth/scaffold-eth-examples.git new-allocator
cd new-allocator
git checkout new-allocator
yarn install
edit
packages/hardhat/scripts/deployAllocator.js
to change the Governor addresscreate a deployer mnemonic:
yarn generate
(Fund this address by running
yarn account
and sending ETH to it.)then deploy your allocator:
yarn deployAllocator
git clone https://github.com/austintgriffith/scaffold-eth.git new-allocator
cd new-allocator
git checkout new-allocator
yarn install
yarn start
If you want to bring up a local chain and work there, edit
hardhat.config.js
and app.jsxhttps://github.com/austintgriffith/scaffold-eth/tree/simple-nft-example to use
localhostinstead of
mainnet`.in a second terminal window:
cd scaffold-eth
yarn chain
in a third terminal window:
cd scaffold-eth
yarn deploy
App:
💼 Edit your deployment script
deploy.js
in packages/hardhat/scripts
Contracts:
🔏 Edit the Allocator contract
Allocator.sol
in packages/hardhat/contracts
🔏 Edit the ExampleToken contract
ExampleToken.sol
in packages/hardhat/contracts
Frontend:
📝 Edit your frontend
App.jsx
in packages/react-app/src
📝 Edit your frontend
Allocations.jsx
in packages/react-app/src/views
📝 Edit your frontend
Distributions.jsx
in packages/react-app/src/views
How To:
Edit your token allocations in the deploy script
deploy.js
in packages/hardhat/scripts
Then redeploy your contracts:
yarn deploy
Last modified 1yr ago