-
Notifications
You must be signed in to change notification settings - Fork 4
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-1830]: Poc/sepolia VIP multisig tx execution #64
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
04d1618
add example POC VIP
0xlucian 60ccb44
feat: add safe-global dependencies
0xlucian ff4ee5a
chore: add sepolia network config
0xlucian e91bd29
chore: add a POC VIP and also a script to execute the VIP on Sepolia …
0xlucian 6c183d3
chore: add readme instructions on how to use the execute VIP script o…
0xlucian 0ec9416
chore: fix linting
0xlucian be08cc2
fix: remove unused imports and fix linting
0xlucian 5fd956d
refactor: move multisig txs in another folder and change their naming…
0xlucian 4020554
chore: add multisig transactions for ACM,Ownership and Asset Configur…
0xlucian 8b7ffa1
fix: readme typos
0xlucian 9058285
test: add vtoken configuration proposal
GitGuru7 d099005
chore: update configs
GitGuru7 76006c5
chore: update root directory
GitGuru7 11c254e
feat: support for multisig proposals
GitGuru7 87eb579
chore: update script to make it network agnostic
GitGuru7 a1cdcbc
test: add simulations for vtoken setup on sepolia by multisig
GitGuru7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"./scripts", | ||
"./src", | ||
"./vips", | ||
"./simulations" | ||
"./simulations", | ||
"./multisig" | ||
] | ||
} |
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
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,29 @@ | ||
import { ethers } from "ethers"; | ||
|
||
export interface deployedContracts { | ||
[key: string]: string; | ||
} | ||
export interface NetworkAddress { | ||
[key: string]: deployedContracts; | ||
} | ||
export const ZERO_ADDRESS = ethers.constants.AddressZero; | ||
export const ADDRESSES: NetworkAddress = { | ||
sepoliaContracts: { | ||
CHAINLINK_ORACLE: "0x0a16c96EB3E767147DB477196aA8E9774945CDf7", | ||
RESILIENT_ORACLE: "0x9005091f2E0b20bEf6AaF2bD7F21dfd45DA8Af07", | ||
BOUND_VALIDATOR: "0x8305fF2eEAE00bc0C19746851c1c8643Ebd68193", | ||
ACM: "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96", | ||
TIMELOCK: "0x94fa6078b6b8a26F0B6EDFFBE6501B22A10470fB", // Sepolia Multisig | ||
MOCK_USDC: "0x772d68929655ce7234C8C94256526ddA66Ef641E", | ||
MOCK_USDT: "0x8d412FD0bc5d826615065B931171Eed10F5AF266", | ||
MOCK_WETH: "0x700868CAbb60e90d77B6588ce072d9859ec8E281", | ||
MOCK_WBTC: "0x92A2928f5634BEa89A195e7BeCF0f0FEEDAB885b", | ||
POOL_REGISTRY: "0x22067CF4a23955Ab7b834D4a9336ca624D93485e", | ||
COMPTROLLER: "0x4e4048b5eb13DD377872A418268b788f672653aa", | ||
VWBTC: "0x13c15cA5A074E7E1450492D474087b99c7253001", | ||
VWETH: "0x195D27b4cAfcb543C9104583FA37743ad5E4cEe5", | ||
VUSDT: "0x2c3Cc8EED38b4d323ce97DB11f98737F3F7421A1", | ||
VUSDC: "0x6f1089e90C6a14397C20348eE704d596819DFEd4", | ||
VTREASURY: "0xD51008eAe81475b542638433a617f5f4171b39ee", | ||
}, | ||
}; |
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,19 @@ | ||
export const loadMultisigTx = async (txName: string, networkName: string) => { | ||
const x = await import(`../proposals/${networkName}/${txName}.ts`); | ||
return x[txName](); | ||
}; | ||
|
||
export const getSafeAddress = (networkName: string): string => { | ||
// Define Safe addresses for different networks here | ||
const safeAddresses: Record<string, string> = { | ||
// Sepolia network | ||
sepolia: "0x94fa6078b6b8a26f0b6edffbe6501b22a10470fb", | ||
// Add more networks and their corresponding Safe addresses as needed | ||
}; | ||
|
||
if (networkName in safeAddresses) { | ||
return safeAddresses[networkName]; | ||
} else { | ||
throw new Error(`Safe address for network ${networkName} is not defined.`); | ||
} | ||
}; |
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,20 @@ | ||
import { makeProposal } from "../../../src/utils"; | ||
|
||
const STORAGE_UINT_CONTRACT = "0x049f77F7046266d27C3bC96376f53C17Ef09c986"; | ||
const STORAGE_MAPPING_COTNRACT = "0x435D55709070ee1f0789685F9859038e9D5C39d7"; | ||
const VENUS_DEPLOYER_ADDRESS = "0xFEA1c651A47FE29dB9b1bf3cC1f224d8D9CFF68C"; | ||
|
||
export const example = () => { | ||
return makeProposal([ | ||
{ | ||
target: STORAGE_UINT_CONTRACT, | ||
signature: "store(uint256)", | ||
params: [10], | ||
}, | ||
{ | ||
target: STORAGE_MAPPING_COTNRACT, | ||
signature: "store(address,uint256)", | ||
params: [VENUS_DEPLOYER_ADDRESS, 11], | ||
}, | ||
]); | ||
}; |
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,61 @@ | ||
import { makeProposal } from "../../../src/utils"; | ||
import { ADDRESSES, ZERO_ADDRESS } from "../../helpers/config"; | ||
|
||
const { sepoliaContracts } = ADDRESSES; | ||
export const oracleAclOwnership = () => { | ||
return makeProposal([ | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "pause()", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "unpause()", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "setOracle(address,address,uint8)", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "enableOracle(address,uint8,bool)", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "setTokenConfig(TokenConfig)", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "setDirectPrice(address,uint256)", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "setValidateConfig(ValidateConfig)", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "setMaxStalePeriod(string,uint256)", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "setSymbolOverride(string,string)", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ | ||
target: sepoliaContracts.ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [ZERO_ADDRESS, "setUnderlyingPythOracle(address)", sepoliaContracts.TIMELOCK], | ||
}, | ||
{ target: sepoliaContracts.RESILIENT_ORACLE, signature: "acceptOwnership()", params: [] }, | ||
{ target: sepoliaContracts.CHAINLINK_ORACLE, signature: "acceptOwnership()", params: [] }, | ||
{ target: sepoliaContracts.BOUND_VALIDATOR, signature: "acceptOwnership()", params: [] }, | ||
]); | ||
}; |
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,76 @@ | ||
import { makeProposal } from "../../../src/utils"; | ||
import { ADDRESSES, ZERO_ADDRESS } from "../../helpers/config"; | ||
|
||
const { sepoliaContracts } = ADDRESSES; | ||
const WBTC_CHAINLINK_FEED = "0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43"; | ||
const WETH_CHAINLINK_FEED = "0x694AA1769357215DE4FAC081bf1f309aDC325306"; | ||
const USDC_CHAINLINK_FEED = "0xA2F78ab2355fe2f984D808B5CeE7FD0A93D5270E"; | ||
|
||
export const oracleAssetConfig = () => { | ||
return makeProposal([ | ||
{ | ||
target: sepoliaContracts.CHAINLINK_ORACLE, | ||
signature: "setTokenConfig((address,address,uint256))", | ||
params: [[sepoliaContracts.MOCK_WBTC, WBTC_CHAINLINK_FEED, 86400]], | ||
}, | ||
{ | ||
target: sepoliaContracts.RESILIENT_ORACLE, | ||
signature: "setTokenConfig((address,address[3],bool[3]))", | ||
params: [ | ||
[ | ||
sepoliaContracts.MOCK_WBTC, | ||
[sepoliaContracts.CHAINLINK_ORACLE, ZERO_ADDRESS, ZERO_ADDRESS], | ||
[true, false, false], | ||
], | ||
], | ||
}, | ||
{ | ||
target: sepoliaContracts.CHAINLINK_ORACLE, | ||
signature: "setTokenConfig((address,address,uint256))", | ||
params: [[sepoliaContracts.MOCK_WETH, WETH_CHAINLINK_FEED, 86400]], | ||
}, | ||
{ | ||
target: sepoliaContracts.RESILIENT_ORACLE, | ||
signature: "setTokenConfig((address,address[3],bool[3]))", | ||
params: [ | ||
[ | ||
sepoliaContracts.MOCK_WETH, | ||
[sepoliaContracts.CHAINLINK_ORACLE, ZERO_ADDRESS, ZERO_ADDRESS], | ||
[true, false, false], | ||
], | ||
], | ||
}, | ||
{ | ||
target: sepoliaContracts.CHAINLINK_ORACLE, | ||
signature: "setTokenConfig((address,address,uint256))", | ||
params: [[sepoliaContracts.MOCK_USDC, USDC_CHAINLINK_FEED, 86400]], | ||
}, | ||
{ | ||
target: sepoliaContracts.RESILIENT_ORACLE, | ||
signature: "setTokenConfig((address,address[3],bool[3]))", | ||
params: [ | ||
[ | ||
sepoliaContracts.MOCK_USDC, | ||
[sepoliaContracts.CHAINLINK_ORACLE, ZERO_ADDRESS, ZERO_ADDRESS], | ||
[true, false, false], | ||
], | ||
], | ||
}, | ||
{ | ||
target: sepoliaContracts.CHAINLINK_ORACLE, | ||
signature: "setDirectPrice(address,uint256)", | ||
params: [sepoliaContracts.MOCK_USDT, "1000000000000000000"], | ||
}, | ||
{ | ||
target: sepoliaContracts.RESILIENT_ORACLE, | ||
signature: "setTokenConfig((address,address[3],bool[3]))", | ||
params: [ | ||
[ | ||
sepoliaContracts.MOCK_USDT, | ||
[sepoliaContracts.CHAINLINK_ORACLE, ZERO_ADDRESS, ZERO_ADDRESS], | ||
[true, false, false], | ||
], | ||
], | ||
}, | ||
]); | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the key be only the network name without
Contracts
suffix?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree we can import it into other files using an alias name to prevent confusion.