@bgd-labs/aave-address-book 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitmodules +4 -0
- package/CHANGELOG.md +56 -0
- package/LICENSE +7 -0
- package/README.md +94 -0
- package/addressbook_logo.png +0 -0
- package/dist/AaveAddressBook.d.ts +17 -0
- package/dist/AaveAddressBook.js +20 -0
- package/dist/AaveV2Avalanche.d.ts +9 -0
- package/dist/AaveV2Avalanche.js +12 -0
- package/dist/AaveV2Ethereum.d.ts +9 -0
- package/dist/AaveV2Ethereum.js +12 -0
- package/dist/AaveV2EthereumAMM.d.ts +9 -0
- package/dist/AaveV2EthereumAMM.js +12 -0
- package/dist/AaveV2EthereumArc.d.ts +9 -0
- package/dist/AaveV2EthereumArc.js +12 -0
- package/dist/AaveV2Fuji.d.ts +9 -0
- package/dist/AaveV2Fuji.js +12 -0
- package/dist/AaveV2Mumbai.d.ts +9 -0
- package/dist/AaveV2Mumbai.js +12 -0
- package/dist/AaveV2Polygon.d.ts +9 -0
- package/dist/AaveV2Polygon.js +12 -0
- package/dist/AaveV3Arbitrum.d.ts +9 -0
- package/dist/AaveV3Arbitrum.js +12 -0
- package/dist/AaveV3Avalanche.d.ts +9 -0
- package/dist/AaveV3Avalanche.js +12 -0
- package/dist/AaveV3Fantom.d.ts +9 -0
- package/dist/AaveV3Fantom.js +12 -0
- package/dist/AaveV3FantomTestnet.d.ts +9 -0
- package/dist/AaveV3FantomTestnet.js +12 -0
- package/dist/AaveV3Fuji.d.ts +9 -0
- package/dist/AaveV3Fuji.js +12 -0
- package/dist/AaveV3Harmony.d.ts +9 -0
- package/dist/AaveV3Harmony.js +12 -0
- package/dist/AaveV3Mumbai.d.ts +9 -0
- package/dist/AaveV3Mumbai.js +12 -0
- package/dist/AaveV3Optimism.d.ts +9 -0
- package/dist/AaveV3Optimism.js +12 -0
- package/dist/AaveV3OptimismKovan.d.ts +9 -0
- package/dist/AaveV3OptimismKovan.js +12 -0
- package/dist/AaveV3Polygon.d.ts +9 -0
- package/dist/AaveV3Polygon.js +12 -0
- package/foundry.toml +8 -0
- package/lib/forge-std/.github/workflows/tests.yml +27 -0
- package/lib/forge-std/.gitmodules +3 -0
- package/lib/forge-std/LICENSE-APACHE +203 -0
- package/lib/forge-std/LICENSE-MIT +25 -0
- package/lib/forge-std/README.md +246 -0
- package/lib/forge-std/lib/ds-test/LICENSE +674 -0
- package/lib/forge-std/lib/ds-test/Makefile +14 -0
- package/lib/forge-std/lib/ds-test/default.nix +4 -0
- package/lib/forge-std/lib/ds-test/demo/demo.sol +222 -0
- package/lib/forge-std/lib/ds-test/src/test.sol +469 -0
- package/lib/forge-std/src/Script.sol +39 -0
- package/lib/forge-std/src/StdJson.sol +118 -0
- package/lib/forge-std/src/Test.sol +1134 -0
- package/lib/forge-std/src/Vm.sol +231 -0
- package/lib/forge-std/src/console.sol +1533 -0
- package/lib/forge-std/src/console2.sol +1538 -0
- package/lib/forge-std/src/test/Script.t.sol +12 -0
- package/lib/forge-std/src/test/StdAssertions.t.sol +591 -0
- package/lib/forge-std/src/test/StdCheats.t.sol +282 -0
- package/lib/forge-std/src/test/StdError.t.sol +124 -0
- package/lib/forge-std/src/test/StdMath.t.sol +200 -0
- package/lib/forge-std/src/test/StdStorage.t.sol +321 -0
- package/lib/forge-std/src/test/fixtures/broadcast.log.json +187 -0
- package/package.json +39 -0
- package/src/AaveAddressBook.sol +28 -0
- package/src/AaveAddressBookV2.sol +143 -0
- package/src/AaveAddressBookV2Testnet.sol +74 -0
- package/src/AaveAddressBookV3.sol +166 -0
- package/src/AaveAddressBookV3Testnet.sol +120 -0
- package/src/AaveGovernanceV2.sol +549 -0
- package/src/AaveV2.sol +931 -0
- package/src/AaveV2Avalanche.sol +35 -0
- package/src/AaveV2Ethereum.sol +36 -0
- package/src/AaveV2EthereumAMM.sol +36 -0
- package/src/AaveV2EthereumArc.sol +36 -0
- package/src/AaveV2Fuji.sol +35 -0
- package/src/AaveV2Mumbai.sol +35 -0
- package/src/AaveV2Polygon.sol +35 -0
- package/src/AaveV3.sol +2406 -0
- package/src/AaveV3Arbitrum.sol +34 -0
- package/src/AaveV3Avalanche.sol +34 -0
- package/src/AaveV3Fantom.sol +34 -0
- package/src/AaveV3FantomTestnet.sol +34 -0
- package/src/AaveV3Fuji.sol +34 -0
- package/src/AaveV3Harmony.sol +34 -0
- package/src/AaveV3HarmonyTestnet.sol +34 -0
- package/src/AaveV3Mumbai.sol +34 -0
- package/src/AaveV3Optimism.sol +34 -0
- package/src/AaveV3OptimismKovan.sol +34 -0
- package/src/AaveV3Polygon.sol +34 -0
- package/src/Common.sol +9 -0
- package/src/test/AaveV2Ethereum.t.sol +72 -0
- package/src/test/AaveV2Misfits.t.sol +33 -0
- package/src/test/AaveV3Avalanche.t.sol +65 -0
- package/src/ts/AaveAddressBook.ts +17 -0
- package/src/ts/AaveV2Avalanche.ts +11 -0
- package/src/ts/AaveV2Ethereum.ts +12 -0
- package/src/ts/AaveV2EthereumAMM.ts +12 -0
- package/src/ts/AaveV2EthereumArc.ts +12 -0
- package/src/ts/AaveV2Fuji.ts +11 -0
- package/src/ts/AaveV2Mumbai.ts +11 -0
- package/src/ts/AaveV2Polygon.ts +11 -0
- package/src/ts/AaveV3Arbitrum.ts +12 -0
- package/src/ts/AaveV3Avalanche.ts +12 -0
- package/src/ts/AaveV3Fantom.ts +12 -0
- package/src/ts/AaveV3FantomTestnet.ts +12 -0
- package/src/ts/AaveV3Fuji.ts +12 -0
- package/src/ts/AaveV3Harmony.ts +12 -0
- package/src/ts/AaveV3Mumbai.ts +12 -0
- package/src/ts/AaveV3Optimism.ts +12 -0
- package/src/ts/AaveV3OptimismKovan.ts +12 -0
- package/src/ts/AaveV3Polygon.ts +12 -0
- package/tsconfig.json +101 -0
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity >=0.6.0;
|
|
3
|
+
|
|
4
|
+
interface IGovernanceStrategy {
|
|
5
|
+
/**
|
|
6
|
+
* @dev Returns the Proposition Power of a user at a specific block number.
|
|
7
|
+
* @param user Address of the user.
|
|
8
|
+
* @param blockNumber Blocknumber at which to fetch Proposition Power
|
|
9
|
+
* @return Power number
|
|
10
|
+
**/
|
|
11
|
+
function getPropositionPowerAt(address user, uint256 blockNumber)
|
|
12
|
+
external
|
|
13
|
+
view
|
|
14
|
+
returns (uint256);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @dev Returns the total supply of Outstanding Proposition Tokens
|
|
18
|
+
* @param blockNumber Blocknumber at which to evaluate
|
|
19
|
+
* @return total supply at blockNumber
|
|
20
|
+
**/
|
|
21
|
+
function getTotalPropositionSupplyAt(uint256 blockNumber)
|
|
22
|
+
external
|
|
23
|
+
view
|
|
24
|
+
returns (uint256);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @dev Returns the total supply of Outstanding Voting Tokens
|
|
28
|
+
* @param blockNumber Blocknumber at which to evaluate
|
|
29
|
+
* @return total supply at blockNumber
|
|
30
|
+
**/
|
|
31
|
+
function getTotalVotingSupplyAt(uint256 blockNumber)
|
|
32
|
+
external
|
|
33
|
+
view
|
|
34
|
+
returns (uint256);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @dev Returns the Vote Power of a user at a specific block number.
|
|
38
|
+
* @param user Address of the user.
|
|
39
|
+
* @param blockNumber Blocknumber at which to fetch Vote Power
|
|
40
|
+
* @return Vote number
|
|
41
|
+
**/
|
|
42
|
+
function getVotingPowerAt(address user, uint256 blockNumber)
|
|
43
|
+
external
|
|
44
|
+
view
|
|
45
|
+
returns (uint256);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface IExecutorWithTimelock {
|
|
49
|
+
/**
|
|
50
|
+
* @dev emitted when a new pending admin is set
|
|
51
|
+
* @param newPendingAdmin address of the new pending admin
|
|
52
|
+
**/
|
|
53
|
+
event NewPendingAdmin(address newPendingAdmin);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @dev emitted when a new admin is set
|
|
57
|
+
* @param newAdmin address of the new admin
|
|
58
|
+
**/
|
|
59
|
+
event NewAdmin(address newAdmin);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @dev emitted when a new delay (between queueing and execution) is set
|
|
63
|
+
* @param delay new delay
|
|
64
|
+
**/
|
|
65
|
+
event NewDelay(uint256 delay);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @dev emitted when a new (trans)action is Queued.
|
|
69
|
+
* @param actionHash hash of the action
|
|
70
|
+
* @param target address of the targeted contract
|
|
71
|
+
* @param value wei value of the transaction
|
|
72
|
+
* @param signature function signature of the transaction
|
|
73
|
+
* @param data function arguments of the transaction or callData if signature empty
|
|
74
|
+
* @param executionTime time at which to execute the transaction
|
|
75
|
+
* @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target
|
|
76
|
+
**/
|
|
77
|
+
event QueuedAction(
|
|
78
|
+
bytes32 actionHash,
|
|
79
|
+
address indexed target,
|
|
80
|
+
uint256 value,
|
|
81
|
+
string signature,
|
|
82
|
+
bytes data,
|
|
83
|
+
uint256 executionTime,
|
|
84
|
+
bool withDelegatecall
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @dev emitted when an action is Cancelled
|
|
89
|
+
* @param actionHash hash of the action
|
|
90
|
+
* @param target address of the targeted contract
|
|
91
|
+
* @param value wei value of the transaction
|
|
92
|
+
* @param signature function signature of the transaction
|
|
93
|
+
* @param data function arguments of the transaction or callData if signature empty
|
|
94
|
+
* @param executionTime time at which to execute the transaction
|
|
95
|
+
* @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target
|
|
96
|
+
**/
|
|
97
|
+
event CancelledAction(
|
|
98
|
+
bytes32 actionHash,
|
|
99
|
+
address indexed target,
|
|
100
|
+
uint256 value,
|
|
101
|
+
string signature,
|
|
102
|
+
bytes data,
|
|
103
|
+
uint256 executionTime,
|
|
104
|
+
bool withDelegatecall
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @dev emitted when an action is Cancelled
|
|
109
|
+
* @param actionHash hash of the action
|
|
110
|
+
* @param target address of the targeted contract
|
|
111
|
+
* @param value wei value of the transaction
|
|
112
|
+
* @param signature function signature of the transaction
|
|
113
|
+
* @param data function arguments of the transaction or callData if signature empty
|
|
114
|
+
* @param executionTime time at which to execute the transaction
|
|
115
|
+
* @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target
|
|
116
|
+
* @param resultData the actual callData used on the target
|
|
117
|
+
**/
|
|
118
|
+
event ExecutedAction(
|
|
119
|
+
bytes32 actionHash,
|
|
120
|
+
address indexed target,
|
|
121
|
+
uint256 value,
|
|
122
|
+
string signature,
|
|
123
|
+
bytes data,
|
|
124
|
+
uint256 executionTime,
|
|
125
|
+
bool withDelegatecall,
|
|
126
|
+
bytes resultData
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @dev Getter of the current admin address (should be governance)
|
|
131
|
+
* @return The address of the current admin
|
|
132
|
+
**/
|
|
133
|
+
function getAdmin() external view returns (address);
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @dev Getter of the current pending admin address
|
|
137
|
+
* @return The address of the pending admin
|
|
138
|
+
**/
|
|
139
|
+
function getPendingAdmin() external view returns (address);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @dev Getter of the delay between queuing and execution
|
|
143
|
+
* @return The delay in seconds
|
|
144
|
+
**/
|
|
145
|
+
function getDelay() external view returns (uint256);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @dev Returns whether an action (via actionHash) is queued
|
|
149
|
+
* @param actionHash hash of the action to be checked
|
|
150
|
+
* keccak256(abi.encode(target, value, signature, data, executionTime, withDelegatecall))
|
|
151
|
+
* @return true if underlying action of actionHash is queued
|
|
152
|
+
**/
|
|
153
|
+
function isActionQueued(bytes32 actionHash) external view returns (bool);
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @dev Checks whether a proposal is over its grace period
|
|
157
|
+
* @param governance Governance contract
|
|
158
|
+
* @param proposalId Id of the proposal against which to test
|
|
159
|
+
* @return true of proposal is over grace period
|
|
160
|
+
**/
|
|
161
|
+
function isProposalOverGracePeriod(
|
|
162
|
+
IAaveGovernanceV2 governance,
|
|
163
|
+
uint256 proposalId
|
|
164
|
+
) external view returns (bool);
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @dev Getter of grace period constant
|
|
168
|
+
* @return grace period in seconds
|
|
169
|
+
**/
|
|
170
|
+
function GRACE_PERIOD() external view returns (uint256);
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @dev Getter of minimum delay constant
|
|
174
|
+
* @return minimum delay in seconds
|
|
175
|
+
**/
|
|
176
|
+
function MINIMUM_DELAY() external view returns (uint256);
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @dev Getter of maximum delay constant
|
|
180
|
+
* @return maximum delay in seconds
|
|
181
|
+
**/
|
|
182
|
+
function MAXIMUM_DELAY() external view returns (uint256);
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @dev Function, called by Governance, that queue a transaction, returns action hash
|
|
186
|
+
* @param target smart contract target
|
|
187
|
+
* @param value wei value of the transaction
|
|
188
|
+
* @param signature function signature of the transaction
|
|
189
|
+
* @param data function arguments of the transaction or callData if signature empty
|
|
190
|
+
* @param executionTime time at which to execute the transaction
|
|
191
|
+
* @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target
|
|
192
|
+
**/
|
|
193
|
+
function queueTransaction(
|
|
194
|
+
address target,
|
|
195
|
+
uint256 value,
|
|
196
|
+
string memory signature,
|
|
197
|
+
bytes memory data,
|
|
198
|
+
uint256 executionTime,
|
|
199
|
+
bool withDelegatecall
|
|
200
|
+
) external returns (bytes32);
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* @dev Function, called by Governance, that cancels a transaction, returns the callData executed
|
|
204
|
+
* @param target smart contract target
|
|
205
|
+
* @param value wei value of the transaction
|
|
206
|
+
* @param signature function signature of the transaction
|
|
207
|
+
* @param data function arguments of the transaction or callData if signature empty
|
|
208
|
+
* @param executionTime time at which to execute the transaction
|
|
209
|
+
* @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target
|
|
210
|
+
**/
|
|
211
|
+
function executeTransaction(
|
|
212
|
+
address target,
|
|
213
|
+
uint256 value,
|
|
214
|
+
string memory signature,
|
|
215
|
+
bytes memory data,
|
|
216
|
+
uint256 executionTime,
|
|
217
|
+
bool withDelegatecall
|
|
218
|
+
) external payable returns (bytes memory);
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @dev Function, called by Governance, that cancels a transaction, returns action hash
|
|
222
|
+
* @param target smart contract target
|
|
223
|
+
* @param value wei value of the transaction
|
|
224
|
+
* @param signature function signature of the transaction
|
|
225
|
+
* @param data function arguments of the transaction or callData if signature empty
|
|
226
|
+
* @param executionTime time at which to execute the transaction
|
|
227
|
+
* @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target
|
|
228
|
+
**/
|
|
229
|
+
function cancelTransaction(
|
|
230
|
+
address target,
|
|
231
|
+
uint256 value,
|
|
232
|
+
string memory signature,
|
|
233
|
+
bytes memory data,
|
|
234
|
+
uint256 executionTime,
|
|
235
|
+
bool withDelegatecall
|
|
236
|
+
) external returns (bytes32);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
interface IAaveGovernanceV2 {
|
|
240
|
+
enum ProposalState {
|
|
241
|
+
Pending,
|
|
242
|
+
Canceled,
|
|
243
|
+
Active,
|
|
244
|
+
Failed,
|
|
245
|
+
Succeeded,
|
|
246
|
+
Queued,
|
|
247
|
+
Expired,
|
|
248
|
+
Executed
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
struct Vote {
|
|
252
|
+
bool support;
|
|
253
|
+
uint248 votingPower;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
struct Proposal {
|
|
257
|
+
uint256 id;
|
|
258
|
+
address creator;
|
|
259
|
+
IExecutorWithTimelock executor;
|
|
260
|
+
address[] targets;
|
|
261
|
+
uint256[] values;
|
|
262
|
+
string[] signatures;
|
|
263
|
+
bytes[] calldatas;
|
|
264
|
+
bool[] withDelegatecalls;
|
|
265
|
+
uint256 startBlock;
|
|
266
|
+
uint256 endBlock;
|
|
267
|
+
uint256 executionTime;
|
|
268
|
+
uint256 forVotes;
|
|
269
|
+
uint256 againstVotes;
|
|
270
|
+
bool executed;
|
|
271
|
+
bool canceled;
|
|
272
|
+
address strategy;
|
|
273
|
+
bytes32 ipfsHash;
|
|
274
|
+
mapping(address => Vote) votes;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
struct ProposalWithoutVotes {
|
|
278
|
+
uint256 id;
|
|
279
|
+
address creator;
|
|
280
|
+
IExecutorWithTimelock executor;
|
|
281
|
+
address[] targets;
|
|
282
|
+
uint256[] values;
|
|
283
|
+
string[] signatures;
|
|
284
|
+
bytes[] calldatas;
|
|
285
|
+
bool[] withDelegatecalls;
|
|
286
|
+
uint256 startBlock;
|
|
287
|
+
uint256 endBlock;
|
|
288
|
+
uint256 executionTime;
|
|
289
|
+
uint256 forVotes;
|
|
290
|
+
uint256 againstVotes;
|
|
291
|
+
bool executed;
|
|
292
|
+
bool canceled;
|
|
293
|
+
address strategy;
|
|
294
|
+
bytes32 ipfsHash;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* @dev emitted when a new proposal is created
|
|
299
|
+
* @param id Id of the proposal
|
|
300
|
+
* @param creator address of the creator
|
|
301
|
+
* @param executor The ExecutorWithTimelock contract that will execute the proposal
|
|
302
|
+
* @param targets list of contracts called by proposal's associated transactions
|
|
303
|
+
* @param values list of value in wei for each propoposal's associated transaction
|
|
304
|
+
* @param signatures list of function signatures (can be empty) to be used when created the callData
|
|
305
|
+
* @param calldatas list of calldatas: if associated signature empty, calldata ready, else calldata is arguments
|
|
306
|
+
* @param withDelegatecalls boolean, true = transaction delegatecalls the taget, else calls the target
|
|
307
|
+
* @param startBlock block number when vote starts
|
|
308
|
+
* @param endBlock block number when vote ends
|
|
309
|
+
* @param strategy address of the governanceStrategy contract
|
|
310
|
+
* @param ipfsHash IPFS hash of the proposal
|
|
311
|
+
**/
|
|
312
|
+
event ProposalCreated(
|
|
313
|
+
uint256 id,
|
|
314
|
+
address indexed creator,
|
|
315
|
+
IExecutorWithTimelock indexed executor,
|
|
316
|
+
address[] targets,
|
|
317
|
+
uint256[] values,
|
|
318
|
+
string[] signatures,
|
|
319
|
+
bytes[] calldatas,
|
|
320
|
+
bool[] withDelegatecalls,
|
|
321
|
+
uint256 startBlock,
|
|
322
|
+
uint256 endBlock,
|
|
323
|
+
address strategy,
|
|
324
|
+
bytes32 ipfsHash
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* @dev emitted when a proposal is canceled
|
|
329
|
+
* @param id Id of the proposal
|
|
330
|
+
**/
|
|
331
|
+
event ProposalCanceled(uint256 id);
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* @dev emitted when a proposal is queued
|
|
335
|
+
* @param id Id of the proposal
|
|
336
|
+
* @param executionTime time when proposal underlying transactions can be executed
|
|
337
|
+
* @param initiatorQueueing address of the initiator of the queuing transaction
|
|
338
|
+
**/
|
|
339
|
+
event ProposalQueued(
|
|
340
|
+
uint256 id,
|
|
341
|
+
uint256 executionTime,
|
|
342
|
+
address indexed initiatorQueueing
|
|
343
|
+
);
|
|
344
|
+
/**
|
|
345
|
+
* @dev emitted when a proposal is executed
|
|
346
|
+
* @param id Id of the proposal
|
|
347
|
+
* @param initiatorExecution address of the initiator of the execution transaction
|
|
348
|
+
**/
|
|
349
|
+
event ProposalExecuted(uint256 id, address indexed initiatorExecution);
|
|
350
|
+
/**
|
|
351
|
+
* @dev emitted when a vote is registered
|
|
352
|
+
* @param id Id of the proposal
|
|
353
|
+
* @param voter address of the voter
|
|
354
|
+
* @param support boolean, true = vote for, false = vote against
|
|
355
|
+
* @param votingPower Power of the voter/vote
|
|
356
|
+
**/
|
|
357
|
+
event VoteEmitted(
|
|
358
|
+
uint256 id,
|
|
359
|
+
address indexed voter,
|
|
360
|
+
bool support,
|
|
361
|
+
uint256 votingPower
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
event GovernanceStrategyChanged(
|
|
365
|
+
address indexed newStrategy,
|
|
366
|
+
address indexed initiatorChange
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
event VotingDelayChanged(
|
|
370
|
+
uint256 newVotingDelay,
|
|
371
|
+
address indexed initiatorChange
|
|
372
|
+
);
|
|
373
|
+
|
|
374
|
+
event ExecutorAuthorized(address executor);
|
|
375
|
+
|
|
376
|
+
event ExecutorUnauthorized(address executor);
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* @dev Creates a Proposal (needs Proposition Power of creator > Threshold)
|
|
380
|
+
* @param executor The ExecutorWithTimelock contract that will execute the proposal
|
|
381
|
+
* @param targets list of contracts called by proposal's associated transactions
|
|
382
|
+
* @param values list of value in wei for each propoposal's associated transaction
|
|
383
|
+
* @param signatures list of function signatures (can be empty) to be used when created the callData
|
|
384
|
+
* @param calldatas list of calldatas: if associated signature empty, calldata ready, else calldata is arguments
|
|
385
|
+
* @param withDelegatecalls if true, transaction delegatecalls the taget, else calls the target
|
|
386
|
+
* @param ipfsHash IPFS hash of the proposal
|
|
387
|
+
**/
|
|
388
|
+
function create(
|
|
389
|
+
IExecutorWithTimelock executor,
|
|
390
|
+
address[] memory targets,
|
|
391
|
+
uint256[] memory values,
|
|
392
|
+
string[] memory signatures,
|
|
393
|
+
bytes[] memory calldatas,
|
|
394
|
+
bool[] memory withDelegatecalls,
|
|
395
|
+
bytes32 ipfsHash
|
|
396
|
+
) external returns (uint256);
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* @dev Cancels a Proposal,
|
|
400
|
+
* either at anytime by guardian
|
|
401
|
+
* or when proposal is Pending/Active and threshold no longer reached
|
|
402
|
+
* @param proposalId id of the proposal
|
|
403
|
+
**/
|
|
404
|
+
function cancel(uint256 proposalId) external;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* @dev Queue the proposal (If Proposal Succeeded)
|
|
408
|
+
* @param proposalId id of the proposal to queue
|
|
409
|
+
**/
|
|
410
|
+
function queue(uint256 proposalId) external;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* @dev Execute the proposal (If Proposal Queued)
|
|
414
|
+
* @param proposalId id of the proposal to execute
|
|
415
|
+
**/
|
|
416
|
+
function execute(uint256 proposalId) external payable;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* @dev Function allowing msg.sender to vote for/against a proposal
|
|
420
|
+
* @param proposalId id of the proposal
|
|
421
|
+
* @param support boolean, true = vote for, false = vote against
|
|
422
|
+
**/
|
|
423
|
+
function submitVote(uint256 proposalId, bool support) external;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* @dev Function to register the vote of user that has voted offchain via signature
|
|
427
|
+
* @param proposalId id of the proposal
|
|
428
|
+
* @param support boolean, true = vote for, false = vote against
|
|
429
|
+
* @param v v part of the voter signature
|
|
430
|
+
* @param r r part of the voter signature
|
|
431
|
+
* @param s s part of the voter signature
|
|
432
|
+
**/
|
|
433
|
+
function submitVoteBySignature(
|
|
434
|
+
uint256 proposalId,
|
|
435
|
+
bool support,
|
|
436
|
+
uint8 v,
|
|
437
|
+
bytes32 r,
|
|
438
|
+
bytes32 s
|
|
439
|
+
) external;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* @dev Set new GovernanceStrategy
|
|
443
|
+
* Note: owner should be a timelocked executor, so needs to make a proposal
|
|
444
|
+
* @param governanceStrategy new Address of the GovernanceStrategy contract
|
|
445
|
+
**/
|
|
446
|
+
function setGovernanceStrategy(address governanceStrategy) external;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* @dev Set new Voting Delay (delay before a newly created proposal can be voted on)
|
|
450
|
+
* Note: owner should be a timelocked executor, so needs to make a proposal
|
|
451
|
+
* @param votingDelay new voting delay in seconds
|
|
452
|
+
**/
|
|
453
|
+
function setVotingDelay(uint256 votingDelay) external;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* @dev Add new addresses to the list of authorized executors
|
|
457
|
+
* @param executors list of new addresses to be authorized executors
|
|
458
|
+
**/
|
|
459
|
+
function authorizeExecutors(address[] memory executors) external;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* @dev Remove addresses to the list of authorized executors
|
|
463
|
+
* @param executors list of addresses to be removed as authorized executors
|
|
464
|
+
**/
|
|
465
|
+
function unauthorizeExecutors(address[] memory executors) external;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* @dev Let the guardian abdicate from its priviledged rights
|
|
469
|
+
**/
|
|
470
|
+
function __abdicate() external;
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* @dev Getter of the current GovernanceStrategy address
|
|
474
|
+
* @return The address of the current GovernanceStrategy contracts
|
|
475
|
+
**/
|
|
476
|
+
function getGovernanceStrategy() external view returns (address);
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* @dev Getter of the current Voting Delay (delay before a created proposal can be voted on)
|
|
480
|
+
* Different from the voting duration
|
|
481
|
+
* @return The voting delay in seconds
|
|
482
|
+
**/
|
|
483
|
+
function getVotingDelay() external view returns (uint256);
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @dev Returns whether an address is an authorized executor
|
|
487
|
+
* @param executor address to evaluate as authorized executor
|
|
488
|
+
* @return true if authorized
|
|
489
|
+
**/
|
|
490
|
+
function isExecutorAuthorized(address executor) external view returns (bool);
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* @dev Getter the address of the guardian, that can mainly cancel proposals
|
|
494
|
+
* @return The address of the guardian
|
|
495
|
+
**/
|
|
496
|
+
function getGuardian() external view returns (address);
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* @dev Getter of the proposal count (the current number of proposals ever created)
|
|
500
|
+
* @return the proposal count
|
|
501
|
+
**/
|
|
502
|
+
function getProposalsCount() external view returns (uint256);
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* @dev Getter of a proposal by id
|
|
506
|
+
* @param proposalId id of the proposal to get
|
|
507
|
+
* @return the proposal as ProposalWithoutVotes memory object
|
|
508
|
+
**/
|
|
509
|
+
function getProposalById(uint256 proposalId)
|
|
510
|
+
external
|
|
511
|
+
view
|
|
512
|
+
returns (ProposalWithoutVotes memory);
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* @dev Getter of the Vote of a voter about a proposal
|
|
516
|
+
* Note: Vote is a struct: ({bool support, uint248 votingPower})
|
|
517
|
+
* @param proposalId id of the proposal
|
|
518
|
+
* @param voter address of the voter
|
|
519
|
+
* @return The associated Vote memory object
|
|
520
|
+
**/
|
|
521
|
+
function getVoteOnProposal(uint256 proposalId, address voter)
|
|
522
|
+
external
|
|
523
|
+
view
|
|
524
|
+
returns (Vote memory);
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* @dev Get the current state of a proposal
|
|
528
|
+
* @param proposalId id of the proposal
|
|
529
|
+
* @return The current state if the proposal
|
|
530
|
+
**/
|
|
531
|
+
function getProposalState(uint256 proposalId)
|
|
532
|
+
external
|
|
533
|
+
view
|
|
534
|
+
returns (ProposalState);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
library AaveGovernanceV2 {
|
|
538
|
+
IAaveGovernanceV2 internal constant GOV =
|
|
539
|
+
IAaveGovernanceV2(0xEC568fffba86c094cf06b22134B23074DFE2252c);
|
|
540
|
+
|
|
541
|
+
address public constant SHORT_EXECUTOR =
|
|
542
|
+
0xEE56e2B3D491590B5b31738cC34d5232F378a8D5;
|
|
543
|
+
|
|
544
|
+
address public constant LONG_EXECUTOR =
|
|
545
|
+
0x61910EcD7e8e942136CE7Fe7943f956cea1CC2f7;
|
|
546
|
+
|
|
547
|
+
address public constant ARC_TIMELOCK =
|
|
548
|
+
0xAce1d11d836cb3F51Ef658FD4D353fFb3c301218;
|
|
549
|
+
}
|