Skip to content

Commit

Permalink
feat: aave v3 token
Browse files Browse the repository at this point in the history
  • Loading branch information
grothem committed Dec 19, 2023
1 parent d0266e1 commit e8b6223
Show file tree
Hide file tree
Showing 5 changed files with 1,917 additions and 1 deletion.
27 changes: 27 additions & 0 deletions packages/contract-helpers/src/governance-v3/aave-token-v3/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { providers } from 'ethers';
import { AaveTokenV3 } from '../typechain/AaveTokenV3';
import { AaveTokenV3__factory } from '../typechain/factories/AaveTokenV3__factory';

export enum GovernancePowerType {
VOTING,
PROPOSITION,
}

export class AaveTokenV3Service {
readonly _contract: AaveTokenV3;

constructor(tokenAddress: string, provider: providers.Provider) {
this._contract = AaveTokenV3__factory.connect(tokenAddress, provider);
}

public async balanceOf(user: string) {
return this._contract.balanceOf(user);
}

public async getPowerCurrent(
user: string,
delegationType: GovernancePowerType,
) {
return this._contract.getPowerCurrent(user, delegationType);
}
}
Loading

0 comments on commit e8b6223

Please sign in to comment.