-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
428 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { NETWORK_ADDRESSES } from "src/networkAddresses"; | ||
import { makeProposal } from "src/utils"; | ||
|
||
const { ethereum } = NETWORK_ADDRESSES; | ||
|
||
export const ETHEREUM_ACM = "0x230058da2D23eb8836EC5DB7037ef7250c56E25E"; | ||
|
||
const vip053 = () => { | ||
return makeProposal([ | ||
{ | ||
target: ethereum.XVS_VAULT_PROXY, | ||
signature: "_setPendingAdmin(address)", | ||
params: [ethereum.NORMAL_TIMELOCK], | ||
}, | ||
|
||
// Revoke permissions | ||
{ | ||
target: ETHEREUM_ACM, | ||
signature: "revokeCallPermission(address,string,address)", | ||
params: [ethereum.XVS_VAULT_PROXY, "add(address,uint256,address,uint256,uint256)", ethereum.GUARDIAN], | ||
}, | ||
{ | ||
target: ETHEREUM_ACM, | ||
signature: "revokeCallPermission(address,string,address)", | ||
params: [ethereum.XVS_VAULT_PROXY, "set(address,uint256,uint256)", ethereum.GUARDIAN], | ||
}, | ||
{ | ||
target: ETHEREUM_ACM, | ||
signature: "revokeCallPermission(address,string,address)", | ||
params: [ethereum.XVS_VAULT_PROXY, "setRewardAmountPerBlockOrSecond(address,uint256)", ethereum.GUARDIAN], | ||
}, | ||
{ | ||
target: ETHEREUM_ACM, | ||
signature: "revokeCallPermission(address,string,address)", | ||
params: [ethereum.XVS_VAULT_PROXY, "setWithdrawalLockingPeriod(address,uint256,uint256)", ethereum.GUARDIAN], | ||
}, | ||
]); | ||
}; | ||
|
||
export default vip053; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
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 vip053 from "../../../proposals/ethereum/vip-053"; | ||
import XVS_VAULT_ABI from "./abi/XVSVault.json"; | ||
|
||
const { ethereum } = NETWORK_ADDRESSES; | ||
|
||
const NORMAL_TIMELOCK = ethereum.NORMAL_TIMELOCK; | ||
|
||
forking(20482219, async () => { | ||
const provider = ethers.provider; | ||
let xvsVault: Contract; | ||
|
||
describe("Pre-VIP behavior", async () => { | ||
before(async () => { | ||
xvsVault = new ethers.Contract(ethereum.XVS_VAULT_PROXY, XVS_VAULT_ABI, provider); | ||
}); | ||
|
||
it("should have no pending owner", async () => { | ||
expect(await xvsVault.pendingAdmin()).to.equal(ethers.constants.AddressZero); | ||
}); | ||
}); | ||
|
||
describe("Post-VIP behavior", async () => { | ||
before(async () => { | ||
await pretendExecutingVip(await vip053()); | ||
}); | ||
|
||
it("correct pending owner", async () => { | ||
expect(await xvsVault.pendingAdmin()).to.equal(NORMAL_TIMELOCK); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"error","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"info","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"detail","type":"uint256"}],"name":"Failure","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldImplementation","type":"address"},{"indexed":false,"internalType":"address","name":"newImplementation","type":"address"}],"name":"NewImplementation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingImplementation","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingImplementation","type":"address"}],"name":"NewPendingImplementation","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":false,"inputs":[],"name":"_acceptAdmin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"_acceptImplementation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"_setPendingAdmin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newPendingImplementation","type":"address"}],"name":"_setPendingImplementation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingXVSVaultImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { expect } from "chai"; | ||
import { ethers } from "hardhat"; | ||
import { NETWORK_ADDRESSES } from "src/networkAddresses"; | ||
import { expectEvents } from "src/utils"; | ||
import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; | ||
|
||
import vip053 from "../../multisig/proposals/ethereum/vip-053"; | ||
import vip349 from "../../vips/vip-349/bscmainnet"; | ||
import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; | ||
import XVS_VAULT_PROXY_ABI from "./abi/XVSVaultProxy.json"; | ||
|
||
const { ethereum } = NETWORK_ADDRESSES; | ||
|
||
forking(20482219, async () => { | ||
const provider = ethers.provider; | ||
const xvsVaultProxy = new ethers.Contract(ethereum.XVS_VAULT_PROXY, XVS_VAULT_PROXY_ABI, provider); | ||
|
||
before(async () => { | ||
await pretendExecutingVip(await vip053()); | ||
}); | ||
|
||
testForkedNetworkVipCommands("vip349", await vip349(), { | ||
callbackAfterExecution: async txResponse => { | ||
await expectEvents(txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], [6]); | ||
}, | ||
}); | ||
|
||
describe("Post-VIP behaviour", async () => { | ||
it("should have the correct pending owner", async () => { | ||
expect(await xvsVaultProxy.admin()).to.equal(ethereum.NORMAL_TIMELOCK); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
[ | ||
{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }, | ||
{ "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, | ||
{ "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } | ||
], | ||
"name": "PermissionGranted", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }, | ||
{ "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, | ||
{ "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } | ||
], | ||
"name": "PermissionRevoked", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, | ||
{ "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, | ||
{ "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } | ||
], | ||
"name": "RoleAdminChanged", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, | ||
{ "indexed": true, "internalType": "address", "name": "account", "type": "address" }, | ||
{ "indexed": true, "internalType": "address", "name": "sender", "type": "address" } | ||
], | ||
"name": "RoleGranted", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, | ||
{ "indexed": true, "internalType": "address", "name": "account", "type": "address" }, | ||
{ "indexed": true, "internalType": "address", "name": "sender", "type": "address" } | ||
], | ||
"name": "RoleRevoked", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "DEFAULT_ADMIN_ROLE", | ||
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], | ||
"name": "getRoleAdmin", | ||
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "contractAddress", "type": "address" }, | ||
{ "internalType": "string", "name": "functionSig", "type": "string" }, | ||
{ "internalType": "address", "name": "accountToPermit", "type": "address" } | ||
], | ||
"name": "giveCallPermission", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, | ||
{ "internalType": "address", "name": "account", "type": "address" } | ||
], | ||
"name": "grantRole", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "account", "type": "address" }, | ||
{ "internalType": "address", "name": "contractAddress", "type": "address" }, | ||
{ "internalType": "string", "name": "functionSig", "type": "string" } | ||
], | ||
"name": "hasPermission", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, | ||
{ "internalType": "address", "name": "account", "type": "address" } | ||
], | ||
"name": "hasRole", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "account", "type": "address" }, | ||
{ "internalType": "string", "name": "functionSig", "type": "string" } | ||
], | ||
"name": "isAllowedToCall", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, | ||
{ "internalType": "address", "name": "account", "type": "address" } | ||
], | ||
"name": "renounceRole", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "contractAddress", "type": "address" }, | ||
{ "internalType": "string", "name": "functionSig", "type": "string" }, | ||
{ "internalType": "address", "name": "accountToRevoke", "type": "address" } | ||
], | ||
"name": "revokeCallPermission", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, | ||
{ "internalType": "address", "name": "account", "type": "address" } | ||
], | ||
"name": "revokeRole", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], | ||
"name": "supportsInterface", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"error","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"info","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"detail","type":"uint256"}],"name":"Failure","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldImplementation","type":"address"},{"indexed":false,"internalType":"address","name":"newImplementation","type":"address"}],"name":"NewImplementation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingImplementation","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingImplementation","type":"address"}],"name":"NewPendingImplementation","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":false,"inputs":[],"name":"_acceptAdmin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"_acceptImplementation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"_setPendingAdmin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newPendingImplementation","type":"address"}],"name":"_setPendingImplementation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingXVSVaultImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { expect } from "chai"; | ||
import { ethers } from "hardhat"; | ||
import { NETWORK_ADDRESSES } from "src/networkAddresses"; | ||
import { expectEvents } from "src/utils"; | ||
import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; | ||
|
||
import vip010 from "../../multisig/proposals/arbitrumone/vip-010"; | ||
import vip350 from "../../vips/vip-350/bscmainnet"; | ||
import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; | ||
|
||
const { arbitrumone } = NETWORK_ADDRESSES; | ||
|
||
forking(230362555, async () => { | ||
const provider = ethers.provider; | ||
|
||
before(async () => { | ||
await pretendExecutingVip(await vip010()); | ||
}); | ||
|
||
testForkedNetworkVipCommands("vip350", await vip350(), { | ||
callbackAfterExecution: async txResponse => { | ||
await expectEvents(txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], [6]); | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { expect } from "chai"; | ||
import { ethers } from "hardhat"; | ||
import { NETWORK_ADDRESSES } from "src/networkAddresses"; | ||
import { expectEvents } from "src/utils"; | ||
import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; | ||
|
||
import vip053 from "../../multisig/proposals/ethereum/vip-053"; | ||
import vip350 from "../../vips/vip-350/bscmainnet"; | ||
import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; | ||
|
||
const { ethereum } = NETWORK_ADDRESSES; | ||
|
||
forking(20482317, async () => { | ||
const provider = ethers.provider; | ||
|
||
before(async () => { | ||
await pretendExecutingVip(await vip053()); | ||
}); | ||
|
||
testForkedNetworkVipCommands("vip350", await vip350(), { | ||
callbackAfterExecution: async txResponse => { | ||
await expectEvents(txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], [6]); | ||
}, | ||
}); | ||
}); |
Oops, something went wrong.