Skip to content

Conversation

Cipioo
Copy link
Contributor

@Cipioo Cipioo commented Apr 25, 2022

No description provided.

}

proxy.safeExecute(_gauge, 0, abi.encodeWithSignature("getReward()"));
proxy.safeExecute(_gauge, 0, claimRewardsString[_gauge]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break in the case where the gauge's withdrawLocked method only accepts a single kek_id argument, like with FRAX/USDC?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because this one is "withdrawV2", the FRAX/DAI and FRAX/USDC ones use "withdrawV3"

require(strategies[_gauge] == msg.sender, "!strategy");

proxy.safeExecute(_gauge, 0, abi.encodeWithSignature("getReward()"));
proxy.safeExecute(_gauge, 0, claimRewardsString[_gauge]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto


uint256 _frax = IERC20(FRAX).balanceOf(address(this));

IERC20(FRAX).safeApprove(templeRouter, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I lean towards giving infinite approvals in the constructor, but that's a matter of preference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, would save us on a bit of gas too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants