Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions contracts/contracts/proxies/BaseProxies.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,10 @@ contract OETHBaseHarvesterProxy is InitializeGovernedUpgradeabilityProxy {
contract OETHBaseCurveAMOProxy is InitializeGovernedUpgradeabilityProxy {

}

/**
* @notice OETHbHydrexAMOProxy delegates calls to an OETHbHydrexAMOStrategy implementation
*/
contract OETHbHydrexAMOProxy is InitializeGovernedUpgradeabilityProxy {

}
7 changes: 0 additions & 7 deletions contracts/contracts/proxies/Proxies.sol
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,3 @@ contract OUSDMorphoV2StrategyProxy is InitializeGovernedUpgradeabilityProxy {
contract OETHSupernovaAMOProxy is InitializeGovernedUpgradeabilityProxy {

}

/**
* @notice OETHbHydrexAMOProxy delegates calls to an OETHbHydrexAMOStrategy implementation
*/
contract OETHbHydrexAMOProxy is InitializeGovernedUpgradeabilityProxy {

}
25 changes: 25 additions & 0 deletions contracts/deploy/deployActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const { replaceContractAt } = require("../utils/hardhat");
const { resolveContract } = require("../utils/resolvers");
const { impersonateAccount, getSigner } = require("../utils/signers");
const { getDefenderSigner } = require("../utils/signersNoHardhat");
const { sleep } = require("../utils/time");
const { getTxOpts } = require("../utils/tx");
const createxAbi = require("../abi/createx.json");

Expand Down Expand Up @@ -899,6 +900,24 @@ const deployOETHSupernovaAMOStrategyImplementation = async () => {
return cOETHSupernovaAMOStrategy;
};

// Poll eth_getCode until bytecode appears at `addr`. Base's read replicas can
// lag the sequencer by several seconds, so a fresh deploy receipt does not
// guarantee that the next call's RPC node sees the contract yet.
const waitForBytecode = async (
addr,
{ timeoutMs = 60000, pollMs = 2000 } = {}
) => {
const start = Date.now();
while (Date.now() - start < timeoutMs) {
const code = await ethers.provider.getCode(addr);
if (code && code !== "0x") return;
await sleep(pollMs);
}
throw new Error(
`waitForBytecode: no code at ${addr} after ${timeoutMs}ms; RPC may still be lagging`
);
};

const deployOETHbHydrexAMOStrategyImplementation = async (gaugeAddress) => {
const { deployerAddr } = await getNamedAccounts();
const sDeployer = await ethers.provider.getSigner(deployerAddr);
Expand Down Expand Up @@ -927,6 +946,12 @@ const deployOETHbHydrexAMOStrategyImplementation = async (gaugeAddress) => {
cOETHbHydrexAMOStrategyProxy.address
);

// Wait for the Base RPC read replicas to surface the freshly deployed
// implementation bytecode before the proxy initialize() runs. Without this,
// estimateGas on the proxy can hit a stale node and revert with
// "Cannot set a proxy implementation to a non-contract address".
await waitForBytecode(dHydrexAMOStrategy.address);

// Initialize OETHb Hydrex AMO Strategy via the proxy.
// Reward token is oHYDX (call option on HYDX). The Hydrex gauge emits oHYDX
// from getReward(); off-chain plumbing exercises/sells it.
Expand Down
1 change: 1 addition & 0 deletions contracts/deployments/base/.migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"045_deploy_pool_booster_merkl_factory": 1772622327,
"046_crosschain_upgrade_remote": 1772750064,
"047_merkl_pb_bribes_module": 1773930124,
"048_oethb_hydrex_amo": 1778063838,
"049_permissioned_rebase_module": 1778095983
}
297 changes: 297 additions & 0 deletions contracts/deployments/base/OETHbHydrexAMOProxy.json

Large diffs are not rendered by default.

Loading
Loading