Smart Contracts¶
GITHUB LINK: CarbonPath Smart Contract
SECURITY AUDIT: Hacken Smart Contract Review & Report
Contract Types¶
CarbonPathAdmin
a contract that handles different interactions with CarbonPathToken (CPCO2) and CarbonPathNFT and serves as an admin for both contracts. Users can buy CPC02 tokens and retire them for a certain well.
CarbonPathNFT
ERC721 token that bounds to a well. Contains the geolocation of a well and additional metadata.
CarbonPathToken
ERC20 mintable and burnable token that represents locked carbon emission.
Priviledged Roles¶
Default Admin
CarbonPathAdmin: can grant and revoke minter role, set receiver of CP fee, non-profit address, buffer pool address, seller address.
CarbonPathToken: can grant and revoke minter role
Minter
CarbonPathAdmin: can mint new tokens, update token URI and metadata
CarbonPathToken: can mint, burn tokens
Owner (CarbonPathNFT Only)
CarbonPathNFT: can set admin address
Admin (CarbonPathNFT Only)
CarbonPathNFT: can set metadata and URI for a specific token, mint new tokens, and increase the amount of retired CPCO2 tokens
Functions¶
Mint
Mints a new well. This also attaches the geoJSON, metadata and well files to the minted well.
- During minting, CPCO2 Tokens are airdropped to the following recipients:
cpFeeAddress will receive advancedAmount * cpFeePercentage of CPCO2 Tokens.
operatorAddress will receive advancedAmount * (100% - cpFeePercentage) of CPCO2 Tokens.
bufferPoolAddress will receive bufferPoolAmount * 95% of CPCO2 Tokens.
nonProfitAddress will receive bufferPoolAmount * 5% of CPCO2 Tokens.
NOTE: CarbonPath may update the metadata and well files even after the well is minted
Buy
Buy CPCO2 Tokens from the contract
Current Exchange Rate is 1 CPCO2 = 30 cUSD
Retire
Retire a CPCO2 token permanently locking the CO2.
It will automatically update the retire info for the chosen well.
Sell
NOTE: FOR CARBONPATH WALLETS ONLY
Transfer CPCO2 tokens to the contract for selling. All tokens owned by the contract are considered sellable.
Withdraw
NOTE: FOR CARBONPATH WALLETS ONLY
Withdraw stored CPCO2 Tokens from the contract and remove them as sellable