Ethereum contracts for Wavestream (WAV) token distribution. Check out off-whitepaper for details on how WAV is used to create a zero-cost, adfree music listening experience built on interactive features, fair, transparent artist compensation, and community-driven development.
OpenZeppelin contracts are used as base for sale contract.
Wavestream presale contract forwards collected ether to two wallets: main wallet and priority wallet. At first, until total amount of ether raised is less than or equal to priority cap (_priorityCap
constructor argument, priorityCap
public variable), ether gets forwarded to priority wallet (_priorityWallet
constructor argument, priorityWallet
public variable). All ether in excess of priority cap is forwarded to main wallet (_wallet
constructor argument, wallet
public variable).
The contracts are currently available on Ethereum mainnet.
Wavestream Token (WAV): 0x7c12e49245731a2e33dbd4ef0f723cf7f2db24a0
Token Distribution (PreSale): 0x7afe338917a3c905571ffb0b7016ecc2ca3972a8
Main contracts:
- WavestreamPresale.sol: sale contract; allows to receive tokens in exchange to Ether.
Contracts used for tests (do not deploy):
- TestToken.sol: token contract; manages token balances.
Tests/specification:
- test-1-happy-path-cap-reached.js: specification/documentation covering basic usage of private sale contract in case of hard cap is reached.
- test-2-happy-path-sale-closed.js: specification/documentation covering basic usage of private sale contract in case of manually closing the crowdsale contract.
- test-3-profit-sharing.js: tests concerning profit sharing between wallet and priorityWallet.
- test-4-presale-deployment.js: tests concerning requirements of WavestreamPresale constructor.
- test-5-ownership.js: tests concerning ownership management.
Use https://etherconverter.online/ to convert big numbers.
- Get the code of token TestToken.sol
- Get the code of sale contract WavestreamPresale.sol
- Unlock metamask
- Paste the code to https://remix.ethereum.org
- Deploy TestToken
constructorArgs:
"40000000000000000000000"
// 40000 tokens assuming token.digits is 18
- Deploy WavestreamPresale
constructorArgs:
uint256 _rate,
address _priorityWallet,
uint256 _priorityCap,
address _wallet,
uint256 _cap,
ERC20 _token
"100","<priorityWalletAddr>","7000000000000000000","<mainWalletAddr>","20000000000000000000","<testTokenAddr>"
- Transfer tokens to smart contract address
- Sale is ready to go!
To deploy contracts, run tests and generate coverage report, you need to install dependencies first. Node.js v8.3.0 or later is required (v9.8.0 or later is recommended). After making sure Node.js is installed, install NPM dependencies:
npm install
npm run test
npm run coverage
Coverage report will be located at coverage.json
and coverage/index.html
. It is generated with solidity-coverage.
npm run lint
Linting is done using Solium, with additional rules from security plugin and OpenZeppelin plugin.
# Fixes Solidity code
npm run tix-sol
# Fixes JavaScript code
npm run fix-js
# Fixes Solidity and JavaScript code
npm run fix
npm run flatten
This project has pre-commit hooks configured. Each time you attempt to commit some code, Solium linter will be ran on all staged Solidity contracts, and Prettier will be ran on all staged JavaScript files in linter mode.
If there are any linter errors or any changes Prettier would make, committing will fail. In this case, inspect commit command output, fix all errors, stage the changes and commit again. Running npm run fix
will probably fix most of the stuff, but some errors will require manual fixing, e.g. shadowing contract state variable by function-local variable.