Skip to content

Commit

Permalink
feat: return default oracle addresses
Browse files Browse the repository at this point in the history
When requesting the currency for Tiered STO 3.0, oracle addresses can't be fetched from the
contract, so we're forced to return the default ones
  • Loading branch information
monitz87 committed Dec 16, 2019
1 parent c31ce47 commit 6a7dbe4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/entities/TieredSto.ts
Expand Up @@ -128,11 +128,13 @@ export class TieredSto extends Sto<Params> {
*/
public async getCurrency(): Promise<CustomCurrency> {
const {
context: { contractWrappers },
context: {
contractWrappers: { moduleFactory, polymathRegistry },
},
address,
} = this;

const module = await contractWrappers.moduleFactory.getModuleInstance({
const module = await moduleFactory.getModuleInstance({
name: ModuleName.UsdTieredSTO,
address,
});
Expand All @@ -148,8 +150,10 @@ export class TieredSto extends Sto<Params> {
]);
} else {
// this has to be done this way because the 3.0.0 USDTieredSTO does not expose a getter for the oracles
ethOracleAddress = ZERO_ADDRESS;
polyOracleAddress = ZERO_ADDRESS;
[ethOracleAddress, polyOracleAddress] = await Promise.all([
polymathRegistry.getEthUsdOracleAddress(),
polymathRegistry.getPolyUsdOracleAddress(),
]);
currencySymbol = 'USD';
}

Expand Down

0 comments on commit 6a7dbe4

Please sign in to comment.