From dee24e87a3081373e055422702cff7633ad95131 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 20 Aug 2020 17:54:16 +0200 Subject: [PATCH] simplification, make it work --- src/balancer/Pool.ts | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/balancer/Pool.ts b/src/balancer/Pool.ts index 8196d10a..2c76f194 100644 --- a/src/balancer/Pool.ts +++ b/src/balancer/Pool.ts @@ -139,27 +139,11 @@ export class Pool extends PoolFactory { * @return {String} */ async totalSupply(poolAddress: string): Promise { - const minABI = [ - { - constant: true, - name: 'totalSupply', - outputs: [ - { - name: 'balance', - type: 'uint256' - } - ], - payable: false, - stateMutability: 'view', - type: 'function' - } - ] as AbiItem[] - let result = null try { - const token = new this.web3.eth.Contract(minABI, poolAddress) - const totalSupply = await token.methods.totalSupply().call() + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) + const totalSupply = await pool.methods.totalSupply().call() result = this.web3.utils.fromWei(totalSupply) } catch (e) { console.error(e)