Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreafspeziale/tokenlocker-contract
💵 SC for ERC20 lock distribution with airdropped ERC20 withdraw functionality
https://github.com/andreafspeziale/tokenlocker-contract
Last synced: 4 days ago
JSON representation
💵 SC for ERC20 lock distribution with airdropped ERC20 withdraw functionality
- Host: GitHub
- URL: https://github.com/andreafspeziale/tokenlocker-contract
- Owner: andreafspeziale
- Created: 2018-08-07T15:00:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-29T19:44:57.000Z (almost 2 years ago)
- Last Synced: 2024-04-29T23:18:13.169Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 208 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TokenLocker and TokenTimelock
The project contains:**SampleToken**: sample StandardBurnableToken ERC20 token to be used as locked token.
**AirdropToken**: sample StandardToken ERC20 token to be used as accidentaly airdropped token.
**TokenTimelock**: OpenZeppelin contract for token lock. (just for test / learning purposes)
**TokenLocker**: my implementation for token lock and multiple release.
The contract provide also a function invokable only by the owner to withdraw eventually ERC20 dropped in.## System used
- node v9.10.1
- npm 5.8.0## Install
- `$ npm i`## Set env
- `$ source set_path.sh`## Config
The mainet migration will deploy only the TokenLocker contract using as params the config file present in the config folder.
Copy the sample into an actually .js file and fill it with your needs.- `$ cd config`
- `$ cp config.js.sample config.js`## Available networks
- development
- parity (usage needs to be granted)
- ropsten (using infura and a metamask account)
- mainet (needs a parity synced local node + ledger)## Run local node
- `$ npm run ganache`## Migrate
- `$ npm run migrate:dev`## Tests
- `$ npm run test:dev`## Development scripts
Useful javascript scripts for lock simulation based on the locking contractFor OpenZeppelin contract:
- `$ npm run send:timelock` send 20 ERC20 tokens to TokenTimelock
- `$ npm run release:timelock` release to the migrated beneficiary the 20 ERC20 tokens
- `$ npm run balance:timelock` get the balances of the actors
For TokenLocker contract:- `npm run send:sample:locker` send 20 ERC20 tokens to TokeLocker
- `npm run send:airdrop:locker` send 20 ERC20 tokens to TokeLocker
- `npm run release:locker` let one of the beneficiary claim its tokens
- `npm run withdraw` let the TokenLocker owner withdraw airdropped tokens
- `npm run balance:locker` get the balances of the actors