Hi guys, trying to read using web3 a value from a smart contract that has the following function:
function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts);
The output format I'm receiving is: [ '10500', '1036157' ]
Okay, its working.
Does someone know how to log only the second value? I mean that one that corresponds to '1036157' ?
thanks
Apr 23, 2021, 3:26 PM
I need to log only the 'amounts' info
Do you guys know how to fetch the item 'amouts' using web3 from the following smart contract function?
getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts);
thanks
getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts);
thanks
Apr 23, 2021, 4:28 PM
result[1] gets you the second item of the returned value of getAmountsOut
Apr 27, 2021, 7:04 PM
Thanks Jaymoh
Apr 27, 2021, 7:33 PM