Skip to content

Cdiamondcoin/dpt-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diamond network DPT token ERC20 Smart Contract

One of the main purposes of Cdiamondcoin Project is to create a diamond backed-up stablecoin. To use the services of the platform you will need a utility token called DPT - Diamond Platform Token. The current repository contains the ERC20 compatible smart contract of DPT token, and also the smart contract supporting the ICO of DPT.

Prerequisities

In order to compile smart contracts you need to install Dapphub's utilities. Namely: dapp, seth, solc, hevm, and ethsign.

Command Description
bash <(curl https://nixos.org/nix/install) install nix package manager.
. "$HOME/.nix-profile/etc/profile.d/nix.sh" load config for nix
git clone --recursive https://github.com/dapphub/dapptools $HOME/.dapp/dapptools download dapp seth solc hevm ethsign utilities
nix-env -f $HOME/.dapp/dapptools -iA dapp seth solc hevm ethsign install dapp seth solc hevm ethsign. This will install utilities for current user only!!

Building smart contracts

The build command invokes solc to compile all code in src and lib to out.

dapp build

Installing smart contracts

As a result of installation .abi and .bin files will be created in dpt-token/out/ folder. These files can be installed later on mainnet.

Command Description
git clone https://github.com/Cdiamondcoin/dpt-token.git Clone the smart contract code.
cd dpt-token && git submodule update --init --recursive Update libraries to the latest version.
dapp test Compile and test the smart contracts.

Deploying smart contracts

In order to deploy smart contracts you need to do the followings.

  • Deploy dpt-token/out/DPT.abi dpt-token/out/DPT.bin to install DPT token.
  • Deploy dpt-token/out/DPTICO.abi dpt-token/out/DPTICO.bin to install DPT ICO smart contract.
  • Lets assume dpt is the address of DPT token, and ico is the address of ICO smart contract. Execute as owner (dpt).approve(ico, uint(-1)) to enable for ICO smart contract to manipulate dpt tokens.

Authors

License

This project is licensed under the GPL v3 License - see the LICENSE for details.

Releases

No releases published

Packages

No packages published