-
Notifications
You must be signed in to change notification settings - Fork 0
Prepare contracts for deployment #3
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
base: initial-commit
Are you sure you want to change the base?
Conversation
/// AggregatorV2V3Interface which is usually implemented with Api3 proxies. The | ||
/// user of this contract needs to be aware of this and only use this contract | ||
/// where the IApi3ReaderProxy interface is expected. | ||
contract WstETHApi3ReaderProxyV1 is IApi3ReaderProxy { |
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.
We'll need to deploy and verify this contract on etherscan. What is the best way to do that?
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.
Current hardhat version uses ignition plugin for deploying contract but I've had some issues with it in the past like trying to get the deployment block for a contract, etc. So on the other repos we usually just rely on hardhat-deploy plugin to handle deployments via deployment scripts. For verifying the contracts we can use hardhat-verify plugin and run it in a deployment script like @api3/contracts does it.
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.
Yeah, let's do the HH deploy plugin.
I don't think we need the verify plugin in the repo, but I'll need this for the deployment. Let's quickly sync on that on Slack.
Initial commit with contracts and boilerplate files
contracts/IWstETH.sol
Outdated
@@ -0,0 +1,9 @@ | |||
// 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.
This file should go inside the ./interfaces folder
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.
Not super important though, because I don't want to merge the PR anyway. I just want to deploy the contracts.
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.
Ok. we could also then just put it in the same contract file 🤷🏻
contracts/IWstETH.sol
Outdated
@@ -0,0 +1,9 @@ | |||
// SPDX-License-Identifier: MIT | |||
pragma solidity ^0.8.27; |
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.
It is a good practice for interface files to aim for the oldest compatible version within the major series of its primary consumers to maximize its utility. Other interfaces in this repo use 0.8.4 but I guess this one can even use as low as 0.8.0 since the contract deployed on mainnet uses 0.6.12.
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.
No need I guess. This is more like one-off deployment.
/// AggregatorV2V3Interface which is usually implemented with Api3 proxies. The | ||
/// user of this contract needs to be aware of this and only use this contract | ||
/// where the IApi3ReaderProxy interface is expected. | ||
contract WstETHApi3ReaderProxyV1 is IApi3ReaderProxy { |
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.
Current hardhat version uses ignition plugin for deploying contract but I've had some issues with it in the past like trying to get the deployment block for a contract, etc. So on the other repos we usually just rely on hardhat-deploy plugin to handle deployments via deployment scripts. For verifying the contracts we can use hardhat-verify plugin and run it in a deployment script like @api3/contracts does it.
The market we're going with is the wstETH (collateral) / USDC (borrow). The wstETH proxy is going to combine the price of wstETH (natively available on-chain) and ETH/USD. The USDC/USD is a regular proxy.
We'll need to follow https://docs.morpho.org/curation/tutorials/deploying-oracle/ and https://docs.morpho.org/curation/tutorials/creating-market/ and I'm probably not going to bother with scripting this and just deploy through the UI.