Giter VIP home page Giter VIP logo

ico's Introduction

Initial Coin Offering (ICO) contract

Table of Content

Project Description

This Initial Coin Offering(ICO) project helps to buy Rapid tokens in exchange for Ether as per the current price of ether in the dollar. The rapid token price is 1 Dollar so if a user wants to buy the rapid token then he needs to pay 1 dollar of worth ether.

Technologies Used

  • Soldity
  • Openzepplein
  • Chainlink
  • Hardhat

A typical top-level directory layout

.
├── Contracts               # Contract files (alternatively `dist`)
├── Scripts                 # Script files (alternatively `deploy`)
├── test                    # Automated tests (alternatively `spec` or `tests`)
├── LICENSE
└── README.md

Install and Run

To run this project, you must have the following installed:

  1. nodejs
  2. npm
  • Run npm install to install dependencies
$ npm install
  • Run npx hardhat compile to compile all contracts.
$ npx hardhat compile

Test

For a unit testing smart contract using the command line.

$ npx hardhat test

Expecting icoTest.js result.

  Initial Coin Offering (ICO) contract
    ✔ Should revert if deploy on other then goerli network
    ✔ should revert if token amount is zero (49ms)
    ✔ should transfer rapid token to buyer (40ms)
    ✔ user should provide equal or more ether to buy rapid token
    ✔ should transfer wei amount if user provide more then needed
    ✔ Buy token with ether
    ✔ Do not have enough ether to buy token
    ✔ Withdraw ether from contract (43ms)
    ✔ Do not have permission to withdraw ether from contract 
(40ms)


  9 passing (4s)

After testing if you want to deploy the contract using the command line.

$ npx hardhat node
# Open another Terminal
$ npx hardhat run scripts/deploy.js

# result in npx hardhat node Terminal
web3_clientVersion
eth_chainId
eth_accounts
eth_chainId
eth_estimateGas
eth_gasPrice
eth_sendTransaction
  Contract deployment: <UnrecognizedContract>
  Contract address:    0x5fb...aa3
  Transaction:         0x4d8...945
  From:                0xf39...266
  Value:               0 ETH
  Gas used:            323170 of 323170
  Block #1:            0xee6...85d

eth_chainId
eth_getTransactionByHash
eth_blockNumber
eth_chainId (2)
eth_getTransactionReceipt

# result in npx hardhat run Terminal
Initial Coin Offering (ICO) contract deployed to: 0x5Fb...aa3

ico's People

Contributors

vijayrajpanchall avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.