Skip to content
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
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default {
forking: enableMainnetForking
? {
url: `https://eth-mainnet.alchemyapi.io/v2/${mainnetAlchemyApiKey}`,
blockNumber: 13303505
blockNumber: 13303685
}
: undefined
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:all": "RUN_ALL_TESTS=true npx hardhat test",
"lint": "eslint --config ./.eslintrc --ignore-path ./.eslintignore --ext .ts,.tsx .",
"lint-all": "eslint --config ./.eslintrc --ignore-path ./.eslintignore --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "npm run lint --fix",
"lint:fix": "eslint --fix --config ./.eslintrc --ignore-path ./.eslintignore --ext .ts,.tsx .",
"size-contracts": "npx hardhat size-contracts",
"deploy:localhost": "npx hardhat run --network localhost scripts/deploy/migrations.js",
"deploy:main": "npx hardhat run --network mainnet scripts/deploy/migrations.js",
Expand Down
3 changes: 2 additions & 1 deletion proposals/dao/fip_28.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const run: RunUpgradeFunc = async (addresses, oldContracts, contracts, logging =

const teardown: TeardownUpgradeFunc = async (addresses, oldContracts, contracts, logging) => {
const { optimisticTimelock } = addresses;
const { rariPool8Comptroller, rariPool8Dai, rariPool8Tribe, rariPool8Eth, rariPool8Fei, rariPool22FeiPCVDeposit } = contracts;
const { rariPool8Comptroller, rariPool8Dai, rariPool8Tribe, rariPool8Eth, rariPool8Fei, rariPool22FeiPCVDeposit } =
contracts;

await hre.network.provider.request({
method: 'hardhat_impersonateAccount',
Expand Down
22 changes: 12 additions & 10 deletions scripts/utils/checkProposal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getAllContracts, getAllContractAddresses } from '../../test/integration/setup/loadContracts';
import hre from 'hardhat';
import hre, { ethers } from 'hardhat';
import { time } from '@openzeppelin/test-helpers';
import { NamedContracts, UpgradeFuncs } from '../../test/integration/setup/types';

Expand Down Expand Up @@ -32,6 +32,8 @@ async function checkProposal() {
params: [voterAddress]
});

const voterSigner = await ethers.getSigner(voterAddress);

console.log(`Proposal Number: ${proposalNo}`);

let proposal = await governorAlpha.proposals(proposalNo);
Expand All @@ -45,12 +47,12 @@ async function checkProposal() {
console.log('Vote already began');
}

try {
await governorAlpha.castVote(proposalNo, true, { from: voterAddress });
console.log('Casted vote');
} catch {
console.log('Already voted');
}
/*try {*/
await governorAlpha.connect(voterSigner).castVote(proposalNo, true);
console.log('Casted vote.');
/*} catch {
console.log('Already voted, ror some terrible error has occured.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean up these comments? Add a message saying this will revert if proposal queued

}*/

proposal = await governorAlpha.proposals(proposalNo);
const { endBlock } = proposal;
Expand All @@ -75,20 +77,20 @@ async function checkProposal() {
console.log('Success');

// Get the upgrade setup, run and teardown scripts
const proposalFuncs: UpgradeFuncs = await import(`../../proposals/proposals/${proposalName}`);
const proposalFuncs: UpgradeFuncs = await import(`../../proposals/dao/${proposalName}`);

const contractAddresses = getAllContractAddresses();

console.log('Teardown');
await proposalFuncs.teardownUpgrade(
await proposalFuncs.teardown(
contractAddresses,
contracts as unknown as NamedContracts,
contracts as unknown as NamedContracts,
true
);

console.log('Validate');
await proposalFuncs.validateUpgrade(
await proposalFuncs.validate(
contractAddresses,
contracts as unknown as NamedContracts,
contracts as unknown as NamedContracts,
Expand Down
17 changes: 11 additions & 6 deletions scripts/utils/getProposalCalldata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as dotenv from 'dotenv';
import { BigNumber } from 'ethers';
import { Interface } from '@ethersproject/abi';


dotenv.config();

type ExtendedAlphaProposal = {
Expand All @@ -13,7 +12,7 @@ type ExtendedAlphaProposal = {
signatures: string[];
calldatas: string[];
description: string;
}
};

/**
* Take in a hardhat proposal object and output the proposal calldatas
Expand All @@ -26,12 +25,18 @@ async function getProposalCalldata() {
throw new Error('DEPLOY_FILE env variable not set');
}

const proposal = await constructProposal(proposalName) as ExtendedAlphaProposal;
const proposal = (await constructProposal(proposalName)) as ExtendedAlphaProposal;

const governorAlphaArtifact = await hre.artifacts.readArtifactSync('GovernorAlpha')
const governorAlphaInterface = new Interface(governorAlphaArtifact.abi)
const governorAlphaArtifact = await hre.artifacts.readArtifactSync('GovernorAlpha');
const governorAlphaInterface = new Interface(governorAlphaArtifact.abi);

const calldata = governorAlphaInterface.encodeFunctionData('propose', [proposal.targets, proposal.values, proposal.signatures, proposal.calldatas, proposal.description])
const calldata = governorAlphaInterface.encodeFunctionData('propose', [
proposal.targets,
proposal.values,
proposal.signatures,
proposal.calldatas,
proposal.description
]);

console.log(calldata);
}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/proposals_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"fip_28" : {
"deploy" : false,
"exec" : true,
"proposerAddress" : "0xe0ac4559739bD36f0913FB0A3f5bFC19BCBaCD52"
"proposerAddress" : "0xb81cf4981Ef648aaA73F07a18B03970f04d5D8bF"
},
"v2Phase1": {
"deploy" : true,
"exec" : false,
"proposerAddress" : "0xe0ac4559739bD36f0913FB0A3f5bFC19BCBaCD52"
"proposerAddress" : "0xb81cf4981Ef648aaA73F07a18B03970f04d5D8bF"
}
}
10 changes: 5 additions & 5 deletions test/integration/setup/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export type ValidateUpgradeFunc = (
) => Promise<void>;

export type UpgradeFuncs = {
deployUpgrade: DeployUpgradeFunc;
setupUpgrade: SetupUpgradeFunc;
runUpgrade: RunUpgradeFunc;
teardownUpgrade: TeardownUpgradeFunc;
validateUpgrade: ValidateUpgradeFunc;
deploy: DeployUpgradeFunc;
setup: SetupUpgradeFunc;
run: RunUpgradeFunc;
teardown: TeardownUpgradeFunc;
validate: ValidateUpgradeFunc;
};

export type Config = {
Expand Down