Skip to content

Commit

Permalink
feat: whitelist the Normal Timelock from the VIP instead of from the TX
Browse files Browse the repository at this point in the history
  • Loading branch information
chechu committed Dec 20, 2024
1 parent 8434de4 commit bd5f8c1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
5 changes: 0 additions & 5 deletions multisig/proposals/basemainnet/vip-007/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
},
]);
};

Expand Down
11 changes: 1 addition & 10 deletions multisig/simulations/basemainnet/vip-007/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
15 changes: 11 additions & 4 deletions simulations/vip-502/basemainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand All @@ -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;

Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion simulations/vip-502/basesepolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions vips/vip-502/bscmainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bd5f8c1

Please sign in to comment.