The goal of this ICO is to raise 30,000 ETH
by selling 150,000 SPC
token out of max supply of 500,000
.
The ICO has following three phases.
-
Seed Phase: In this phase, only whitelisted seed investors can invest. An individual seed investor can invest 1500 ETH at max. The total seed investment limit is 15,000 ETH.
-
General Phase: ICO will become available to general public in this phase. An individual contribution limit is 1000 ETH. The total investment limit, including funds raised from previous phase, is 30,000 ETH.
-
Open Phase: In this phase, ICO is open to everyone and there is no individual limit. At this phase, ICO should release SPC tokens to all contributors at an
exchange rate of 1 ETH to 5 SPC
.
ICO has following features:
- ICO investors can claim their SPC tokens once ICO is in open phase
- The contract owner can pause and resume the fundraising at anytime
- The contract owner can move a phase forward at anytime, but not backwards
- The contract owner can enable/disable 2% tax on Space token transfer except for initial investment in the ICO. By default, this transfer tax is disabled, Transfer tax is deposited in the treasury account.
- The treasury can move funds to ETH-SPC liquidity pool
This is Uniswap style constant product market maker pool & router to provide swapping for ETH & SPC pair.
SPC-ETH liquidity pool has following features:
- An user/contract can add (ETH,SPC) liquidity at anytime
- An user/contract can remove liquidity at anytime
- An user/contract can swap SPC for ETh or vice versa
SpaceRouter provides same functionality with built-in mechanism for price safety & slippage parameters. Users can also specify deadlines for their transactions. End users should use SpaceRouter contract.
This project uses following technologies & tools:
Solidity
for smart contract developmentOpenzeppelin
for standard solidity contractsHardhat
for local ethereum network & running testsJavaScript, Ethers, Waffle/Chai
for unit testingESLint, Prettier & Solhint
for code stylingsolidity-coverage
for code coverageJavaScript/HTML/CSS & Parcel
for minimal frontend
There are 4 main contracts:
SpaceToken.sol
implements openzeppelin based ERC-20 token (symbol:SPC
) implementationSpaceTokenICO.sol
implements the initial coin offering features described aboveEthSpcLiquidityPair.sol
implements core liquidity pool implementation with basic ERC-20 LP tokenSpaceRouter.sol
implements slippage & other safety mechanisms for end users
Contracts could be deployed on ROPSTEN
or RINKEBY
test networks or could be deployed on local hardhat instance.
- Clone repo using
git
- Run
npm install
from project directory - Open terminal 1 & run to start hardhat instance :
npx hardhat node
- Open terminal 2 & run to deploy contracts to running hardhat instance:
npx hardhat run --network localhost scripts/deploy.js
- Change directory to
frontend
- Run
npm install
- Open terminal 3 to run:
npx parcel src/index.html --no-cache
- Open
http://localhost:1234
in the browser
- Clone repo using
git
- Run
npm install
from project directory - Copy
env.example
as.env
and updateRINKEBY_URL
&PRIVATE_KEY
properties - Open terminal 1 & run:
npx hardhat run --network rinkeby scripts/deploy.js
After deployment is successful, you can update contract addresses in frontend/index.js
file from line 12-14.
Now, frontend can be run locally using instructions provided above and it will be connected to rinkeby test network.