Skip to content

cnhcgroup/cnhc-contracts

Repository files navigation

CNH Coin (CNHC)

Trust Reserve Limited (TRL) issues CNH collateralized stablecoin public smart contract repository.

Official website: https://www.trustreserve.com

View ERC20 token (Ethereum) contract

View ERC20 token (Conflux eSpace) contract

View CRC20 token (Conflux Core) contract

ABI, address, and verification

The contract abi is in CNHCToken.abi. It is the abi of the implementation contract. CNHCToken.json is a fully compiled file generated by truffle. You can view our independent security audits by PeckShield and Beosin in audit-reports.

Contract Specification

CNHC is a token that is Centrally Minted and Burned by TRL, representing the trusted party backing the token with CNH.

ERC20 Token

The public interface of CNHC is the ERC20 interface specified by EIP-20.

  • name()
  • symbol()
  • decimals()
  • totalSupply()
  • balanceOf(address who)
  • transfer(address to, uint256 value)
  • approve(address spender, uint256 value)
  • allowance(address owner, address spender)
  • transferFrom(address from, address to, uint256 value)

And the usual events.

  • event Transfer(address indexed from, address indexed to, uint256 value)
  • event Approval(address indexed owner, address indexed spender, uint256 value)

Typical interaction with the contract will use transfer to move the token as payment. Additionally, a pattern involving approve and transferFrom can be used to allow another address to move tokens from your address to a third party without the need for the middleperson to custody the tokens, such as in the 0x protocol.

Controlling the token supply

The total supply of CNHC is backed by fiat held in reserve at TRL. An owner address can submit proposals for minting and burning the token and several voters can audit the proposals based on the actual movement of cash in and out of the reserve based on requests for the purchase and redemption of CNHC.

Votable Events

  • OpenProposal(uint16 pid);
  • CloseProposal(uint16 pid);
  • DoneProposal(uint16 pid);
  • VoteProposal(uint16 pid, address voter);
  • AddVoter(address voter);
  • RemoveVoter(address voter);

Pausing the contract

In the event of a critical security threat, Trust Reserve Limited has the ability to pause and unpause transfers and approvals of the CNHC token. The ability is controlled by a single owner role, following OpenZeppelin's Ownable. The simple model for pausing transfers following OpenZeppelin's Pausable.

Contract Tests

To run smart contract tests first start

ganache-cli

in another terminal

Then run

truffle test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published