📑 Carbon Offset Token (COT) Smart Contract

Carbon Offset Token

The CarbonOffsetToken contract is a BEP-20 upgradable token contract representing Carbon Offset Tokens (COT). Given the upgradable nature of this contract, the token allows for the potential of minting an infinite amount of tokens by an account with the MINTER_ROLE. This capability ensures adaptability and flexibility to address future requirements.

However, for version 1.0, the token has a fixed supply of 150 million tokens. This supply has been minted to the contract deployer during initialization and subsequently delivered to the Multi-Sig Wallets that constitute the Treedefi Governance. We intend for this version to maintain this fixed supply for an extended period, ensuring stability and predictability for our token holders.

This quantity is not subject to change ensuring stability and predictability for our token holders. However, we recognize that exceptional market situations may arise that necessitate a deviation from this standard.

In such unpredictable and extraordinary circumstances, we reserve the right to assign the minter role to an address other than the deployer.

This would enable additional minting beyond the initial fixed supply. Please be assured that any decision to enable extra minting will not be taken lightly. We are committed to maintain transparency and will communicate any such changes in a timely manner to our community.

The contract allows indeed for additional tokens to be minted by an account with the MINTER_ROLE.

Furthermore, we may also employ our governance system, specifically the multi-signature (multi-sig) mechanism, to authorize this special situation. This ensures that any decision to increase the supply of COT is made collectively, with multiple parties agreeing to the change.

We appreciate your understanding and support as we navigate the complexities of the blockchain and its market while striving to maintain the integrity of the Carbon Offset Token system

Security Considerations

The CarbonOffsetToken contract has several security measures in place:

  1. Access Control: The contract uses OpenZeppelin's AccessControlUpgradeable contract to manage access to certain functions. This includes roles for minting tokens (MINTER_ROLE), pausing the contract (PAUSER_ROLE), and upgrading the contract (UPGRADER_ROLE).

  2. Pausability: The contract uses OpenZeppelin's PausableUpgradeable contract to allow pausing and unpausing of the contract. This can be used to halt all token transfers in the event of an emergency.

  3. Upgradability: The contract uses OpenZeppelin's UUPSUpgradeable contract to allow for upgrades to the contract's logic. This ensures that the contract can be improved and bugs can be fixed after it has been deploye

State Variables

The CarbonOffsetToken contract does not define any additional state variables beyond those inherited from the OpenZeppelin contracts.

Methods

The CarbonOffsetToken contract has the following key methods:

  1. initialize: This function initializes the contract, minting 150 million tokens to the contract deployer.

  2. mint: This function mints new COT tokens to a specified address. It requires the MINTER_ROLE.

  3. pause: This function pauses the contract, preventing any token transfers. It requires the PAUSER_ROLE.

  4. unpause: This function unpauses the contract, allowing token transfers to resume. It requires the PAUSER_ROLE.

  5. upgradeTo: This function upgrades the contract to a new implementation. It requires the UPGRADER_ROLE.

  6. upgradeToAndCall: This function upgrades the contract to a new implementation and then calls a function on the new implementation. It requires the UPGRADER_ROLE.

  7. burn: This function burns a specified amount of tokens from the caller's account.

In addition, the contract overrides the _beforeTokenTransfer function from the ERC20Upgradeable contract to ensure that token transfers cannot occur while the contract is paused.

Last updated