A simple Smart Contract for a Standard, Capped, Mintable, Burnable, Payable ERC20 Token.
Token has a Role Based Access Control so you can add the MINTER
permission to users or Smart Contracts.
Token has a trasferEnabled
property. Nobody can transfer tokens until the property will be enabled or you can define users as OPERATOR
allowed to transfer also if not enabled.
Token has the ERC1363 behaviors. ERC1363 is an ERC20 compatible token that can make a callback on the receiver contract to notify token transfers or token approvals.
npm install /erc20-token
pragma solidity ^0.7.0;
import "/erc20-token/contracts/ERC20Base.sol";
contract MyToken is ERC20Base {
constructor (
string memory name,
string memory symbol,
uint8 decimals,
uint256 cap,
uint256 initialSupply,
bool transferEnabled,
bool mintingFinished
) ERC20Base(name, symbol, decimals, cap, initialSupply, transferEnabled, mintingFinished) {}
// your stuff
}
npm install
Open the Truffle console
npm run console
npm run compile
npm run test
Open the Buidler console
npm run buidler:console
npm run buidler:compile
npm run buidler:test
npm run coverage
Use Solhint
npm run lint:sol
Use ESLint
npm run lint:js
Use ESLint and fix
npm run lint:fix
Code released under the MIT License.