Skip to content
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

Conversation

naddison36
Copy link
Collaborator

No description provided.

@naddison36 naddison36 self-assigned this Jul 25, 2023
@naddison36 naddison36 added contracts Works related to contracts OETH OETH related things labels Jul 25, 2023
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 25, 2023 03:52 Inactive
@rafaelugolini rafaelugolini had a problem deploying to preview-ousd-nicka-bala-esai9i July 25, 2023 03:52 Failure
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 25, 2023 03:54 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-esai9i July 25, 2023 03:54 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 25, 2023 04:02 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-w2rpqh July 25, 2023 04:02 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-pm3phw July 25, 2023 04:07 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 25, 2023 04:07 Inactive
Fixed Slither
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-lf7dij July 25, 2023 04:22 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 25, 2023 04:22 Inactive
@shahthepro shahthepro temporarily deployed to preview-oeth-nicka-bala-1fwxls July 25, 2023 06:58 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-r2obd1 July 25, 2023 06:58 Inactive
Addresses to use checksum format
…Protocol/origin-dollar into nicka/balancer-sfrxETH-stETH-rETH
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-rz5w1v July 25, 2023 07:18 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 25, 2023 07:18 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-lx67ej July 25, 2023 11:05 Inactive
Added toPoolAsset override
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 25, 2023 12:23 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-4hauoh July 25, 2023 12:23 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 25, 2023 12:27 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-02cln0 July 25, 2023 12:27 Inactive
Gas optimization of InitializableAbstractStrategy
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 26, 2023 02:53 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-ilsawk July 26, 2023 02:53 Inactive
* Refactor base strategy to use immutables

* Fixed strategy deployments in 001_core and fixtures

* Generated new strategy diagrams
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 26, 2023 22:52 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-8da1vd July 26, 2023 22:52 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-eieoqc July 27, 2023 04:43 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 27, 2023 04:43 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-89oc8p July 27, 2023 14:21 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 27, 2023 14:21 Inactive
Added rETH conversion to ETH value
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 28, 2023 03:17 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-yzkeq1 July 28, 2023 03:17 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-bala-uatzbf July 28, 2023 04:54 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-bala-1fwxls July 28, 2023 04:54 Inactive
@naddison36
Copy link
Collaborator Author

Closing as replaced by #1726

@naddison36 naddison36 closed this Jul 31, 2023
Copy link
Member

@sparrowDom sparrowDom left a 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
Copy link
Member

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

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

Copy link
Collaborator Author

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.

contracts/contracts/proxies/Proxies.sol Show resolved Hide resolved
uint256 assetIndex = 0;
for (uint256 i = 0; i < tokensLength; ++i) {
for (uint256 i = 0; i < tokens.length; ++i) {
Copy link
Member

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?

Copy link
Collaborator Author

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

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

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;
Copy link
Member

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?

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

Successfully merging this pull request may close these issues.

4 participants