Airdrop can be tested using the ERC20 contract. For testing run the test in ERC20.
Contains the implementations of the smart contracts for the tokenlab project, The implementation includes popular tokens like:
The implementation is based on the procedures defined by Openzeppelin, ConsenSys
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
ganache-cli
is written in Javascript and distributed as a Node package via npm
. Make sure you have Node.js (>= v6.11.5)
installed.
npm install -g ganache-cli
For more information visit ganache-cli
Truffle is a development environment, testing framework and asset pipeline for Ethereum, aiming to make life as an Ethereum developer easier.
npm install -g truffle
From there, you can run truffle compile
, truffle migrate
and truffle test
to compile your contracts, deploy those contracts to the network, and run their associated unit tests.
You can use any Text Editor or IDE for the development of the smart contracts
. Some of the poplars are:
Download the smart contracts into your local machine by using
git clone http://172.25.33.144/hamza/SmartContracts
Change directory to the contract you want to modify.
cd ERC<contract number>
SmartContracts
|-ERC<contract number>
|-build
|-contracts (compiled contracts)
|-contracts (non compiled contracts)
|-Admin.sol
|-Balances.sol
|-Token.sol
|-SafeMath.sol
|-StandardToken.sol
|-Migrations.sol
|-HumanStandardToken.sol
|-migrations (migration files for deployment)
|-1_initial_migration.js
|-2_deploy_contracts.js
|-test (test files for the contracts)
|-truffle-config.js
|-truffle.js (config files for the deployment network)
For Compiling contracts
truffle compile
For Migrating contracts
truffle migrate
For interacting with the deployed contract use
truffle console
visit console for more information.
or
Use web3 for interacting the deployed contracts.
There is a certain procedure in which contracts
are deployed and one have to insure this procedure for proper working of the deployed token
.
Balances
should be deployed first and using the address
of the balances contract
Admin
and HumanStandardToken
should be deployed.
graph LR
balances --deploy--> deployed((Deployed))
deployed --address--> Admin
deployed --name, decimal, symbol, supply, address--> HumanStandardToken
To increase supply mint tokens
only Admin
can do that and Admin
contract should be added to the Balances
contract using setModule(address, true)
graph LR
Balances --1. setModule--> Balances
Admin --2. adminCreateTokens-->Balances
For testing smart contracts
use
truffle test
For testing single contract
or test file
use
truffle test /< directory name >/ < filename >