diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index 8a4f107..3f916ca 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -90,11 +90,10 @@ export abstract class ContractBase extends Instantiable { const estimatedGas = await methodInstance.estimateGas(args, { from }) - const tx = methodInstance.send({ + return methodInstance.send({ from, gas: estimatedGas }) - return tx } catch (err) { const mappedArgs = this.searchMethod(name, args).inputs.map((input, i) => { return { diff --git a/src/keeper/contracts/Token.ts b/src/keeper/contracts/Token.ts index 5a8d96b..7055bb8 100644 --- a/src/keeper/contracts/Token.ts +++ b/src/keeper/contracts/Token.ts @@ -1,4 +1,5 @@ import BigNumber from 'bignumber.js' +import { TransactionReceipt } from 'web3-core' import ContractBase from './ContractBase' import { InstantiableConfig } from '../../Instantiable.abstract' @@ -24,6 +25,8 @@ export default class OceanToken extends ContractBase { } public async transfer(to: string, amount: number, from: string) { - return this.send('transfer', from, [to, amount]) + return this.send('transfer', from, [to, amount]).then( + (result: TransactionReceipt) => result.transactionHash + ) } }