Truffle v4.0.1 (core: 4.0.1)
Solidity v0.4.18 (solc-js)
Ganache CLI v6.0.3 (ganache-core: 2.0.2)
$ yarn
$ npm run ganache-cli
$ truffle test
Note: Crowdsale contract tests shift ganache time forward. To test multiple times, restart ganache.
$ truffle migrate --network rinkeby
Then confirm the correct network addresses appear in the build/contracts/ directory (manual update needed for WealthECrowdsale.json and TokenTimelock.json)
$ truffle exec initContracts.js --network rinkeby
If encounter Error: Invalid number of arguments to Solidity function run npm run clean to remove the build directory and rerun the above testing commands.
- Launch both the token and the crowdsale contracts to the public blockchain.
- Launch the timelock contract.
- Pause token transfers.
- Transfer ownership of the timelock contract to the crowdsale contract.
- Set the timelock address on the crowdsale contract.
- Call
setUpReclaimas a safeguard on the token contract. - Transfer ownership of the token to the crowdsale contract for minting purposes.
- Call
claimTokenOwnershipon the crowdsale contract to complete the token contract ownership transfer. - Call
claimTimelockOwnershipon the crowdsale contract to complete the timelock contract ownership transfer (NOTE: must be completed after token contract is owned by crowdsale). - Set the tokens per ETH rate.
- Set the sale hardcap.
- Set the setDefaultWhitelistCap.
- Set whitelist participant addresses and approved amounts.
- Calling the
finalizemethod transfers ownership of token back to crowdsale contract owner. - IMPORTANT: The contract owner must claim the token with
claimOwnershipfor the transfer of ownership to be complete.
The token ownerwill be responsible for removing the ability to mint further tokens.