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

[VEN-2516] Deploy weETH Oracle #175

Merged
merged 17 commits into from
Apr 12, 2024

Conversation

web3rover
Copy link
Contributor

Description

Resolves #

Checklist

  • I have updated the documentation to account for the changes in the code.
  • If I added new functionality, I added tests covering it.
  • If I fixed a bug, I added a test preventing this bug from silently reappearing again.
  • My contribution follows Venus contribution guidelines.

@web3rover web3rover closed this Apr 4, 2024
@web3rover web3rover deleted the feat/deploy-weETH-oracle branch April 4, 2024 11:55
@web3rover web3rover restored the feat/deploy-weETH-oracle branch April 4, 2024 11:55
@web3rover web3rover reopened this Apr 4, 2024
@web3rover web3rover changed the base branch from develop to feat/derivative-prices April 4, 2024 11:56
Copy link

github-actions bot commented Apr 4, 2024

Code Coverage

Package Line Rate Branch Rate Health
contracts 85% 80%
contracts.interfaces 28% 21%
contracts.oracles 96% 81%
contracts.oracles.common 100% 100%
Summary 87% (264 / 302) 76% (136 / 178)

@chechu chechu added the sepolia label Apr 4, 2024
@web3rover web3rover requested review from chechu and 0xlucian April 5, 2024 10:37
@web3rover web3rover marked this pull request as ready for review April 5, 2024 10:37
hardhat.config.ts Outdated Show resolved Hide resolved
EtherFiLiquidityPool = mockEtherFiLiquidityPool.address;
await mockEtherFiLiquidityPool.transferOwnership(proxyOwnerAddress);
}

Copy link
Member

Choose a reason for hiding this comment

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

I would also deploy the mocks tokens for weETH and eETH if the address is not available in the ADDRESSES mapping (for example on hardhat). /cc @coreyar

Copy link
Collaborator

Choose a reason for hiding this comment

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

I highly recommend not using address mappings at all and instead fetching deployments

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can structure deployment scripts into 3 types of scripts for each deployment, (mocks, deploy, setup)
for example there could be
deploy/6-mocks-weETH-oracle.ts ( mocks wouldn't run in the right order but a name like dependencies would )
deploy/6-deploy-weETH-oracle.ts
deploy/6-setup-weETH-oracle.ts

Where setup receives an id so that it is only run once and mocks isn't deployed on live networks ( it would deploy the token contracts Jesus mentions) deploy only deploys contracts and setup doesn't deploy and only calls methods on contracts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now this deployment script is following the pattern of the other deployment scripts in this repo.

I agree with your comments but I think we should make these changes in all the deployment scripts and not just this one to keep consistency. I would suggest we create a separate ticket and PR for this changes and this it itself requires a lot of code fixes.

wdyt @coreyar @chechu ?

Copy link
Member

Choose a reason for hiding this comment

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

VEN-2547. We can leave this as it is in this PR, and review it in the new task.


export default func;
func.tags = ["weETH"];
func.skip = async (hre: HardhatRuntimeEnvironment) => hre.network.name !== "ethereum" && hre.network.name !== "sepolia";
Copy link
Member

Choose a reason for hiding this comment

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

Let's enable the deployment to hardhat too

Copy link
Collaborator

Choose a reason for hiding this comment

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

script 4 is also skipped on hardhat

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even this I think we should review for all the scripts and fix them if we want to enable for hardhat

Copy link
Member

Choose a reason for hiding this comment

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

VEN-2547

function amountForShare(uint256 _share) external view override returns (uint256) {
return (_share * amountPerShare) / 1e18;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Our linting should catch and fix files that don't end with a newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

proxy: {
owner: proxyOwnerAddress,
proxyContract: "OptimizedTransparentProxy",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

should we add skipIfAlreadyDeployed flag here? Just for consistency I guess wit will be okay. However it will not have any impact on the deployment (or any potential impl updates as we will have a separate script for impl update if needed)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added skipIfAlreadyDeployed to this deployment. I think without skipIfAlreadyDeployed=true the contracts are getting re-deployed. So I think we should have a separate issue to include this flag in all the deployment scripts.

@@ -81,4 +80,4 @@ describe("WeETHOracle unit tests", () => {
expect(price).to.equal(parseUnits("3199.9033516136821482", 18));
Copy link
Contributor

Choose a reason for hiding this comment

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

can we either have a comment how did we calculated this price or perform the exact calculation as a parameter in the equal expression

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a comment.

@web3rover web3rover merged commit 4bc86e5 into feat/derivative-prices Apr 12, 2024
@web3rover web3rover deleted the feat/deploy-weETH-oracle branch April 12, 2024 05:59
@chechu chechu mentioned this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants