Skip to content

Commit

Permalink
fix: remove goerli leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Oct 10, 2023
1 parent 535f586 commit 5552e3d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
28 changes: 13 additions & 15 deletions src/govv3/governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import {
} from 'viem';
import merge from 'deepmerge';
import { FilterLogWithTimestamp, getLogs } from '../utils/logs';
import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book';
import {
AaveSafetyModule,
AaveV3Ethereum,
GovernanceV3Ethereum,
IGovernanceCore_ABI,
} from '@bgd-labs/aave-address-book';
import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../utils/tenderlyClient';
import { EOA } from '../utils/constants';
import {
Expand All @@ -24,9 +29,6 @@ import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from '.
import { readJSONCache, writeJSONCache } from '../utils/cache';
import { logInfo } from '../utils/logger';

// TODO remove once final
const AaveSafetyModule = { STK_AAVE: '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' } as const;

type CreatedLog = FilterLogWithTimestamp<typeof IGovernanceCore_ABI, 'ProposalCreated'>;
type QueuedLog = FilterLogWithTimestamp<typeof IGovernanceCore_ABI, 'ProposalQueued'>;
type CanceledLog = FilterLogWithTimestamp<typeof IGovernanceCore_ABI, 'ProposalCanceled'>;
Expand Down Expand Up @@ -288,7 +290,6 @@ export const getGovernance = ({
async getVotingProofs(proposalId: bigint, voter: Hex, votingChainId: bigint) {
const proposal = await getProposal(proposalId);

// TODO: replace with real addresses
const [stkAaveProof, aaveProof, aAaveProof, representativeProof] = await Promise.all([
getProof(
publicClient,
Expand All @@ -298,28 +299,25 @@ export const getGovernance = ({
),
getProof(
publicClient,
'0xb6D88BfC5b145a558b279cf7692e6F02064889d0',
[getSolidityStorageSlotAddress(VOTING_SLOTS['0xb6D88BfC5b145a558b279cf7692e6F02064889d0'].balance, voter)],
AaveV3Ethereum.ASSETS.AAVE.UNDERLYING,
[getSolidityStorageSlotAddress(VOTING_SLOTS[AaveV3Ethereum.ASSETS.AAVE.UNDERLYING].balance, voter)],
proposal.snapshotBlockHash
),
getProof(
publicClient,
'0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd',
AaveV3Ethereum.ASSETS.AAVE.A_TOKEN,
[
getSolidityStorageSlotAddress(VOTING_SLOTS['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd'].balance, voter),
getSolidityStorageSlotAddress(VOTING_SLOTS['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd'].delegation, voter),
getSolidityStorageSlotAddress(VOTING_SLOTS[AaveV3Ethereum.ASSETS.AAVE.A_TOKEN].balance, voter),
getSolidityStorageSlotAddress(VOTING_SLOTS[AaveV3Ethereum.ASSETS.AAVE.A_TOKEN].delegation, voter),
],
proposal.snapshotBlockHash
),
getProof(
publicClient,
'0x586207Df62c7D5D1c9dBb8F61EdF77cc30925C4F',
GovernanceV3Ethereum.GOVERNANCE,
[
getSolidityStorageSlotBytes(
getSolidityStorageSlotAddress(
VOTING_SLOTS['0x586207Df62c7D5D1c9dBb8F61EdF77cc30925C4F'].representative,
voter
),
getSolidityStorageSlotAddress(VOTING_SLOTS[GovernanceV3Ethereum.GOVERNANCE].representative, voter),
toHex(votingChainId, { size: 32 })
),
],
Expand Down
11 changes: 4 additions & 7 deletions src/govv3/proofs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book';
import { AaveSafetyModule, AaveV3Ethereum, GovernanceV3Ethereum } from '@bgd-labs/aave-address-book';
import { Block, Hex, PublicClient, fromRlp, toHex, toRlp } from 'viem';

// TODO remove once final
const AaveSafetyModule = { STK_AAVE: '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' } as const;

/**
* Slots that represent configuration values relevant for all accounts
*/
Expand All @@ -18,12 +15,12 @@ export const WAREHOUSE_SLOTS = {
*/
export const VOTING_SLOTS = {
[AaveSafetyModule.STK_AAVE]: { balance: 0n }, // balance
['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd' /*AaveV3Ethereum.ASSETS.AAVE.A_TOKEN*/]: {
[AaveV3Ethereum.ASSETS.AAVE.A_TOKEN]: {
balance: 52n, // balance
delegation: 64n,
}, // delegation
['0xb6D88BfC5b145a558b279cf7692e6F02064889d0' /*AaveV3Ethereum.ASSETS.AAVE.UNDERLYING*/]: { balance: 0n }, // balance
[GovernanceV3Goerli.GOVERNANCE]: { representative: 9n }, // representative
[AaveV3Ethereum.ASSETS.AAVE.UNDERLYING]: { balance: 0n }, // balance
[GovernanceV3Ethereum.GOVERNANCE]: { representative: 9n }, // representative
} as const;

export interface Proof {
Expand Down

0 comments on commit 5552e3d

Please sign in to comment.