Skip to content

Commit

Permalink
refactore: call autoRedeem instead of autoRedeem2
Browse files Browse the repository at this point in the history
  • Loading branch information
Lena Hierzi committed Oct 2, 2023
1 parent f98e5ef commit f06cddd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion contracts/OffsetHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ contract OffsetHelper is OffsetHelperStorage {
IToucanPoolToken PoolTokenImplementation = IToucanPoolToken(_fromToken);

// auto redeem pool token for TCO2; will transfer automatically picked TCO2 to this contract
(tco2s, amounts) = PoolTokenImplementation.redeemAuto2(_amount);
(tco2s, amounts) = PoolTokenImplementation.redeemAuto(_amount);

// update balances
balances[msg.sender][_fromToken] -= _amount;
Expand Down
23 changes: 13 additions & 10 deletions contracts/interfaces/IToucanPoolToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,27 @@ interface IToucanPoolToken is IERC20Upgradeable {

function checkEligible(address erc20Addr) external view returns (bool);

function checkAttributeMatching(address erc20Addr)
external
view
returns (bool);
function checkAttributeMatching(
address erc20Addr
) external view returns (bool);

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

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

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

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

function getRemaining() external view returns (uint256);

Expand Down

0 comments on commit f06cddd

Please sign in to comment.