Skip to content

Commit

Permalink
redeploy voter contract
Browse files Browse the repository at this point in the history
  • Loading branch information
ququzone committed Jan 22, 2024
1 parent ce7f8ee commit 4f7fe47
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 251 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Forwarder deployed to 0x8C1FC775027bBef80e7B07e127a87b85D4c8731e
VotingEscrow deployed to 0x96dC256Ea343ae8b13999C73562e5D6B457a8501
Trig deployed to 0x3E9E887939344F66434fa0f67c20f80D3C48d661
PerlinNoise deployed to 0x245243f5282D79dec70b5E0e0a8Cba253E27c333
VeArtProxy deployed to 0xD289e0B728FDBC3F6BFda39a1FAda409fe3b6d71
VeArtProxy deployed to 0x070Bc340B586362128406E3ee69A27DAdAC826d7
MarshallGovernor deployed to 0xC54A5a8673809b593e12478A1B51AC5372c596a0
EmptyPoolFactory deployed to 0xBEBa61CD08787A01d3e2518975EFe602b0422dCC
VotingRewardsFactory deployed to 0xA1B7853a6a1cbB69DD52f033dAc9625bb241f325
GaugeFactory deployed to 0x454e0Ef916fA03839D0f40de8FaC7f64641C01A6
FactoryRegistry deployed to 0x7d8cC390e8d6B5a06a1357A5EF3059fd23E97e0f
Voter deployed to 0xC14F28FB65A101bc89A134Ff976037E05d43Dd9E
RewardsDistributor deployed to 0x46b359Cb147dB48c53637cCC07502118aEd0af90
Vault deployed to 0xd4970c3210C784555cac08b0f3555DfC8a13987d
Voter deployed to 0xEC591F12267eABb42679594B416051d4634144fA
RewardsDistributor deployed to 0x511D5663aA4fae94269cc59d676d713ab3d2aC5c
Vault deployed to 0x8f2b0FB4463230F3D0f46E62bf3bccBCe85064C3
```
2 changes: 1 addition & 1 deletion script/01_deploy_ve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ async function main() {
const perlinNoiseFactory = await ethers.getContractFactory('PerlinNoise');
const perlinNoise = await perlinNoiseFactory.deploy();
await perlinNoise.waitForDeployment();

console.log(`PerlinNoise deployed to ${perlinNoise.target}`);

const veArtProxy = await ethers.deployContract('VeArtProxy', [escrow.target], {
libraries: {
Trig: trig.target,
Expand Down
17 changes: 10 additions & 7 deletions script/04_deploy_vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ async function main() {
console.log(`Please provide FACTORY_REGISTRY address`);
return;
}
if (!process.env.GOVERNOR) {
console.log(`Please provide GOVERNOR address`);
return;
}
// if (!process.env.GOVERNOR) {
// console.log(`Please provide GOVERNOR address`);
// return;
// }

const voter = await ethers.deployContract('Voter', [
process.env.FORWARDER,
Expand All @@ -26,8 +26,8 @@ async function main() {
await voter.waitForDeployment();
console.log(`Voter deployed to ${voter.target}`);

let tx = await voter.setGovernor(process.env.GOVERNOR);
await tx.wait();
// let tx = await voter.setGovernor(process.env.GOVERNOR);
// await tx.wait();

const rewardsDistributor = await ethers.deployContract('RewardsDistributor', [
process.env.VE
Expand All @@ -43,7 +43,10 @@ async function main() {
await vault.waitForDeployment();
console.log(`Vault deployed to ${vault.target}`);

tx = await voter.initialize([], vault.target);
// tx = await vault.setGovernor(process.env.GOVERNOR);
// await tx.wait();

let tx = await voter.initialize([], vault.target);
await tx.wait();

tx = await rewardsDistributor.setVault(vault.target);
Expand Down
133 changes: 57 additions & 76 deletions src/types/contracts/Vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ export interface VaultInterface extends Interface {
getFunction(
nameOrSignature:
| "WEEK"
| "acceptTeam"
| "activePeriod"
| "changeVeRate"
| "changeWeekly"
| "donate"
| "donate(address,uint256)"
| "donate()"
| "epochCount"
| "pendingTeam"
| "governor"
| "rewardsDistributor"
| "setTeam"
| "team"
| "setGovernor"
| "updatePeriod"
| "ve"
| "veRate"
Expand All @@ -47,7 +46,6 @@ export interface VaultInterface extends Interface {

getEvent(
nameOrSignatureOrTopic:
| "AcceptTeam"
| "Donation"
| "Emission"
| "VeRateChanged"
Expand All @@ -56,10 +54,6 @@ export interface VaultInterface extends Interface {
): EventFragment;

encodeFunctionData(functionFragment: "WEEK", values?: undefined): string;
encodeFunctionData(
functionFragment: "acceptTeam",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "activePeriod",
values?: undefined
Expand All @@ -72,24 +66,24 @@ export interface VaultInterface extends Interface {
functionFragment: "changeWeekly",
values: [BigNumberish]
): string;
encodeFunctionData(functionFragment: "donate", values?: undefined): string;
encodeFunctionData(
functionFragment: "epochCount",
values?: undefined
functionFragment: "donate(address,uint256)",
values: [AddressLike, BigNumberish]
): string;
encodeFunctionData(functionFragment: "donate()", values?: undefined): string;
encodeFunctionData(
functionFragment: "pendingTeam",
functionFragment: "epochCount",
values?: undefined
): string;
encodeFunctionData(functionFragment: "governor", values?: undefined): string;
encodeFunctionData(
functionFragment: "rewardsDistributor",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "setTeam",
functionFragment: "setGovernor",
values: [AddressLike]
): string;
encodeFunctionData(functionFragment: "team", values?: undefined): string;
encodeFunctionData(
functionFragment: "updatePeriod",
values?: undefined
Expand All @@ -100,11 +94,10 @@ export interface VaultInterface extends Interface {
encodeFunctionData(functionFragment: "weekly", values?: undefined): string;
encodeFunctionData(
functionFragment: "withdraw",
values: [AddressLike, BigNumberish]
values: [AddressLike, AddressLike, BigNumberish]
): string;

decodeFunctionResult(functionFragment: "WEEK", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "acceptTeam", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "activePeriod",
data: BytesLike
Expand All @@ -117,18 +110,21 @@ export interface VaultInterface extends Interface {
functionFragment: "changeWeekly",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "donate", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "epochCount", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "pendingTeam",
functionFragment: "donate(address,uint256)",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "donate()", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "epochCount", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "governor", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "rewardsDistributor",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setTeam", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "team", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setGovernor",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "updatePeriod",
data: BytesLike
Expand All @@ -140,23 +136,16 @@ export interface VaultInterface extends Interface {
decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
}

export namespace AcceptTeamEvent {
export type InputTuple = [_newTeam: AddressLike];
export type OutputTuple = [_newTeam: string];
export interface OutputObject {
_newTeam: string;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
export type Filter = TypedDeferredTopicFilter<Event>;
export type Log = TypedEventLog<Event>;
export type LogDescription = TypedLogDescription<Event>;
}

export namespace DonationEvent {
export type InputTuple = [donor: AddressLike, amount: BigNumberish];
export type OutputTuple = [donor: string, amount: bigint];
export type InputTuple = [
donor: AddressLike,
token: AddressLike,
amount: BigNumberish
];
export type OutputTuple = [donor: string, token: string, amount: bigint];
export interface OutputObject {
donor: string;
token: string;
amount: bigint;
}
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
Expand Down Expand Up @@ -205,16 +194,19 @@ export namespace WeeklyChangedEvent {
export namespace WithdrawEvent {
export type InputTuple = [
operator: AddressLike,
token: AddressLike,
recipcient: AddressLike,
amount: BigNumberish
];
export type OutputTuple = [
operator: string,
token: string,
recipcient: string,
amount: bigint
];
export interface OutputObject {
operator: string;
token: string;
recipcient: string;
amount: bigint;
}
Expand Down Expand Up @@ -269,8 +261,6 @@ export interface Vault extends BaseContract {

WEEK: TypedContractMethod<[], [bigint], "view">;

acceptTeam: TypedContractMethod<[], [void], "nonpayable">;

activePeriod: TypedContractMethod<[], [bigint], "view">;

changeVeRate: TypedContractMethod<
Expand All @@ -285,17 +275,25 @@ export interface Vault extends BaseContract {
"nonpayable"
>;

donate: TypedContractMethod<[], [void], "payable">;
"donate(address,uint256)": TypedContractMethod<
[_token: AddressLike, _amount: BigNumberish],
[void],
"nonpayable"
>;

"donate()": TypedContractMethod<[], [void], "payable">;

epochCount: TypedContractMethod<[], [bigint], "view">;

pendingTeam: TypedContractMethod<[], [string], "view">;
governor: TypedContractMethod<[], [string], "view">;

rewardsDistributor: TypedContractMethod<[], [string], "view">;

setTeam: TypedContractMethod<[_team: AddressLike], [void], "nonpayable">;

team: TypedContractMethod<[], [string], "view">;
setGovernor: TypedContractMethod<
[_governor: AddressLike],
[void],
"nonpayable"
>;

updatePeriod: TypedContractMethod<[], [bigint], "nonpayable">;

Expand All @@ -308,7 +306,7 @@ export interface Vault extends BaseContract {
weekly: TypedContractMethod<[], [bigint], "view">;

withdraw: TypedContractMethod<
[_recipcient: AddressLike, _amount: BigNumberish],
[_token: AddressLike, _recipcient: AddressLike, _amount: BigNumberish],
[void],
"nonpayable"
>;
Expand All @@ -320,9 +318,6 @@ export interface Vault extends BaseContract {
getFunction(
nameOrSignature: "WEEK"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "acceptTeam"
): TypedContractMethod<[], [void], "nonpayable">;
getFunction(
nameOrSignature: "activePeriod"
): TypedContractMethod<[], [bigint], "view">;
Expand All @@ -333,23 +328,27 @@ export interface Vault extends BaseContract {
nameOrSignature: "changeWeekly"
): TypedContractMethod<[_weekly: BigNumberish], [void], "nonpayable">;
getFunction(
nameOrSignature: "donate"
nameOrSignature: "donate(address,uint256)"
): TypedContractMethod<
[_token: AddressLike, _amount: BigNumberish],
[void],
"nonpayable"
>;
getFunction(
nameOrSignature: "donate()"
): TypedContractMethod<[], [void], "payable">;
getFunction(
nameOrSignature: "epochCount"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "pendingTeam"
nameOrSignature: "governor"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "rewardsDistributor"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "setTeam"
): TypedContractMethod<[_team: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "team"
): TypedContractMethod<[], [string], "view">;
nameOrSignature: "setGovernor"
): TypedContractMethod<[_governor: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "updatePeriod"
): TypedContractMethod<[], [bigint], "nonpayable">;
Expand All @@ -366,18 +365,11 @@ export interface Vault extends BaseContract {
getFunction(
nameOrSignature: "withdraw"
): TypedContractMethod<
[_recipcient: AddressLike, _amount: BigNumberish],
[_token: AddressLike, _recipcient: AddressLike, _amount: BigNumberish],
[void],
"nonpayable"
>;

getEvent(
key: "AcceptTeam"
): TypedContractEvent<
AcceptTeamEvent.InputTuple,
AcceptTeamEvent.OutputTuple,
AcceptTeamEvent.OutputObject
>;
getEvent(
key: "Donation"
): TypedContractEvent<
Expand Down Expand Up @@ -415,18 +407,7 @@ export interface Vault extends BaseContract {
>;

filters: {
"AcceptTeam(address)": TypedContractEvent<
AcceptTeamEvent.InputTuple,
AcceptTeamEvent.OutputTuple,
AcceptTeamEvent.OutputObject
>;
AcceptTeam: TypedContractEvent<
AcceptTeamEvent.InputTuple,
AcceptTeamEvent.OutputTuple,
AcceptTeamEvent.OutputObject
>;

"Donation(address,uint256)": TypedContractEvent<
"Donation(address,address,uint256)": TypedContractEvent<
DonationEvent.InputTuple,
DonationEvent.OutputTuple,
DonationEvent.OutputObject
Expand Down Expand Up @@ -470,7 +451,7 @@ export interface Vault extends BaseContract {
WeeklyChangedEvent.OutputObject
>;

"Withdraw(address,address,uint256)": TypedContractEvent<
"Withdraw(address,address,address,uint256)": TypedContractEvent<
WithdrawEvent.InputTuple,
WithdrawEvent.OutputTuple,
WithdrawEvent.OutputObject
Expand Down
Loading

0 comments on commit 4f7fe47

Please sign in to comment.