Skip to content

A smart contract that lets people buy or sell a TOK token from it, using another ERC20 token. The contract holds the total amount of tokens received in exchange for all bought TOK tokens and accepts Dai as the payment method. The token price varies with the number of tokens already sold, following a bonding curve

Notifications You must be signed in to change notification settings

alofeoluwafemi/protofire-continous-token-task

Repository files navigation

Requirements

You must have the following installed on your Machine to run this code:

  • Solidity compiler
  • Metamask chrome or Firefox plugin
  • NPM
  • Truffle

Setup Process

Clone this repository

cd into the cloned project folder on your terminal from your machine

Run npm install

Request 7.5 Ethers from the rinkeby faucet https://faucet.rinkeby.io/ from your metamask wallet

Visit https://app.compound.finance/ to borrow atleast 1000 Dai with your test Ether from your metamask wallet

Add Dai token to your metamask wallet using this contract address 0x5592ec0cfb4dbc12d3ab100b257153436a1f0fea

Spread 1 Ether each to the first 3 addresses on your Metamask wallet, and 250 Dai each also.

Get an Infura API key if tiy don't hav one from https://infura.io/

Copy secret.example.json to secret.json and replace the details with yours

Run truffle console --network rinkeby

Run test linear_curve_test.js for Linear Bond Curve Token

Run test exponential_curve_test.js for Exponential Bond Curve Token

References

Any Questions

You can reach out to me via the follwing medium

About

A smart contract that lets people buy or sell a TOK token from it, using another ERC20 token. The contract holds the total amount of tokens received in exchange for all bought TOK tokens and accepts Dai as the payment method. The token price varies with the number of tokens already sold, following a bonding curve

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published