Skip to content

Commit

Permalink
proposal validator tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
julianmrodri committed Jan 29, 2025
1 parent b360357 commit e94afab
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
11 changes: 11 additions & 0 deletions tasks/validation/proposal-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ interface Params {
proposalid?: string
}

// NOTE ON NON-CHAINLINK ORACLES: When dealing with non-chainlink Oracles it is required to redeploy
// that collateral using another equivalent Chainlink Oracle providing an equivalent answer.
// At the beginning of the process you need to swap the collateral in the AssetRegistry with this
// newly deployed collateral to be able to push the oracle forwards during the process.
// e.g:
// const newApxETHColl = await hre.ethers.getContractAt('ApxEthCollateral', NEWLY_DEPLOYED_ADDRESS)
// const assetRegistry = await hre.ethers.getContractAt('AssetRegistryP1', ASSET_REG_ADDRESS)
// await whileImpersonating(hre, TIMELOCK_ADDRESS, async (timelockSigner) => {
// await assetRegistry.connect(timelockSigner).swapRegistered(newApxETHColl.address)
// })

task('proposal-validator', 'Runs a proposal and confirms can fully rebalance + redeem + mint')
.addParam('proposalid', 'the ID of the governance proposal', undefined)
.setAction(async (params: Params, hre) => {
Expand Down
17 changes: 17 additions & 0 deletions tasks/validation/utils/oracles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,23 @@ export const pushOracleForward = async (
}
}

// Convex ETH+/ETH (Nested RToken)
if (asset == '0x05F164E71C46a8f8FB2ba71550a00eeC9FCd85cd') {
const feed = await hre.ethers.getContractAt(
'AggregatorV3Interface',
networkConfig['1'].chainlinkFeeds.ETH!
)
await updateAnswer(feed)
const ethplusAssetRegistry = await hre.ethers.getContractAt(
'IAssetRegistry',
'0xf526f058858E4cD060cFDD775077999562b31bE0'
)
const [, ethplusAssets] = await ethplusAssetRegistry.getRegistry()
for (const ethplusAsset of ethplusAssets) {
addresses = await pushOracleForward(hre, ethplusAsset, addresses) // recursion!
}
}

return addresses
}

Expand Down
2 changes: 1 addition & 1 deletion tasks/validation/whales/whales_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@
"0x4c9edd5852cd905f086c759e8383e09bff1e68b3": "2024-09-23T20:24:17.758Z",
"0x9d39a5de30e57443bff2a8307a4256c8797a3497": "2024-09-23T20:24:17.896Z"
}
}
}
10 changes: 8 additions & 2 deletions tasks/validation/whales/whales_31337.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@
"0xacdf0dba4b9839b96221a8487e9ca660a48212be": "0x7cc1bfAB73bE4E02BB53814d1059A98cF7e49644",
"0xfc0b1eef20e4c68b3dcf36c4537cfa7ce46ca70b": "0xF2B25362a03f6EACCa8De8d5350A9f37944c1e59",
"0x0d86883faf4ffd7aeb116390af37746f45b6f378": "0x7cc1bfAB73bE4E02BB53814d1059A98cF7e49644",
"0x78da5799cf427fee11e9996982f4150ece7a99a7": "0x3154Cf16ccdb4C6d922629664174b904d80F2C35"
"0x78da5799cf427fee11e9996982f4150ece7a99a7": "0x3154Cf16ccdb4C6d922629664174b904d80F2C35",
"0x78fc2c2ed1a4cdb5402365934ae5648adad094d0": "0xa6B1C84133479e41d8d085005476DD007A50Be66",
"0xe8a5677171c87fcb65b76957f2852515b404c7b1": "0x298bf7b80a6343214634aF16EB41Bb5B9fC6A1F1",
"0x005f893ecd7bf9667195642f7649da8163e23658": "0x5BDd1fA233843Bfc034891BE8a6769e58F1e1346"
},
"lastUpdated": {
"0xfbd1a538f5707c0d67a16ca4e3fc711b80bd931a": "2024-05-01T16:12:37.530Z",
Expand Down Expand Up @@ -135,6 +138,9 @@
"0xacdf0dba4b9839b96221a8487e9ca660a48212be": "2024-05-01T16:12:40.447Z",
"0xfc0b1eef20e4c68b3dcf36c4537cfa7ce46ca70b": "2024-05-01T16:12:40.528Z",
"0x0d86883faf4ffd7aeb116390af37746f45b6f378": "2024-05-01T16:12:40.659Z",
"0x78da5799cf427fee11e9996982f4150ece7a99a7": "2024-05-01T16:12:40.776Z"
"0x78da5799cf427fee11e9996982f4150ece7a99a7": "2024-05-01T16:12:40.776Z",
"0x78fc2c2ed1a4cdb5402365934ae5648adad094d0": "2024-05-01T16:12:40.776Z",
"0xe8a5677171c87fcb65b76957f2852515b404c7b1": "2024-05-01T16:12:40.776Z",
"0x005f893ecd7bf9667195642f7649da8163e23658": "2024-05-01T16:12:40.776Z"
}
}

0 comments on commit e94afab

Please sign in to comment.