I am trying to interact with Uniswap's SwapRouter smart contract directly on Rinkeby Etherscan, but with no success. I would like to swap ETH to DAI or ETH to WETH for example.
Here is what I am trying to do.
Go to Uniswap SwapRouter smart countract on Rinkeby Etherscan and open smart contract's write functions.
Then I expand the function
exactInputSingle
.Here on the first field
payableAmount (ether)
I put 0.00000001On the second field
params (tuple)
I put the following data:
{
"tokenIn": "0xc778417E063141139Fce010982780140Aa0cD5Ab", // WETH address
"tokenOut": "0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735", // DAI address
"fee": 3000, // Liquidity providers fee
"recipient": "my-wallet-address",
"dealline": 1633596832, // Timestamp in seconds
"amountOut": 1000, // Desired out amount 1000 DAI in this case
"amountInMaximum": 0.00000001, // Same value that I use on the first field payableAmount
"sqrtPriceLimitX96": 0
}
- Now when I click Write I get the following error:
invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.1.1)
Obviously value is undefined and my question is:
How am I suppose to pass the value?
I've tried to put the value
inside the params tuple - not working.
I've tried to pass the value inside the first input (payableAmount) like {"value": 0.00000001}
- not working.
I've tried to pass it before the tuple like this:
{"value":0.00000001}({"tokenIn": "...", "tokenOut": "...", ...})
but it is failing with another message:
({value:1e-8}) is not a function
I see that using Solidity, people are doing something like this:
uniswapRouter.exactInputSingle{ value: msg.value }(params);
Is it possible to do such a call using Etherscan or not?
Any help will be appreciated, thank you in advance!