RetireToucanTCO2Facet

Git Source

Inherits: ReentrancyGuard

Functions

toucanRetireExactTCO2

This contract assumes that the token being provided is a raw TCO2 token.

The transactions will revert otherwise

Redeems TCO2 directly

function toucanRetireExactTCO2(
    address carbonToken,
    uint256 amount,
    address beneficiaryAddress,
    string memory beneficiaryString,
    string memory retirementMessage,
    LibTransfer.From fromMode
) external nonReentrant returns (uint256 retirementIndex);

Parameters

NameTypeDescription
carbonTokenaddressPool token to redeem
amountuint256Amounts of underlying tokens to redeem
beneficiaryAddressaddress0x address for the beneficiary
beneficiaryStringstringString description of the beneficiary
retirementMessagestringString message for this specific retirement
fromModeLibTransfer.FromFrom Mode for transfering tokens

Returns

NameTypeDescription
retirementIndexuint256The latest retirement index for the beneficiary address

toucanRetireExactTCO2WithEntity

Redeems TCO2 directly

function toucanRetireExactTCO2WithEntity(
    address carbonToken,
    uint256 amount,
    string memory retiringEntityString,
    address beneficiaryAddress,
    string memory beneficiaryString,
    string memory retirementMessage,
    LibTransfer.From fromMode
) external nonReentrant returns (uint256 retirementIndex);

Parameters

NameTypeDescription
carbonTokenaddressPool token to redeem
amountuint256Amounts of underlying tokens to redeem
retiringEntityStringstringString description of the retiring entity
beneficiaryAddressaddress0x address for the beneficiary
beneficiaryStringstringString description of the beneficiary
retirementMessagestringString message for this specific retirement
fromModeLibTransfer.FromFrom Mode for transfering tokens

Returns

NameTypeDescription
retirementIndexuint256The latest retirement index for the beneficiary address

Events

CarbonRetired

event CarbonRetired(
    LibRetire.CarbonBridge carbonBridge,
    address indexed retiringAddress,
    string retiringEntityString,
    address indexed beneficiaryAddress,
    string beneficiaryString,
    string retirementMessage,
    address indexed carbonPool,
    address carbonToken,
    uint256 retiredAmount
);