RetireSourceFacet

Git Source

Inherits: ReentrancyGuard

Functions

retireExactSourceDefault

Retires an exact amount of a source token using default redemption

function retireExactSourceDefault(
    address sourceToken,
    address poolToken,
    uint256 maxAmountIn,
    string memory retiringEntityString,
    address beneficiaryAddress,
    string memory beneficiaryString,
    string memory retirementMessage,
    LibTransfer.From fromMode
) external payable nonReentrant returns (uint256 retirementIndex);

Parameters

NameTypeDescription
sourceTokenaddressSource ERC-20 token to use for the retirement
poolTokenaddressPool token to use for this retirement
maxAmountInuint256Maximum amount of source tokens to spend in this retirement
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

retireExactSourceSpecific

Retires an exact amount of a source token using specific redemption

Initial value set assuming source == pool.

function retireExactSourceSpecific(
    address sourceToken,
    address poolToken,
    address projectToken,
    uint256 maxAmountIn,
    string memory retiringEntityString,
    address beneficiaryAddress,
    string memory beneficiaryString,
    string memory retirementMessage,
    LibTransfer.From fromMode
) external payable nonReentrant returns (uint256 retirementIndex);

Parameters

NameTypeDescription
sourceTokenaddressSource ERC-20 token to use for the retirement
poolTokenaddressPool token to use for this retirement
projectTokenaddressProject token to redeem and retire
maxAmountInuint256Maximum amount of source tokens to spend in this retirement
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 poolToken,
    uint256 retiredAmount
);