This is a solidity language, ERC-20 standard token. Ownership management,Minting and Burning is available. It also have additional features such as Internal Whitelist, External Whitelist and Transaction Fee.
This is a solidity language, ERC20 staking contract. Rewards are calculated according to the amount staked and time period. Users can deposit, withdraw and claim their rewards. Admin can claim unclaimed tokens after an expiry time. A fees is debited on withdrawal.
Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.
Hardhat is a world-class development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM), aiming to make life as a developer easier. We use hardhat in this project to compile and deploy the Lingo contracts in specified network
Run below commands
sudo apt install git-allRun below commands
curl -fsSL https://deb.nodesource.com/setup_lts.x |sudo -E bash -
sudo apt-get install -y nodejsRun below commands
sudo npm install hardhat -g- Ubuntu - 22.04.2 LTS
- Git - 2.34.1
- NodeJs - v16.14.2
- Node Package Manager(NPM) - 8.5.0
- Hardhat - 2.13.0
- Solidity - 0.8.19
- Clone Lingo Project Repo from
https://gitlab.com/coinfactory/lingo-token - Open Terminal in the Contract project folder and run
npm installto install the dependencies.
-
Open Terminal in the Lingo project folder.
-
Run
npx hardhat compileorhh compileornpm run compileto compile the contracts -
Run
npx hardhat testorhh testornpm run testto run the Contract test cases -
Test report will be generated in both JSON and HTML formats
./mochawesome-report/Lingo-Token-Test-Report.json./mochawesome-report/Lingo-Token-Test-Report.html
In order to compile and deploy the contract, there are certain values to be set in environment variable. Make a copy of sample.env and rename it as .env or create a new .env file and put :
- POLYGONSCAN_KEY If you work on polygon and want to verify contract on polygon network.
- RPC_URL Polygon or specified network rpc url along with API_KEY.
- MNEMONIC To use known addresses.
- TOKEN_NAME Name of token.
- TOKEN_SYMBOL Symbol of token.
- TOKEN_SUPPLY Total initial supply.
- OWNER Owner wallet address.
- TREASURY_WALLET Where fees are collected.
- TXN_FEE_PERCENTAGE Transaction fee in basis points (10000 = 100%).
- SLOT Time period of one distribution period in hours.
- ADMIN_CLAIM_PERIOD Reward expiration time in hours.
- WITHDRAWAL_FEE_PERCENTAGE Withdrawal fee in basis points (10000 = 100%).
-
Make sure contract contract configurations are correct
-
Set the environment variables as required
-
Deploy contract with below commands
hh run scripts/deploy.js --network network_namewhere network_name = polygon, mumbai etc.
A Hardhat plugin that can be used to automatically verify your contracts through the Etherscan API. With this plugin you can verify your contracts with just a simple command:
hh verify --network network_name deployed_contract_address