Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VEN-2722]: VIP for VTreasury on OpSepolia #315

Merged
merged 5 commits into from
Sep 2, 2024
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
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ ARCHIVE_NODE_arbitrumone=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/arbit
ARCHIVE_NODE_xlayertestnet=https://rpc.ankr.com/xlayer_testnet/<YOUR_KEY_HERE>
ARCHIVE_NODE_xlayermainnet=https://rpc.ankr.com/xlayer<YOUR_KEY_HERE>
ACHIVE_NODE_zksyncsepolia=https://zksync-sepolia.g.alchemy.com/v2/<YOUR_KEY_HERE>
ARCHIVE_NODE_zksyncmainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/zksync
ARCHIVE_NODE_zksyncmainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/zksync
ARCHIVE_NODE_opsepolia=https://sepolia.optimism.io
ARCHIVE_NODE_opmainnet=https://opt-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
14 changes: 14 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const BLOCK_GAS_LIMIT_PER_NETWORK = {
arbitrumsepolia: 30000000,
arbitrumone: 30000000,
xlayertestnet: 30000000,
opsepolia: 30000000,
opmainnet: 30000000,
};

task("propose", "Propose proposal")
Expand Down Expand Up @@ -159,6 +161,18 @@ const config: HardhatUserConfig = {
chainId: 196,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
},
opsepolia: {
url: process.env.ARCHIVE_NODE_opsepolia || "https://sepolia.optimism.io",
chainId: 11155420,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK.opsepolia,
},
opmainnet: {
url: process.env.ARCHIVE_NODE_opmainnet || "https://mainnet.optimism.io",
chainId: 10,
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK.opmainnet,
},
},
paths: {
tests: "./tests",
Expand Down
14 changes: 14 additions & 0 deletions multisig/proposals/opsepolia/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 = "0x5A1a12F47FA7007C9e23cf5e025F3f5d3aC7d755";

const vip000 = () => {
return makeProposal([
{
target: TREASURY,
signature: "acceptOwnership()",
params: [],
},
]);
};
export default vip000;
86 changes: 86 additions & 0 deletions multisig/simulations/opsepolia/vip-000/abi/treasury.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[
{ "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/opsepolia/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/opsepolia/vip-000";
import TREASURY_ABI from "./abi/treasury.json";

const TREASURY = "0x5A1a12F47FA7007C9e23cf5e025F3f5d3aC7d755";

forking(14147950, 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.opsepolia.NORMAL_TIMELOCK);
});
});
});
12 changes: 12 additions & 0 deletions src/multisig/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ export const getContractNetworks = (chainId: number): ContractNetworksConfig =>
simulateTxAccessorAddress: "0x4F8ce5F350E57419F68732f1F15D761044239B8b",
},
},
opsepolia: {
[chainId]: {
safeMasterCopyAddress: "0xe1Ed13Dd60b85a072401a3C4Fc7d2EaA678092F8",
safeProxyFactoryAddress: "0xf509dB5de5e01ce6e29EAaF8301981DE3C4c7cda",
multiSendAddress: "0x0A941df0A84634098abE04f52037c7Fb05C2dEd7",
multiSendCallOnlyAddress: "0x2694246B72e40a72B0F9137A9A0a9e818775B4dc",
fallbackHandlerAddress: "0x4f85CF627f6106FFDB72aBee57f143C61b6aEcA2",
signMessageLibAddress: "0xe5A8983525b0dC8757C47eD001C22ADB003ae372",
createCallAddress: "0xFf17bb26b8B702b698FE3De40C10d430742C9F47",
simulateTxAccessorAddress: "0xe7A7552B0Cff45E837e1422b479d2dEDE748f571",
},
},
// Add more networks as needed
};

Expand Down
4 changes: 4 additions & 0 deletions src/networkAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,8 @@ export const NETWORK_ADDRESSES = {
RESILIENT_ORACLE: "0xDe564a4C887d5ad315a19a96DC81991c98b12182",
CHAINLINK_ORACLE: "0x4FC29E1d3fFFbDfbf822F09d20A5BE97e59F66E5",
},
opsepolia: {
NORMAL_TIMELOCK: "0xd57365EE4E850e881229e2F8Aa405822f289e78d", // opsepolia Multisig
GUARDIAN: "0xd57365EE4E850e881229e2F8Aa405822f289e78d",
},
};
16 changes: 16 additions & 0 deletions src/networkConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,20 @@ export const NETWORK_CONFIG = {
},
XVS_VAULT_POOL_ID: 0,
},
opsepolia: {
DELAY_BLOCKS: {
[ProposalType.REGULAR]: 200,
[ProposalType.FAST_TRACK]: 100,
[ProposalType.CRITICAL]: 34,
},
XVS_VAULT_POOL_ID: 0,
},
opmainnet: {
DELAY_BLOCKS: {
[ProposalType.REGULAR]: 200,
[ProposalType.FAST_TRACK]: 100,
[ProposalType.CRITICAL]: 34,
},
XVS_VAULT_POOL_ID: 0,
},
};
Loading