Carbon pool contracts
All carbon pools have the same standard functions
Last updated
Was this helpful?
All carbon pools have the same standard functions
Last updated
Was this helpful?
Toucan's Carbon Pool smart contracts extend the ERC20 standard — carbon reference tokens are ERC20 tokens. Pool contracts are upgradeable. Contract addresses for deployed carbon pools can be found at .
View function to calculate deposit fees pre-execution
User specifies in front-end the address and amount they want
tco2
address
TCO2 contract address
amount
uint256
Amount to redeem
feeDistributionTotal
uint256
Total fee amount to be paid
View function to calculate fees pre-execution, according to the amounts of TCO2 to be redeemed.
tco2s
address[]
Array of TCO2 contract addresses
amounts
uint256[]
Array of TCO2 amounts to redeem The indexes of this array are matching 1:1 with the tco2s array.
toRetire
bool
Whether the TCO2s will be retired atomically with the redemption. It may be that lower fees will be charged in this case. Currently not supported.
feeDistributionTotal
uint256
Total fee amount to be paid
Checks if token to be deposited is eligible for this pool. Reverts if not. Beware that the revert reason might depend on the underlying implementation of IPoolFilter.checkEligible
vintageToken
address
the contract to check
isEligible
bool
true if address is eligible and no other issues occur
Deposit function for pool that accepts TCO2s and mints pool token 1:1
Eligibility of the ERC20 token to be deposited is checked via checkEligible
tco2
address
TCO2 to be deposited. The pool contract needs to be approved in the TCO2 contract by the caller in order to allow the transfer of TCO2 tokens to the pool
amount
uint256
Amount of TCO2 to be deposited
maxFee
uint256
Maximum fee to be paid for the deposit. This value cannot be zero. Use calculateDepositFees(tco2,amount)
to determine the fee that will be charged given the state of the pool during this call. Add a buffer on top of the returned fee amount up to the maximum fee you are willing to pay.
mintedPoolTokenAmount
uint256
Amount of pool tokens minted to the caller
Redeem TCO2s for pool tokens 1:1 minus fees The amounts provided are the exact amounts of TCO2s to be redeemed.
tco2s
address[]
Array of TCO2 contract addresses
amounts
uint256[]
Array of TCO2 amounts to redeem The indexes of this array are matching 1:1 with the tco2s array.
maxFee
uint256
Maximum fee to be paid for the redemption. This value cannot be zero. Use calculateRedemptionOutFees(tco2s,amounts,false)
to determine the fee that will be charged given the state of the pool during this call. Add a buffer on top of the returned fee amount up to the maximum fee you are willing to pay.
poolAmountSpent
uint256
The amount of pool tokens spent by the caller