Hi everyone I am getting the error below when I try to write to a Uniswap function using web3 in python. I can call any function, but I cannot get python to write to uniswap except to add liquidity. Is there something I am doing wrong? Thanks in advance.
MESSAGE ERROR
web3.exceptions.ContractLogicError: execution reverted: UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT
MY SOURCE CODE:
transaction = contract.functions.swapExactETHForTokens(
w3.toWei(1,'ether'),
[w3.toChecksumAddress('0xc778417E063141139Fce010982780140Aa0cD5Ab'),w3.toChecksumAddress('0xbf7a7169562078c96f0ec1a8afd6ae50f12e5a99')],
w3.toChecksumAddress('0xmymetamask'),17426800000).buildTransaction()
UNISWAP SOLIDITY FUNCTION PARAMETERS
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
Best Answer
insufficient input amount means the router contract didn't receive the expected amount of your inbound token (WETH)
do you have enough eth in your calling address to support the call?