Skip to content

VladislavGlupak/KaseiCoin-Crowdsale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers

KaseiCoin-Crowdsale

This repository represents a fungible token that is ERC-20 compliant and that will be minted by using a Crowdsale contract from the OpenZeppelin Solidity library. The contract allows user manage the entire crowdsale process, allowing users to send ether to the contract and in return receive KaseiCoin tokens. Contract mints the tokens automatically and distributes them to buyers in one transaction.


Technologies

This project leverages the following tools for financial analysis:

  • Solidity - programming language for implementing smart contracts.

  • Remix IDE - Remix IDE allows developing, deploying and administering smart contracts for Ethereum like blockchains.

  • TruffleSuite - Ganache - a personal Ethereum blockchain.

Solidity version:

pragma solidity ^0.5.0

OpenZeppelin libraries:

CrowdSale:

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/crowdsale/Crowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/crowdsale/emission/MintedCrowdsale.sol";

ERC20 token:

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/token/ERC20/ERC20Detailed.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/token/ERC20/ERC20Mintable.sol";

How to run

Step 1 - Install Ganache

Pls, download and install Ganache from https://trufflesuite.com/ganache/

Step 2 - Install and Configure the wallet Metamask

Pls, download and install wallet Metamask from https://metamask.io

Configure the Metamask:

  • copy private account keys from Ganache and import them to create the Accounts

Screenshot

  • configure network like on the screenshot

Screenshot

Step 3 - Open the smart contracts in the Remix IDE

Screenshot

Inject the testing account from the Ganache:

Screenshot

Confirm injection:

Screenshot

Step 4 - Compile and deploy Deployer contract

  • compile smart contracts:

KaseiCoin:

Screenshot

KaseiCoinCrowdsale and KaseiCoinCrowdsaleDeployer:

Screenshot

Deploy Deployer

Pls, select and provide:

  • deployer contract;

  • NAME of Coin (Kasei);

  • SYMBOL of Coin (KAS);

  • WALLET (any valid address).

Screenshot

Click on Transact and confirm transaction in the Metamask

Screenshot

Check transaction in the Ganache:

Screenshot

Account balance:

Screenshot

Step 5 - Link the contract's addresses to the Remix

First use functions under CrowdSaleDeployer for taking contract's addresses:

CrowdSale contract

Screenshot

KaseiCoin contract

Screenshot

Second put addresses to At address field for linking contracts:

Screenshot

Screenshot

Finally contracts and their functions are got available for testing:

Screenshot

and

Screenshot

Step 6 - Interact with contracts

Try to buy tokens. Input value and address:

In my case Value is 5 Ethers.

Screenshot

Confirm with Metamask:

Screenshot

Check transaction in the Ganache:

Screenshot

and with function balanceOf check balance associated with testing account(s)

Screenshot

View the total supply of minted tokens:

Screenshot

View the amount of wei that has been raised in the crowdsale contract:

Screenshot


Contributors

Glupak Vladislav Linkedin

License

License: MIT

Releases

No releases published

Packages

No packages published