Skip to content

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

Open
wants to merge 5 commits into
base: initial-commit
Choose a base branch
from
Open

Conversation

Siegrift
Copy link
Contributor

@Siegrift Siegrift commented May 20, 2025

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.

@Siegrift Siegrift requested a review from acenolaza May 20, 2025 08:32
/// 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 {
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'll need to deploy and verify this contract on etherscan. What is the best way to do that?

Copy link
Collaborator

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.

Copy link
Contributor Author

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
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: MIT
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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 🤷🏻

@@ -0,0 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
Copy link
Collaborator

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.

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 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 {
Copy link
Collaborator

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.

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