Skip to content

nidhaloff/chexchexchex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chexchexchex contract

How to Build

  • cd to 'build' directory
  • run the command 'cmake ..'
  • run the command 'make'

After build -

  • The built smart contract is under the 'chexchexchex' directory in the 'build' directory
  • You can then do a 'set contract' action with 'cleos' and point in to the './build/chexchexchex' directory
  • Additions to CMake should be done to the CMakeLists.txt in the './src' directory and not in the top level CMakeLists.txt

How to use

create

Parameters

  • issuer
  • maximum_supply

Intent

The intent of create is to create a new token with a `maximum_supply} as indicated. The format of the asset must include the correct number of decimal places, and the token symbol. For example, 1000000000.00000000 CHEX will create a supply of 1 billion CHEX tokens, with 8 decimal places of precision.

issue

Parameters

  • to
  • quantity
  • memo

Intent

The intent of issue is to generate quantity new tokens and allocate them to the to account. New tokens can not be issued beyond the value of maximum_supply. The memo can be used to explain why the tokens are being issued.

retire

Parameters

  • quantity
  • memo

Intent

The intent of retire is to remove quantity tokens from circulation. The memo can be used to explain why the tokens are being removed.

transfer

Parameters

  • from
  • to
  • quantity
  • memo

Intent

The intent of transfer is to change the ownership of quantity tokens from the account from to the account to. Only unlocked tokens can be transferred. The memo can be used to explain why the tokens are being transferred.

open

parameters

  • owner
  • symbol
  • ram_payer

Intent

The intent of open is to create a table entry for a token with symbol symbol for the owner. The {ram_payer} pays the ram for the table entry.

close

parameters

  • owner
  • symbol

Intent

The intent of close is to delete a table entry for a token with symbol symbol for the owner. The {ram_payer} will get their RAM back upon success. A table entry for the token data can only be closed if the user has no token balance.

lock

parameters

  • owner
  • quantity
  • days

Intent

The intent of lock is to lock quantity tokens of owner for days days. When the tokens are locked, they can not be used. Only when the unlock action is called will the timer start for unlocking the locked tokens. You can lock different amounts of tokens for different amounts of time.

unlock

parameters

  • owner
  • quantity

Intent

The intent of unlock is to move quantity locked tokens to the unlocked state, allowing the owner to use them. When tokens are unlocked, a timer starts to move them to the unlocked state. The timer takes an amount of time equal to days, which was determined when the tokens were locked. The first tokens to unlock are the ones with the shortest locking period.

burn

parameters

  • owner
  • quantity

Intent

The intent of burn is to permanently destroy quantity tokens belonging to owner. This will reduce the balance of the owner account by quantity and it will also reduce the supply and maximum_supply by the quantity as well.

About

The CHEX token contract

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 86.2%
  • C++ 12.8%
  • CMake 1.0%