Skip to content

Commit

Permalink
feat: add vip for vtreasury on opmainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Debugger022 committed Sep 18, 2024
1 parent 8f030a4 commit cc322fa
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 0 deletions.
14 changes: 14 additions & 0 deletions multisig/proposals/opmainnet/vip-000/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { makeProposal } from "../../../../src/utils";

const TREASURY = "0x104c01EB7b4664551BE6A9bdB26a8C5c6Be7d3da";

const vip000 = () => {
return makeProposal([
{
target: TREASURY,
signature: "acceptOwnership()",
params: [],
},
]);
};
export default vip000;
1 change: 1 addition & 0 deletions multisig/simulations/opmainnet/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./vip-000";
191 changes: 191 additions & 0 deletions multisig/simulations/opmainnet/vip-000/abi/treasury.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
[
{
"inputs": [],
"name": "ZeroAddressNotAllowed",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferStarted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "withdrawAmount",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "withdrawAddress",
"type": "address"
}
],
"name": "WithdrawTreasuryNative",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "withdrawAmount",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "withdrawAddress",
"type": "address"
}
],
"name": "WithdrawTreasuryToken",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "acceptOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pendingOwner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "withdrawAmount",
"type": "uint256"
},
{
"internalType": "address payable",
"name": "withdrawAddress",
"type": "address"
}
],
"name": "withdrawTreasuryNative",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "withdrawAmount",
"type": "uint256"
},
{
"internalType": "address",
"name": "withdrawAddress",
"type": "address"
}
],
"name": "withdrawTreasuryToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
26 changes: 26 additions & 0 deletions multisig/simulations/opmainnet/vip-000/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { expect } from "chai";
import { Contract } from "ethers";
import { ethers } from "hardhat";

import { NETWORK_ADDRESSES } from "../../../../src/networkAddresses";
import { forking, pretendExecutingVip } from "../../../../src/vip-framework";
import vip000 from "../../../proposals/opmainnet/vip-000";
import TREASURY_ABI from "./abi/treasury.json";

const TREASURY = "0x104c01EB7b4664551BE6A9bdB26a8C5c6Be7d3da";

forking(125518550, async () => {
let treasury: Contract;

before(async () => {
treasury = await ethers.getContractAt(TREASURY_ABI, TREASURY);
await pretendExecutingVip(await vip000());
});

describe("Post tx checks", () => {
it("Should set owner to multisig", async () => {
const owner = await treasury.owner();
expect(owner).equals(NETWORK_ADDRESSES.opmainnet.GUARDIAN);
});
});
});
5 changes: 5 additions & 0 deletions src/networkAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,9 @@ export const NETWORK_ADDRESSES = {
CHAINLINK_ORACLE: "0x493C3f543AEa37EefF17D823f27Cb1feAB9f3143",
POOL_REGISTRY: "0x6538C861C7A6997602311342657b9143dD9E8152",
},
opmainnet: {
NORMAL_TIMELOCK: "", // To be deployed
VTREASURY: "0x104c01EB7b4664551BE6A9bdB26a8C5c6Be7d3da",
GUARDIAN: "0x2e94dd14E81999CdBF5deDE31938beD7308354b3",
},
};

0 comments on commit cc322fa

Please sign in to comment.