Carbon Pool contracts

All carbon pools have the same standard functions

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 app.toucan.earth/contracts.

deposit

Accepts TCO2 deposits into the pool, and mints an equivalent number of the pool's reference tokens

function deposit(address erc20Addr, uint256 amount) external virtual;

Parameters

Note: you have to approve the pool contract in the TCO2 token that is to be deposited in order for the pool to be able to transfer the TCO2 on your behalf.

checkEligible

Checks if token can be deposited in the pool. Each pool comes with its own eligibility criteria.

function checkEligible(address erc20Addr) public view virtual returns (bool);

Parameters

Return Values

calculateRedeemFees

Calculates the amount of fees paid to selectively redeem TCO2 tokens. Pool fees are levied in the carbon pool's reference token.

function calculateRedeemFees(
        address[] memory tco2s,
        uint256[] memory amounts
) external view virtual returns (uint256);

Parameters

The tco2s and amounts arrays have to be of equal length, and related to each other by index — i.e. redeem the number of tokens specified in amounts[3] of TCO2 contract address tco2s[3] from the pool.

Return Values

redeemMany

Selectively redeems carbon reference tokens for underlying TCO2 tokens. This is 1:1, minus fees. The user's pool tokens get burnt in the process.

function redeemMany(address[] memory tco2s, uint256[] memory amounts)
        external virtual;

Parameters

It's of note that the arrays have to be of equal length — see note above.

redeemAuto

Automatically redeems pool tokens for underlying TCO2 tokens. This is 1:1 and doesn't incur fees. You will receive TCO2 tokens that are considered lower quality based on an index called scoredTCO2s (explained here). The user's reference tokens get burnt within the process. The function returns arrays of the contract addresses and amounts of the TCO2 tokens redeemed.

function redeemAuto(uint256 amount) external virtual
        returns (address[] memory tco2s, uint256[] memory amounts);

Parameters

Return Values

redeemAuto2

Automatically redeems pool tokens for underlying TCO2 tokens. This is 1:1 and doesn't incur fees. You will receive TCO2 tokens that are considered lower quality based on an index called scoredTCO2s (explained here). The user's reference tokens get burnt within the process. The function returns arrays of the contract addresses and amounts of the TCO2 tokens redeemed.

function redeemAuto2(uint256 amount) external virtual
        returns (address[] memory tco2s, uint256[] memory amounts);

Parameters

Return Values

redeemAndBurn

Redeems a whitelisted TCO2 tokens without paying any fees and immediately burns it. This is not a retirement, but a burn of the TCO2. It is used to clean the pools of subpar TCO2s, and was initially added to burn HFC-23 credits. The user's pool tokens get burnt within the process.

function redeemAndBurn(address tco2, uint256 amount) external;

Parameters

Note: you have to approve the pool token from the TCO2 contract that is to be redeemed and burned in order for this to work.

getScoredTCO2s

Returns an array of ranked TCO2 addresses.

scoredTCO2s[0] is the lowest ranked TCO2's contract address — the rank is then ascending

It's important to note that (currently) this is set manually which means sometimes some of the returned addresses may have a balance of 0 within the pool.

function getScoredTCO2s() external view returns (address[] memory);

Return values

getRemaining

Returns the remaining space in the pool before hitting its cap.

function getRemaining() public view returns (uint256);

Return values

Last updated