I have forked the eth mainnet onto my local machine using ganache cli and am trying to call the UNISWAP router2's SwapETHForExactTokens to swap eth for MEME tokens. I call the function from truffle console like so,

await uniRouter.methods.swapETHForExactTokens('500', address, sender, '1600952122').send({from: sender, value: web3.utils.toWei('2', 'Ether')}),

Where address = [WETH address, MEME token address], sender = unlocked account, and uniRouter is an abstraction of the router contract. When I first start the cli and call the function I get 'runtime error: revert' and on any subsequent calls with varying parameters I also get 'revert reason: UniswapV2: LOCKED'. Any ideas how to solve this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.