Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Token Sale Project

This project aims to implement a token sale for an ERC20 token with specific functionalities as outlined in the assignment. The goal is to raise funds of 2 ETH by selling ERC20 tokens to investors.

Project Description

  • Investors can participate in the token sale by sending ETH.
  • Upon purchase, tokens are immediately distributed to the respective investors.
  • The token sale automatically stops once the minimum fundraising goal of 2 ETH is achieved, and further token sale is disallowed.
  • Additionally, the token sale concludes after 32 blocks are produced post-contract deployment.
  • After the token sale ends, there's a provision to transfer all ETH from the smart contract to a specific external address.
  • This project ensures a streamlined process for fundraising through token sale while maintaining security and efficiency.

UML Design

UML_Design

Getting started

  • Clone the repository by running the following commands.
git clone https://gitlab.mindfire.co.in/abinash.p/assignment-2-token-sale
  • Setup the hardhat by following link: Click here

  • Install ethers by running the following command:

npm i ethers

Unit Testing

  • Run the following command:
npx hardhat test

Deployment

  • Create a .env file and add the necessary keys and IDs according to sample.env file.

  • Don't forget to add .env to your .gitignore.

Then, run the following command:

npx hardhat run --network <network name> scripts/deploy.js

Note:

  • To run in localhost, you have to run the following commmand, in a separate terminal:
npx hardhat node

Verification

  • To verify the contract, run the following command
npx hardhat verify --network <network name> <Deployed Address> <Args1> <Args2> ...

Code Analysis

Code coverage

  • To install the code coverage, run the following command
npm i coverage
  • To generate a code coverage report, run the following command
npx hardhat coverage

Slither analysis

  • To install slither, run the following command
pip3 install slither-analyzer
  • Slither require Python 3.8+.
  • To run slither, run the following command:
slither .

Supported Documents

Deployment

Verification

Block explorer

Sourcify

Code Analysis

Code coverage report

CodeCoverage

Slither Analysis

slither

About

This project aims to implement a token sale for an ERC20 token with specific functionalities as outlined in the assignment. The goal is to raise funds of 2 ETH by selling ERC20 tokens to investors.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages