From bd5f8c1aca8039db9c4028a7ea3062e814462462 Mon Sep 17 00:00:00 2001 From: Jesus Lanchas Date: Fri, 20 Dec 2024 15:52:26 +0100 Subject: [PATCH] feat: whitelist the Normal Timelock from the VIP instead of from the TX --- multisig/proposals/basemainnet/vip-007/index.ts | 5 ----- multisig/simulations/basemainnet/vip-007/index.ts | 11 +---------- simulations/vip-502/basemainnet.ts | 15 +++++++++++---- simulations/vip-502/basesepolia.ts | 2 +- vips/vip-502/bscmainnet.ts | 6 ++++++ 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/multisig/proposals/basemainnet/vip-007/index.ts b/multisig/proposals/basemainnet/vip-007/index.ts index 76711cd39..a0f8fd917 100644 --- a/multisig/proposals/basemainnet/vip-007/index.ts +++ b/multisig/proposals/basemainnet/vip-007/index.ts @@ -119,11 +119,6 @@ const vip007 = () => { signature: "transferOwnership(address)", params: [basemainnet.NORMAL_TIMELOCK], }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setWhitelist(address,bool)", - params: [basemainnet.NORMAL_TIMELOCK, true], - }, ]); }; diff --git a/multisig/simulations/basemainnet/vip-007/index.ts b/multisig/simulations/basemainnet/vip-007/index.ts index 558bdac5c..d24357cb4 100644 --- a/multisig/simulations/basemainnet/vip-007/index.ts +++ b/multisig/simulations/basemainnet/vip-007/index.ts @@ -4,10 +4,6 @@ import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip003 from "../../../proposals/basemainnet/vip-003"; -import vip004 from "../../../proposals/basemainnet/vip-004"; -import vip005 from "../../../proposals/basemainnet/vip-005"; -import vip006 from "../../../proposals/basemainnet/vip-006"; import vip007, { BOUND_VALIDATOR, COMPTROLLERS, @@ -47,7 +43,7 @@ const CHAINLINK_ORACLE = basemainnet.CHAINLINK_ORACLE; const REDSTONE_ORACLE = basemainnet.REDSTONE_ORACLE; const NORMAL_TIMELOCK = basemainnet.NORMAL_TIMELOCK; -forking(23864228, async () => { +forking(23957731, async () => { const provider = ethers.provider; let proxyAdmin: Contract; let prime: Contract; @@ -68,11 +64,6 @@ forking(23864228, async () => { describe("Pre-VIP behavior", async () => { before(async () => { - await pretendExecutingVip(await vip003()); - await pretendExecutingVip(await vip004()); - await pretendExecutingVip(await vip005()); - await pretendExecutingVip(await vip006()); - proxyAdmin = new ethers.Contract(DEFAULT_PROXY_ADMIN, DEFAULT_PROXY_ADMIN_ABI, provider); prime = new ethers.Contract(PRIME, PRIME_ABI, provider); plp = new ethers.Contract(PLP, PLP_ABI, provider); diff --git a/simulations/vip-502/basemainnet.ts b/simulations/vip-502/basemainnet.ts index 1035c97a9..708d11808 100644 --- a/simulations/vip-502/basemainnet.ts +++ b/simulations/vip-502/basemainnet.ts @@ -5,13 +5,12 @@ import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; -import { PSR } from "../../multisig/proposals/basemainnet/vip-003"; -import vip007 from "../../multisig/proposals/basemainnet/vip-007"; -import { +import vip007, { BOUND_VALIDATOR, COMPTROLLERS, PLP, PRIME, + PSR, VTOKENS, XVS_BRIDGE_ADMIN_PROXY, XVS_STORE, @@ -28,12 +27,15 @@ import BOUND_VALIDATOR_ABI from "../vip-502/abi/boundValidator.json"; import CHAINLINK_ORACLE_ABI from "../vip-502/abi/chainlinkOracle.json"; import RESILLIENT_ORACLE_ABI from "../vip-502/abi/resilientOracle.json"; import TREASURY_ABI from "../vip-502/abi/treasury.json"; +import XVS_BRIDGE_ABI from "../vip-502/abi/xvsBridge.json"; import XVS_BRIDGE_ADMIN_ABI from "../vip-502/abi/xvsBridgeAdmin.json"; import POOL_REGISTRY_ABI from "./abi/PoolRegistry.json"; +const XVS_BRIDGE = "0x3dD92fB51a5d381Ae78E023dfB5DD1D45D2426Cd"; + const { basemainnet } = NETWORK_ADDRESSES; -forking(23950456, async () => { +forking(23957731, async () => { const provider = ethers.provider; let prime: Contract; let plp: Contract; @@ -44,6 +46,7 @@ forking(23950456, async () => { let resilientOracle: Contract; let boundValidator: Contract; let xvsBridgeAdmin: Contract; + let xvsBridge: Contract; let treasury: Contract; let poolRegistry: Contract; @@ -59,6 +62,7 @@ forking(23950456, async () => { resilientOracle = new ethers.Contract(basemainnet.RESILIENT_ORACLE, RESILLIENT_ORACLE_ABI, provider); boundValidator = new ethers.Contract(BOUND_VALIDATOR, BOUND_VALIDATOR_ABI, provider); xvsBridgeAdmin = await ethers.getContractAt(XVS_BRIDGE_ADMIN_ABI, XVS_BRIDGE_ADMIN_PROXY); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); treasury = await ethers.getContractAt( TREASURY_ABI, basemainnet.VTREASURY, @@ -111,6 +115,9 @@ forking(23950456, async () => { it("XVSBridgeAdmin ownership transferred to Normal Timelock", async () => { expect(await xvsBridgeAdmin.owner()).to.be.equals(basemainnet.NORMAL_TIMELOCK); }); + it("Normal Timelock should be whitelisted", async () => { + expect(await xvsBridge.whitelist(basemainnet.NORMAL_TIMELOCK)).to.be.true; + }); it("oracles should have correct owner", async () => { expect(await resilientOracle.owner()).equals(basemainnet.NORMAL_TIMELOCK); expect(await chainLinkOracle.owner()).equals(basemainnet.NORMAL_TIMELOCK); diff --git a/simulations/vip-502/basesepolia.ts b/simulations/vip-502/basesepolia.ts index b8ccafa3d..f71d92cef 100644 --- a/simulations/vip-502/basesepolia.ts +++ b/simulations/vip-502/basesepolia.ts @@ -4,10 +4,10 @@ import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; -import { PSR } from "../../multisig/proposals/basesepolia/vip-003"; import vip007, { BOUND_VALIDATOR, COMPTROLLERS, + PSR, VTOKENS, XVS_BRIDGE_ADMIN_PROXY, XVS_STORE, diff --git a/vips/vip-502/bscmainnet.ts b/vips/vip-502/bscmainnet.ts index ac9afaa65..26d52f461 100644 --- a/vips/vip-502/bscmainnet.ts +++ b/vips/vip-502/bscmainnet.ts @@ -176,6 +176,12 @@ const vip502 = () => { params: [], dstChainId: LzChainId.basemainnet, }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setWhitelist(address,bool)", + params: [basemainnet.NORMAL_TIMELOCK, true], + dstChainId: LzChainId.basemainnet, + }, ...remoteBridgeEntries.flatMap(getRemoteBridgeCommands), ], meta,