-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Balancer strategy review #1714
Balancer strategy review #1714
Conversation
Added missing licensing getPoolAssets gas optimized
Fixed Slither
Addresses to use checksum format
…Protocol/origin-dollar into nicka/balancer-sfrxETH-stETH-rETH
Added toPoolAsset override
Gas optimization of InitializableAbstractStrategy
* Refactor base strategy to use immutables * Fixed strategy deployments in 001_core and fixtures * Generated new strategy diagrams
Added rETH conversion to ETH value
Closing as replaced by #1726 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had some comments opened while the PR closed. Nothing impactful
@@ -0,0 +1,4 @@ | |||
// SPDX-License-Identifier: MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this file?
interface IRETH { | ||
function getEthValue(uint256 _rethAmount) external view returns (uint256); | ||
|
||
function getRethValue(uint256 _ethAmount) external view returns (uint256); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: could also just leave above 2 functions defined and import an IERC20 for all others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the ERC20 functions as I was using rETH in Hardhat tests that called getEthValue
and ERC20 functions like balanceOf
.
uint256 assetIndex = 0; | ||
for (uint256 i = 0; i < tokensLength; ++i) { | ||
for (uint256 i = 0; i < tokens.length; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I guess fetching length of memory arrays shouldn't cost much if any gas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tokens
is in memory rather than storage here so we don't need to use an extra variable
if (_asset == stETH) { | ||
IERC20(stETH).approve(wstETH, 1e50); | ||
// if frxEth | ||
IERC20(stETH).safeApprove(wstETH, 1e50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch thanks!
bptBalance, | ||
address(this) | ||
); | ||
require(bptBalance == auraLp, "Aura LP != BPT"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better 👍
IERC20 rewardToken = IERC20(rewardTokenAddresses[i]); | ||
uint256 balance = rewardToken.balanceOf(address(this)); | ||
address harvesterAddr = harvesterAddress; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this save 1 storage read?
No description provided.