-
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.
fix: renamed diamond comptroller vip files and folders
- Loading branch information
1 parent
2c2f244
commit 2c719fb
Showing
13 changed files
with
28 additions
and
25 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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 |
---|---|---|
@@ -1,29 +1,32 @@ | ||
import { ethers } from "hardhat"; | ||
|
||
import { getCalldatas } from "./utils"; | ||
import GOVERNOR_BRAVO_DELEGATE_ABI from "./vip-framework/abi/governorBravoDelegateAbi.json"; | ||
|
||
const DEFAULT_GOVERNOR_PROXY = "0x2d56dC077072B53571b8252008C60e945108c75a"; | ||
const DEFAULT_GOVERNOR_PROXY = "0x5573422A1a59385C247ec3a66B93B7C08eC2f8f2"; | ||
|
||
export const loadProposal = async (num: string) => { | ||
const x = await import(`../vips/vip-${num}.ts`); | ||
return x[`vip${num}`](); | ||
const x = await import("../vips/vip-174/vip-174-testnet"); | ||
console.log("----------------------------XXX", x); | ||
return x["vip174Testnet"](); | ||
}; | ||
|
||
export const proposeVIP = async (vipNumber: string, governorProxyAddress?: string) => { | ||
export const proposeVIP = async (vipNumber: string) => { | ||
const proposal = await loadProposal(vipNumber); | ||
console.log("----------------------------proposal", proposal); | ||
|
||
const { targets, signatures, values, meta } = proposal; | ||
const [proposer] = await ethers.getSigners(); | ||
const governorProxy = await ethers.getContractAt(GOVERNOR_BRAVO_DELEGATE_ABI, DEFAULT_GOVERNOR_PROXY); | ||
|
||
const params = [targets, values, signatures, getCalldatas(proposal), JSON.stringify(meta), proposal.type]; | ||
let functionSignature = "function propose(address[],uint256[],string[],bytes[],string,uint8)"; | ||
const { targets, signatures, values, meta } = proposal; | ||
|
||
if (proposal.type === undefined || proposal.type === null) { | ||
functionSignature = "function propose(address[],uint256[],string[],bytes[],string)"; | ||
params.pop(); | ||
} | ||
await governorProxy | ||
.connect(proposer) | ||
.propose(targets, values, signatures, getCalldatas(proposal), JSON.stringify(meta), proposal.type); | ||
|
||
return { | ||
target: governorProxyAddress ?? DEFAULT_GOVERNOR_PROXY, | ||
calldata: new ethers.utils.Interface([functionSignature]).encodeFunctionData("propose", params), | ||
}; | ||
// await governorProxy | ||
// .connect(proposer) | ||
// .castVote(296, 1); | ||
}; | ||
|
||
proposeVIP(130); |
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