Open framework + audit service
Install under the project
npm init npm install zeppelin-solidity
Catalog (as of Jan 2018 & Nov 2018)
- math
- SafeMath
- add safe functions (mul, div, sub, add) for uint256 and throw on error
- Math (assorted math operations)
- access
- library Roles
- struct Role - map of address=>boolean, role bearer registry
- internal functions (using as method) - add(address), remove(address), has
- contract PauserRole
- events, public methods...
- ownership
- contract Ownable
- has owner
- initially owned by sender
- modifier onlyOwner
- transferOwnership(address newOwner) public onlyOwner;
- token
- ERC20
- IERC20 - interface
- ERC20 is IERC20
- fixed supply, standard behaviour, provided further internal function for burn and mint if derived token choose to support
- _transfer -> transfer without considering privilege (internal)
- _mint -> internal
- _burn -> internal
- ERC20Burnable is ERC20
- public burn, burnFrom - just call internal functions of ERC20
- MinterRole using Roles, modifier onlyMinter, function add/renounce... minter
- ERC20Mintable is ERC20, MinterRole
- ERC20Capped is ERC20Mintable - with cap
- ERC20Detailed is IERC20 - only provides name, symbol and decimals
- Pausable is PauserRole
- ERC20Pausable is ERC20, Pausable
- transfer etc. only whenNotPaused
- SafeERC20 (library)
- using SafeMath for uint256
- allow for calling the safe operations, which throw on failure
- TokenTimelock - holder contract, allow beneficiary to extract after given release time
- crowdsale (why I feel codes under this is just demo not to be used directly?)
- CrowdSale
- [summary: sell a Mintable token, mine upon sell at fixed token/ETH rate]
- sell a MintableToken
- has start/end time (specified upon deployment)
- sell at a fixed token/ETH rate (specified)
- forward fund to a wallet (specified) as they arrive
- keep total amount of wei raised
- can buy token for someone else (beneficiary)
- mint token while selling
- CappedCrowdsale
- is Crowdsale
- sell no more than a cap
- FinalizableCrowdSale
- is Crowdsale, Ownable
- owner can finalize (irreversible) after ended
- finalization() can be overriden
- RefundableCrowdSale
- is FinalizableCrowdsale
- has goal
- has RefundVault upon wallet
- sender can claimRefund if finalized & goal not reached
- RefundVault - vault to keep ether before determining destination
- is Ownable
- state: Active, Refunding, Closed
- has "address->value" deposited
- owner can close -> transfer balance to wallet
- owner can enableRefund