RetireCarbonFacet
Inherits: ReentrancyGuard
Functions
retireExactCarbonDefault
Retires an exact amount of carbon using default redemption
function retireExactCarbonDefault(
address sourceToken,
address poolToken,
uint256 maxAmountIn,
uint256 retireAmount,
string memory retiringEntityString,
address beneficiaryAddress,
string memory beneficiaryString,
string memory retirementMessage,
LibTransfer.From fromMode
) external payable nonReentrant returns (uint256 retirementIndex);
Parameters
Name | Type | Description |
---|---|---|
sourceToken | address | Source ERC-20 token to use for the retirement |
poolToken | address | Pool token to use for this retirement |
maxAmountIn | uint256 | Maximum amount of source tokens to spend in this retirement |
retireAmount | uint256 | The amount of carbon to retire |
retiringEntityString | string | String description of the retiring entity |
beneficiaryAddress | address | 0x address for the beneficiary |
beneficiaryString | string | String description of the beneficiary |
retirementMessage | string | String message for this specific retirement |
fromMode | LibTransfer.From | From Mode for transfering tokens |
Returns
Name | Type | Description |
---|---|---|
retirementIndex | uint256 | The latest retirement index for the beneficiary address |
retireExactCarbonSpecific
Retires an exact amount of carbon using specific redemption
function retireExactCarbonSpecific(
address sourceToken,
address poolToken,
address projectToken,
uint256 maxAmountIn,
uint256 retireAmount,
string memory retiringEntityString,
address beneficiaryAddress,
string memory beneficiaryString,
string memory retirementMessage,
LibTransfer.From fromMode
) external payable nonReentrant returns (uint256 retirementIndex);
Parameters
Name | Type | Description |
---|---|---|
sourceToken | address | Source ERC-20 token to use for the retirement |
poolToken | address | Pool token to use for this retirement |
projectToken | address | Project token to redeem and retire |
maxAmountIn | uint256 | Maximum amount of source tokens to spend in this retirement |
retireAmount | uint256 | The amount of carbon to retire |
retiringEntityString | string | String description of the retiring entity |
beneficiaryAddress | address | 0x address for the beneficiary |
beneficiaryString | string | String description of the beneficiary |
retirementMessage | string | String message for this specific retirement |
fromMode | LibTransfer.From | From Mode for transfering tokens |
Returns
Name | Type | Description |
---|---|---|
retirementIndex | uint256 | The 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
);