Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
feat(aura): Add Aura on Base (#3030)
Browse files Browse the repository at this point in the history
* feat(aura): Add Aura on Base

* fix(aura): Fix contract call
  • Loading branch information
wpoulin committed Nov 15, 2023
1 parent 1bc8cd5 commit 5fc64b8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/apps/aura/aura.module.ts
Expand Up @@ -3,6 +3,8 @@ import { Module } from '@nestjs/common';
import { AbstractApp } from '~app/app.dynamic-module';

import { ArbitrumAuraDepositTokenFetcher } from './arbitrum/aura.deposit.token-fetcher';
import { BaseAuraDepositTokenFetcher } from './base/aura.deposit.token-fetcher';
import { BaseAuraLpFarmContractPositionFetcher } from './base/aura.lp-farm.contract-position-fetcher';
import { AuraBalancerPoolResolver } from './common/aura.balancer-pool.resolver';
import { AuraViemContractFactory } from './contracts';
import { EthereumAuraAuraBalCompounderContractPositionFetcher } from './ethereum/aura.aura-bal-compounder.contract-position-fetcher';
Expand All @@ -22,6 +24,9 @@ import { OptimismAuraDepositTokenFetcher } from './optimism/aura.deposit.token-f
AuraBalancerPoolResolver,
// Arbitrum
ArbitrumAuraDepositTokenFetcher,
// Base
BaseAuraDepositTokenFetcher,
BaseAuraLpFarmContractPositionFetcher,
// Ethereum
EthereumAuraAuraBalTokenFetcher,
EthereumAuraChefContractPositionFetcher,
Expand Down
8 changes: 8 additions & 0 deletions src/apps/aura/base/aura.deposit.token-fetcher.ts
@@ -0,0 +1,8 @@
import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator';

import { AuraDepositTokenFetcher } from '../common/aura.deposit.token-fetcher';

@PositionTemplate()
export class BaseAuraDepositTokenFetcher extends AuraDepositTokenFetcher {
boosterAddresses = ['0x98ef32edd24e2c92525e59afc4475c1242a30184'];
}
27 changes: 27 additions & 0 deletions src/apps/aura/base/aura.lp-farm.contract-position-fetcher.ts
@@ -0,0 +1,27 @@
import { range } from 'lodash';

import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator';

import { AuraFarmContractPositionFetcher } from '../common/aura.farm.contract-position-fetcher';

@PositionTemplate()
export class BaseAuraLpFarmContractPositionFetcher extends AuraFarmContractPositionFetcher {
groupLabel = 'Liquidity Pool Staking';

boosterMultiplierAddress = '0x98ef32edd24e2c92525e59afc4475c1242a30184';

async getFarmAddresses() {
const boosters = [this.boosterMultiplierAddress].map(booster =>
this.contractFactory.auraBooster({ address: booster, network: this.network }),
);

const addresses = await Promise.all(
boosters.map(async contract => {
const numPools = await contract.read.poolLength().then(Number);
return Promise.all(range(0, numPools).map(v => contract.read.poolInfo([BigInt(v)]).then(p => p[3])));
}),
);

return addresses.flat();
}
}

0 comments on commit 5fc64b8

Please sign in to comment.