Skip to content

Commit

Permalink
[aave-governance-power] Add aave gov power strategy schema (snapshot-…
Browse files Browse the repository at this point in the history
…labs#1277)

* Update aave-governance-power strategy Readme

* Add schema
  • Loading branch information
ChaituVR authored Sep 4, 2023
1 parent 8155071 commit 48fe81a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 25 deletions.
10 changes: 5 additions & 5 deletions src/strategies/aave-governance-power/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"strategy": {
"name": "aave-governance-power",
"params": {
"governanceStrategy": "0xb7e383ef9b1e9189fc0f71fb30af8aa14377429e",
"symbol": "AAVE+stkAAVE",
"decimals": 18,
"powerType": "vote",
"symbol": "Voting Power",
"decimals": 18
"governanceStrategy": "0xb7e383ef9b1e9189fc0f71fb30af8aa14377429e"
}
},
"network": "1",
"addresses": ["0x5BC928BF0DAb1e4A2ddd9e347b0F22e88026D76c"],
"snapshot": 12657715
"addresses": ["0x329c54289Ff5D6B7b7daE13592C6B1EDA1543eD4", "0x57ab7ee15cE5ECacB1aB84EE42D5A9d0d8112922", "0x0ab97008cad303a8C90ea630c282760284c19e93"],
"snapshot": 18054498
}
]
22 changes: 2 additions & 20 deletions src/strategies/aave-governance-power/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,8 @@ export const version = '0.1.0';
*/

const abi = [
{
inputs: [
{ internalType: 'address', name: 'user', type: 'address' },
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' }
],
name: 'getPropositionPowerAt',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{ internalType: 'address', name: 'user', type: 'address' },
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' }
],
name: 'getVotingPowerAt',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function'
}
'function getPropositionPowerAt(address user, uint256 blockNumber) view returns (uint256)',
'function getVotingPowerAt(address user, uint256 blockNumber) view returns (uint256)'
];

const powerTypesToMethod = {
Expand Down
40 changes: 40 additions & 0 deletions src/strategies/aave-governance-power/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/Strategy",
"definitions": {
"Strategy": {
"title": "Strategy",
"type": "object",
"properties": {
"symbol": {
"type": "string",
"title": "Symbol",
"examples": ["e.g. DOODLE"],
"maxLength": 16
},
"governanceStrategy": {
"type": "string",
"title": "Contract address",
"examples": ["e.g. 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"],
"pattern": "^0x[a-fA-F0-9]{40}$",
"minLength": 42,
"maxLength": 42
},
"powerType": {
"type": "string",
"title": "Power type",
"enum": ["vote", "proposition"]
},
"decimals": {
"type": "integer",
"title": "Decimals",
"examples": ["e.g. 18"],
"minimum": 0,
"maximum": 18
}
},
"required": ["governanceStrategy", "powerType", "decimals"],
"additionalProperties": false
}
}
}

0 comments on commit 48fe81a

Please sign in to comment.