This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aura): Add Aura on Base (#3030)
* feat(aura): Add Aura on Base * fix(aura): Fix contract call
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
27
src/apps/aura/base/aura.lp-farm.contract-position-fetcher.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} |