Skip to content

Commit

Permalink
Merge pull request #520 from balancer/gyro-config-apr-fix
Browse files Browse the repository at this point in the history
Converting multicall hex format to boolean;
  • Loading branch information
lgahdl authored Aug 16, 2023
2 parents 7616aac + 120cbbe commit 7933fbd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions balancer-js/src/modules/data/gyro-config/repository.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { formatBytes32String } from '@ethersproject/strings';
import { keccak256 } from '@ethersproject/solidity';
import { defaultAbiCoder } from '@ethersproject/abi';
import { formatFixed } from '@ethersproject/bignumber';
import { BigNumber, formatFixed } from '@ethersproject/bignumber';
import { Provider } from '@ethersproject/providers';
import { GyroConfig, GyroConfig__factory, Multicall } from '@/contracts';
import { GyroConfigInterface } from '@/contracts/GyroConfig';
Expand Down Expand Up @@ -66,9 +66,11 @@ export class GyroConfigRepositoryImpl implements GyroConfigRepository {
]),
},
];
const [, [hasSpecificKey, hasPoolTypeKey, hasDefaultKey]] =
const [, [hasSpecificKeyHex, hasPoolTypeKeyHex, hasDefaultKeyHex]] =
await this.multicall.callStatic.aggregate(payload);

const hasSpecificKey = BigNumber.from(hasSpecificKeyHex).eq(1);
const hasPoolTypeKey = BigNumber.from(hasPoolTypeKeyHex).eq(1);
const hasDefaultKey = BigNumber.from(hasDefaultKeyHex).eq(1);
if (hasSpecificKey) {
fee = parseFloat(
formatFixed(await this.gyroConfig.getUint(encodedPoolSpecificKey), 18)
Expand Down

0 comments on commit 7933fbd

Please sign in to comment.