Uniswap V3 - Single Hop Swap | DeFi

  Рет қаралды 9,525

Smart Contract Programmer

Smart Contract Programmer

Күн бұрын

Пікірлер: 38
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
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/
@ouailtayarth4012
@ouailtayarth4012 2 жыл бұрын
Love the energy in this video! Thanks for your effort.
@gaetboot
@gaetboot 2 жыл бұрын
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!
@sdfsfsfd437
@sdfsfsfd437 2 жыл бұрын
¡¡Muy buenos tus vídeos tio!!
@zmou2412
@zmou2412 2 жыл бұрын
finally v3
@dbltecnologia
@dbltecnologia 2 жыл бұрын
nice tutorial, thank you
@anonymousasdoasidjasd9911
@anonymousasdoasidjasd9911 2 жыл бұрын
whats that json-esque syntax at 6:20 passed into ``ExactInputSingleParams``? anonymous object?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
Struct
@emmanuelsanchez6405
@emmanuelsanchez6405 2 жыл бұрын
This example should should also work on the goerli testnet?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
probably not, token addresses may be different
@panchopacheco1247
@panchopacheco1247 Жыл бұрын
Your program worked great. But erc20 tokens don't have a deposit function; how do we deposit erc20 tokens into the contract?
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
approve + deposit
@carlosinvestor9025
@carlosinvestor9025 2 жыл бұрын
I'm trying to understand something, so does this code mean that you can make swaps on uniswap without using the website?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
This video is meant for developers that need to interact with Uniswap V3 using Solidity
@danis1840
@danis1840 2 жыл бұрын
How do you you change the solidity code snippet (token addresses) to JavaScript code? Is there any shortcut for this?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
address is string in JS "0x123...."
@erikeberhard8220
@erikeberhard8220 2 жыл бұрын
👍🏻
@nikhilbaghel6115
@nikhilbaghel6115 2 жыл бұрын
What is the difference between swap ETH for tokens and swap ExactETH for tokens & swap tokens for ETH and swap ExactTokens for ETH?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
docs.uniswap.org/protocol/V2/reference/smart-contracts/router-02#swapethforexacttokens
@princepanwar4875
@princepanwar4875 10 ай бұрын
does it works with the universal router?
@chanbi7095
@chanbi7095 2 жыл бұрын
I try it and its work. But how to swap back WETH to DAI, is it must change contract again?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
yes
@arpitkumar7127
@arpitkumar7127 2 жыл бұрын
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.
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
test on mainnet fork
@arpitkumar7127
@arpitkumar7127 2 жыл бұрын
@@smartcontractprogrammer yes, that's what i did. Everything is same as in the video.
@pierreduprey9032
@pierreduprey9032 Жыл бұрын
Where do you specify your private key???
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
in a secret file or for development I put in .env file
@pierreduprey9032
@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?
@lalo6667
@lalo6667 2 жыл бұрын
how do we set account?
@viktorcortez5706
@viktorcortez5706 2 жыл бұрын
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')
@manavkampani8367
@manavkampani8367 2 жыл бұрын
How are we converting Eth to Weth here?
@smartcontractprogrammer
@smartcontractprogrammer 2 жыл бұрын
in the test
@manavkampani8367
@manavkampani8367 2 жыл бұрын
@@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
@Eldar_Radle Жыл бұрын
shouldn`t u hide API key??
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
I can revoke them any time
@notoriousFOLB
@notoriousFOLB Жыл бұрын
What IDE is this?
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
VSCode
@bundotstore9141
@bundotstore9141 2 жыл бұрын
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.
Uniswap V3 - Multi Hop Swap | DeFi
12:09
Smart Contract Programmer
Рет қаралды 4,4 М.
Swap Part 1 | Uniswap V3 Core Contract Explained - Part 20
15:12
Smart Contract Programmer
Рет қаралды 2,2 М.
This Game Is Wild...
00:19
MrBeast
Рет қаралды 154 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
Uniswap V3 Arbitrage
19:19
Smart Contract Programmer
Рет қаралды 7 М.
The TRUTH About Golang Backend Frameworks
6:31
Melkey
Рет қаралды 129 М.
Constant Product Automated Market Maker | Solidity 0.8
30:01
Smart Contract Programmer
Рет қаралды 9 М.
Uniswap V3 Explained - Concentrated Liquidity, NFT LP Tokens, Licensing…
11:44
Do NOT Learn Kubernetes Without Knowing These Concepts...
13:01
Travis Media
Рет қаралды 324 М.
Developer walks you through the code of Uniswap V3
21:38
EatTheBlocks
Рет қаралды 20 М.
Uniswap V2 - Flash Swap | DeFi
8:46
Smart Contract Programmer
Рет қаралды 19 М.