You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
line 379 - 398 in '/src/hardhat/contracts/Bridges/CrossChainBridgeBacker.sol'
// Swap canToken for anyToken [GOVERNANCE CALLABLE]
function swapCanonicalForAny(uint256 token_type, uint256 token_amount) external onlyByOwnGov {
_swapCanonicalForAny(token_type, token_amount);
}
// Swap anyToken for canToken [INTERNAL]
function _swapCanonicalForAny(uint256 token_type, uint256 token_amount) internal {
if (token_type == 0) {
// FRAX
// Approve and swap
canFRAX.approve(address(canFRAX), token_amount);
canFRAX.exchangeCanonicalForOld(address(anyFRAX), token_amount);
}
else {
// FXS
// Approve and swap
canFXS.approve(address(canFXS), token_amount);
canFXS.exchangeCanonicalForOld(address(anyFXS), token_amount);
}
}
I think the commented code should be // swap canToken for anyToken [INTERNAL]. But more importantly, shouldn't it be anyFRAX.approve(address(canFRAX), token_amount); and anyFXS.approve(address(canFXS), token_amount);?
The text was updated successfully, but these errors were encountered:
Good catch. I will update the comment. As for the approvals, the function takes in canTokens and gives out anyTokens, so the canTokens are the ones that need to be pulled in
line 379 - 398 in '/src/hardhat/contracts/Bridges/CrossChainBridgeBacker.sol'
I think the commented code should be // swap canToken for anyToken [INTERNAL]. But more importantly, shouldn't it be
anyFRAX.approve(address(canFRAX), token_amount);
andanyFXS.approve(address(canFXS), token_amount);
?The text was updated successfully, but these errors were encountered: