You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys, I follow the readme guide, but stuck with this error when calling getExpectedReturnWithGas, for destTokenEthPriceTimesGasPrice arg, it always return error with something like
Guide says arg destTokenEthPriceTimesGasPrice is returnAmount * gas_price, where returnAmount is result of getExpectedReturn(fromToken, destToken, amount, parts, flags), how do i get into this error? Please help me , Thank you very much.
Example code:
const{ returnAmount, distribution }=awaitcontract.methods.getExpectedReturn('0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',daiAddress,web3.utils.toWei('100','ether'),parts,0x00,).call();console.log('expected return -> ',returnAmount);constdestTokenEthPriceTimesGasPrice=web3.utils.toBN(returnAmount).mul(web3.utils.toBN(200*Math.pow(10,9)));const{returnAmount: a, estimateGasAmount,distribution: b}=awaitcontract.methods.getExpectedReturnWithGas('0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',daiAddress,web3.utils.toWei('100','ether'),parts,0x00,destTokenEthPriceTimesGasPrice,).call();console.log(a);
PS: i'm using web3@1.2.1
The text was updated successfully, but these errors were encountered:
Hi guys, I follow the readme guide, but stuck with this error when calling
getExpectedReturnWithGas
, fordestTokenEthPriceTimesGasPrice
arg, it always return error with something likeGuide says arg
destTokenEthPriceTimesGasPrice
isreturnAmount * gas_price, where returnAmount is result of getExpectedReturn(fromToken, destToken, amount, parts, flags)
, how do i get into this error? Please help me , Thank you very much.Example code:
PS: i'm using
web3@1.2.1
The text was updated successfully, but these errors were encountered: