Skip to content

ujenjt/wavestream-presale

Repository files navigation

Wavestream (WAV) Token Distribution

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.

wavestream

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).

Live on Ethereum

The contracts are currently available on Ethereum mainnet.

Mainnet

Wavestream Token (WAV): 0x7c12e49245731a2e33dbd4ef0f723cf7f2db24a0

Token Distribution (PreSale): 0x7afe338917a3c905571ffb0b7016ecc2ca3972a8

Repository structure

Main contracts:

Contracts used for tests (do not deploy):

Tests/specification:

Deployment to the testnet

Use https://etherconverter.online/ to convert big numbers.

  1. Get the code of token TestToken.sol
  2. Get the code of sale contract WavestreamPresale.sol
  3. Unlock metamask
  4. Paste the code to https://remix.ethereum.org
  5. Deploy TestToken
constructorArgs:
"40000000000000000000000"
// 40000 tokens assuming token.digits is 18
  1. Deploy WavestreamPresale
constructorArgs:

uint256 _rate,
address _priorityWallet,
uint256 _priorityCap,
address _wallet,
uint256 _cap,
ERC20 _token

"100","<priorityWalletAddr>","7000000000000000000","<mainWalletAddr>","20000000000000000000","<testTokenAddr>"
  1. Transfer tokens to smart contract address
  2. Sale is ready to go!

Development

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

Dev utilities

Running tests

npm run test

Generating test coverage report

npm run coverage

Coverage report will be located at coverage.json and coverage/index.html. It is generated with solidity-coverage.

Linting Solidity code

npm run lint

Linting is done using Solium, with additional rules from security plugin and OpenZeppelin plugin.

Auto-formatting code

# Fixes Solidity code
npm run tix-sol

# Fixes JavaScript code
npm run fix-js

# Fixes Solidity and JavaScript code
npm run fix

Generate flatten contracts

npm run flatten

Pre-commit hooks

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.

About

Contracts for running wavestream token presale

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published