0:00 - Intro and setup 3:04 - Code swapExactInputSingle - use all input tokens, single hop 6:42 - Write test for swapExactInputSingle 13:05 - Execute test for swapExactInputSingle 13:25 - Code swapExactOutputSingle - buy exact amount of token, single hop 15:25 - Write test for swapExactOutputSingle 18:12 - Execute test for swapExactOutputSIngle Code github.com/t4sk/defi-by-example/tree/main/uni-v3 Unisvap V3 Doc docs.uniswap.org/protocol/guides/swaps/single-swaps Alchemy www.alchemy.com/ Take a course www.smartcontract.engineer/
@ouailtayarth40122 жыл бұрын
Love the energy in this video! Thanks for your effort.
@gaetboot2 жыл бұрын
Hey, I noticed at some point you comment the test. Next time you can just change "it" that declares your test to "xit" Hope it can help :) Helpful video btw!
@sdfsfsfd4372 жыл бұрын
¡¡Muy buenos tus vídeos tio!!
@zmou24122 жыл бұрын
finally v3
@dbltecnologia2 жыл бұрын
nice tutorial, thank you
@anonymousasdoasidjasd99112 жыл бұрын
whats that json-esque syntax at 6:20 passed into ``ExactInputSingleParams``? anonymous object?
@smartcontractprogrammer2 жыл бұрын
Struct
@emmanuelsanchez64052 жыл бұрын
This example should should also work on the goerli testnet?
@smartcontractprogrammer2 жыл бұрын
probably not, token addresses may be different
@panchopacheco1247 Жыл бұрын
Your program worked great. But erc20 tokens don't have a deposit function; how do we deposit erc20 tokens into the contract?
@smartcontractprogrammer Жыл бұрын
approve + deposit
@carlosinvestor90252 жыл бұрын
I'm trying to understand something, so does this code mean that you can make swaps on uniswap without using the website?
@smartcontractprogrammer2 жыл бұрын
This video is meant for developers that need to interact with Uniswap V3 using Solidity
@danis18402 жыл бұрын
How do you you change the solidity code snippet (token addresses) to JavaScript code? Is there any shortcut for this?
@smartcontractprogrammer2 жыл бұрын
address is string in JS "0x123...."
@erikeberhard82202 жыл бұрын
👍🏻
@nikhilbaghel61152 жыл бұрын
What is the difference between swap ETH for tokens and swap ExactETH for tokens & swap tokens for ETH and swap ExactTokens for ETH?
I try it and its work. But how to swap back WETH to DAI, is it must change contract again?
@smartcontractprogrammer2 жыл бұрын
yes
@arpitkumar71272 жыл бұрын
I'm getting this error, Error: invalid address or ENS name (argument="name", value=undefined, code=INVALID_ARGUMENT, version=contracts/5.6.2) while executing test for swapExactInput Single.
@smartcontractprogrammer2 жыл бұрын
test on mainnet fork
@arpitkumar71272 жыл бұрын
@@smartcontractprogrammer yes, that's what i did. Everything is same as in the video.
@pierreduprey9032 Жыл бұрын
Where do you specify your private key???
@smartcontractprogrammer Жыл бұрын
in a secret file or for development I put in .env file
@pierreduprey9032 Жыл бұрын
@@smartcontractprogrammer same here but I don't see it referenced in your script. I'm also getting confused, I thought you could run a script and it could perform a swap for you, but you need to deploy a smart contract first that interacts with a liquidity provider first then use remix to interact with your contract that swaps with uniswap, aave, sushiswap e.t.c. Am I right?
@lalo66672 жыл бұрын
how do we set account?
@viktorcortez57062 жыл бұрын
Hi, I have a problem with approving of dai (I'm trying to make a transaction with impersonate Fund) await dai.approve(swapExamples.address,amountIn) TypeError: Cannot read properties of undefined (reading 'approve')
@manavkampani83672 жыл бұрын
How are we converting Eth to Weth here?
@smartcontractprogrammer2 жыл бұрын
in the test
@manavkampani83672 жыл бұрын
@@smartcontractprogrammer await weth.connect(accounts[0]).deposit({value: amountIn}); by this line of code we're depositing amountIn ETH to the WETH smart contract on the main-net and getting equivalent WETH in return?
@Eldar_Radle Жыл бұрын
shouldn`t u hide API key??
@smartcontractprogrammer Жыл бұрын
I can revoke them any time
@notoriousFOLB Жыл бұрын
What IDE is this?
@smartcontractprogrammer Жыл бұрын
VSCode
@bundotstore91412 жыл бұрын
I'm getting this error, Error: invalid address or ENS name (argument="name", value=undefined, code=INVALID_ARGUMENT, version=contracts/5.6.2) while executing test for swapExactInput Single.