Conversation
src/backscratcher/StrategyProxy.sol
Outdated
| } | ||
|
|
||
| proxy.safeExecute(_gauge, 0, abi.encodeWithSignature("getReward()")); | ||
| proxy.safeExecute(_gauge, 0, claimRewardsString[_gauge]); |
There was a problem hiding this comment.
Would it be helpful to have a default/fallback like so?
proxy.safeExecute(_gauge, 0,
claimRewardsString[_gauge].length == 0 ? abi.encodeWithSignature("getReward()") : claimRewardsString[_gauge]);
Please ignore if you anticipate that claimRewardsString can always be reliably defined when approveStrategy is invoked.
There was a problem hiding this comment.
We cannot pass "" into the calldata parameter, we could try passing "0x0" but I am confident we can encode the ABI for the string we need.
src/backscratcher/StrategyProxy.sol
Outdated
| require(thisStake.liquidity != 0, "kek_id not found"); | ||
|
|
||
| if (thisStake.liquidity > 0) { | ||
| proxy.safeExecute(_gauge, 0, abi.encodeWithSignature("withdrawLocked(bytes32,address)", _kek_id, address(proxy))); |
There was a problem hiding this comment.
Doesn't this break in the case where the gauge's withdrawLocked method only accepts a single kek_id argument, like with FRAX/USDC?
There was a problem hiding this comment.
No, because this one is "withdrawV2", the FRAX/DAI and FRAX/USDC ones use "withdrawV3"
src/backscratcher/StrategyProxy.sol
Outdated
| require(strategies[_gauge] == msg.sender, "!strategy"); | ||
|
|
||
| proxy.safeExecute(_gauge, 0, abi.encodeWithSignature("getReward()")); | ||
| proxy.safeExecute(_gauge, 0, claimRewardsString[_gauge]); |
|
|
||
| uint256 _frax = IERC20(FRAX).balanceOf(address(this)); | ||
|
|
||
| IERC20(FRAX).safeApprove(templeRouter, 0); |
There was a problem hiding this comment.
I lean towards giving infinite approvals in the constructor, but that's a matter of preference.
There was a problem hiding this comment.
Agreed, would save us on a bit of gas too.
No description provided.