Thank you, Julian. Another great video. I'm just asking myself how people could easily manipulate the market price on-chain as you mentioned at 33:00? Could you please point me to some references to read more about this? Thanks.
AMAZING!!! By far one of the best tutorials regarding uniswap and solidity coding. Can you please make a video using getReserves etc and constructing a pair price from 2 tokens addresses? Thank you,
Suggestion: Instead of copying abi there is a cleaner way. I did in my react project using: 1. Run: `npm install @uniswap/v2-periphery` 2. import the json in the javascript file: `import UniswapV2Router02 from '@uniswap/v2-periphery/build/UniswapV2Router02.json'; ` 3. Access the abi: ` const abi: AbiItem | AbiItem[] = UniswapV2Router02['abi'] as AbiItem | AbiItem[]; ` 4. get contract object: ` const uniswapRouter = new web3.eth.Contract(abi, UniSwapV2_Router02_Address); `
@@EatTheBlocks Great Tutorial. Thank you. I am unable to understand how to pass gasPrice value. Here the default you gave was 20e9 which is 20 Gwei. But, how to I convert 200 Gwei to this similar value to 20e9 ? Actually what are these 20e9 representation of the values? Can you please point me to right direction on this? Thank you.
Hello, I have a question about Why have we use uniswap in our contract tokens? What is the adventatge about not use that? Because I can do liquduity in pancakeswap for example. Thanks
Wsp bro I'm trying to integrate the interface on my swapliquify function but it's not working sits giving an error on my contract any way I can use to resolve this issue 🙏🙏🙏
Thanks man:) I have a full playlist about Flashloan: ruclips.net/p/PLbbtODcOYIoEMz-XatfkcFMsEwMmYShwk And a course about Flashloan arbitrage: eattheblocks-pro.teachable.com
I have a question! I used the RINKEBY test network (chain id =4 ) for both Uniswap and my Infura. But I dont see any transaction occuring in my Metamask. How do I test the program?
How to convert some % off selling fee and send to a wallet as dev fee...like if some one try to sell on defi exchange my token 5% cut as a fee and convert to WETH and send to a particular add.
I really like the Uniswap tutorial, it helped me a lot, I'm trying to use USDT to swap to others cryptos and encountered some problems,do you have any course for similar stuff?or anyone could help with this,if so, i can willing to pay for it
At the min 4:03 you said that me as trader i can send WETH to the pair contract in exchange for DAI. I tried to send a small amount of WETH from my metamask to the pair contract and i lose my WETH. I did not became any DAI back on my wallet. Can you explain if it is a way to swap (trade) WETH for another token without using the Uniswap UI. Better to say is there a way to trade in backend of uniswap? Thank you!
Nice tutorial. Thank you! Is it possible to pass also gas Limit value and how? The same question about nonce - whether it is possible to assign a nonce number or send tx with the same number (to cancel the tx).
Yes its possible, by customizing the tx object. The syntax is different depending on whether you are using Web3 or Ethers. You have to look at the doc of these projects for specific syntax.
Is there a reason tokens don't use the "exclusive fee" model? Meaning the token sender will send the (transaction amount + fees) and the recipient just gets the transaction amount?
In the solidity code, Do you ever import Uniswap and OpenZeppelin files in any moment? Because I only see that you call IUniswap and IERC20 but without importing any file. This is ok?
Thanks for the great tutorial. What if I want to change it to token to token? For example, DAI->BAT. Then am i specifying path[0] = DAI and pair[1] = BAT?
I dont have this tutorial fresh in my mind, but tokens like ETH have decimals. ETH have 18 decimals. And most token have 18 decimals too, with some exceptions like USDC (6 decimals).
@@EatTheBlocks const trade = new Trade(route, new TokenAmount(weth, '100000000000000000'), TradeType.EXACT_INPUT); you used 18 digits total, which means this 0.1 Eth. Yet you said 100 Eth in the video. Can you please confirm it is 0.1 eth and not 100 eth? thanks.
Hi Julian, great video! I have one question ... how to test the Solidity program? I have already tested some smart contracts using Truffle and Ganache, but they were simple local project. In this case how could I test it without spending real ETH? Thanks a lot : )
@@EatTheBlocks thanks for signaling this! I went through it very quickly and it only talks about how to write tests for code that can run on a local blockchain. I was referring to testing the code above which requires interaction with Uniswap, that is how to run it on test nets. So this is not exactly what I was looking for. Thanks anyway!
One huge part that I am confused about - how do you use these interfaces without having to import those other smart contracts?! Actually, I am very confused about these Interfaces and how you are using them within your functions.
I keep getting this error. I did exact copy of your javascript code with my private key. (node:3550) UnhandledPromiseRejectionWarning: Error: resolver or addr is not configured for ENS name (argument="name", value="", code=INVALID_ARGUMENT, version=contracts/5.0.5)
14:04 , I think it needs to be 18 zeros, am I right? I am currently experimenting to compare my execution price with uniswap interface on the website. The numbers are only correct when i use 18 zeros.
I have an additional question. I have seen that there are a number of front run bots and they seem to work with a contract on the ethereum network and call that contract whenever they want to execute a front run trade. Could you know why they would use an onchain-contract that they published themselves to execute trades rather than using node.js. Is this necessary?
@@kttalkZ I have done some research. The front run trade bots use a on chain contract to interact with to prevent their front run trades from being front run again by other bots.
@EatTheBlocks hey man, thank you so much for this tutorial, is very helpful. How APYs in staking pools or farming pools are calculated? I'm very curious about that
It depends on the staking mechanism. Let's stay you earn some reward tokens RT for staking some other tokens, ST They take the current price of the reward token, calculate how much you get per block with your current stake, and convert this per block profit in the unit of the staking token (ST). They they annualize this amount, assuming the price of the reward token will stay the same (it will not of course, this is just a theoritical APY).
Error: Invariant failed: CHAIN_ID how can i solve this? at invariant (/path/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:14:11) at Function.fetchPairData (/path/node_modules/@uniswap/sdk/dist/sdk.cjs.development.js:1556:79) at init (/path/index.js:13:40)
Hello, you know how to inform how I can create a platform similar to a Tron clone or ethereum, there is a tutorial or video explaining how to create this type of eco system
I just launched a bep20 token and it seems like the smart contract is accumulating tokens with each transactions. It’s got something to do with auto liquidity. Will the tokens be stuck inside the contract? Will the amount keeps growing?...
Ok if I route someToken with WETH it's ok. But I cant route between two different tokens. I get an error. And how to make a transaction if an exchange needs a path for example 3 or more tokens from A to B.
@@EatTheBlocks Yes I know, but the smart contracts only swap tokens right(that is execute the transactiona) ? But how the sdk is proving the prices? You can tell the smart contracts are not being executed as the action of getting the prices, transaction costs etc is not requiring any gas fees. My understanding was executing any smart contract requires gas fees. Correct me If I am wrong.
@@raunaquepatra3966 Not all transactions require gas fees ... ... ... you can read BlockChain data without creating an entire transaction .... as long as you're not changing blockchain state.
Hello Julian, nice work...watched a couple of your livestreams. Say I'm at another academy and progressed through it a fair bit but I am no where near launching my own project...actually that is the stage I am at right now. Do you have a bulletin board in your academy where I can post my queries? I am keen to start a 'travelhealth' utility token for a network of healthcare providers in Egypt. I seek to target UK and european clients looking for discount but high quality healthcare and tourism and the token would be used amongst the providers. I would likely register in Malta as technically Egypt is crypto hostile. I myself am a dental surgeon seeking licensure in Egypt with an active license in California, USA. I seek to be the bridge consultant especially for larger cases such as full mouth reconstruction and facial plastic surgeries. While I have taken C++, Solidity and advanced Ethereum programming courses...I know my limit and it is best for me to partner with another to get this project rolling. Your thought?
Hi John, Nice project! I dont know much about travel, health in Egypt, but I can certainly help you on the technical side. We do have a forum but that's mostly for students of my courses: forum.eattheblocks.com If you need some customized help, you can book me for a 1h private session here: eattheblocks-pro.teachable.com/p/private-coaching I can help you translate your business needs into a technical architecture, and make you save time, and feel confident that you are going in the right direction. Cheers, Julien
Hi man, thank you for you efforts for providing such a good knowledge, ( Please can you tell me how I can get Uniswap Api Key ) So I can use this in my website for displaying data from uniswap, such as trade history, prices and top coins etc. I am unable to find api key from uniswap. I will appreciate alot any kind of help. Thanks.
running this code in remix with injected web3-Metamask. Contract deployed to Rinkeby. But when calling swapTokenForETH, given amountIn - 1. But facing this error: Uni::transferFrom: transfer amount exceeds spender allowance". Can you please help me with it.
Getting this when trying to swap UNI for ETH (part 2 solidity) "Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? execution reverted: UniswapV2Router: EXPIRED { "originalError": { "code": 3, "data": "0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000018556e69737761705632526f757465723a20455850495245440000000000000000", "message": "execution reverted: UniswapV2Router: EXPIRED" } }" Any suggestions? Thanks
@@MaxPicAxe Thanks for your reply, the reason was the desktop time, so it was reverted because of timestamp and it worked after taking that part to solidity))
Hi Julian. I am trying to use the code for pancakeswap, but I got this error: .. unsupported getDefaultProvider network (operation="getDefaultProvider", network={"chainId":56,"name":"unknown"}.. Could you help me to solve it ?
@@王先生-f6c Which value? Here is my code that got error: const tx = await uniswap.swapExactETHForTokens( amountOutMin, path, to, deadline, {value,gasPrice: 20000000000} ); Thank you so much.
@@王先生-f6c Thanks. It worked like a charm. But I got the error "Error: processing response error". Maybe it was caused by Infura. Could you please send me the full code that work. I'm newbie and I find it difficult to identify the error :(
This video is so good. If i want to send 0.01 eth then i will do const trade = new Trade(route, new TokenAmount(weth, '0.001000000000000000000'), TradeType.EXACT_INPUT). ?
Hi Misael. You can start with this free series on Solidity: ruclips.net/video/CHLgAgWoUvo/видео.html Then the next step, if you are committed to find a Blockchain job, is to take my course: eattheblocks.com/6-figure-blockchain-developer/
i trying at pancakeswap-sdk and returning this error, can you please help me? (node:14348) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ' call' of null at Contract. node_modules\@ether sproject\contracts\lib\index.js:316:63)
Hey there, we are looking for a fluent Solidity engineer to help us with one of our projects. Do you do any development privately? What is the best email to get in touch for business inquiries? If you can't if you know any other engineers that could help that would be great!
Hi! Thanks for a cool tutorial. i did exact same thing but i get an error: UnhandledPromiseRejectionWarning: Error: resolver or addr is not configured for ENS name (argument="name", value="", code=INVALID_ARGUMENT, version=contracts/5.0.5)
i keep getting this error --> Error: invalid hexlify value (argument="value", value=[-1004487074,773], code=INVALID_ARGUMENT, version=bytes/5.0.5). happens even when i hexlify it or convert it to hex
I love the way you have no choice but to use interfaces like this in solidity. It forces better programming, better architecture.
- 0:55 how to uniswap work
- 5:55 interact with uniswap using sdk
- 20:00 infura
lifesaver
This video covers all the basics you need to start writing a dapp! Thanks!
Dude, You are a fantastic engineer. Thank you so much for the work you're doing. It's extremely helpful!.
Thank you, Julian. Another great video. I'm just asking myself how people could easily manipulate the market price on-chain as you mentioned at 33:00? Could you please point me to some references to read more about this? Thanks.
chainlink oracle
I second that, it would be great to better understand this
can somebody explain this plz
This is awesome! Exactly what I was looking for - keep up the good work!
Thanks, will do!
@@EatTheBlocks pode me ajudar amigo por favor estou com problema aqui
AMAZING!!! By far one of the best tutorials regarding uniswap and solidity coding. Can you please make a video using getReserves etc and constructing a pair price from 2 tokens addresses?
Thank you,
Great suggestion!
This video really helped me. I would love to see the more verbose way of making pairs.
Suggestion:
Instead of copying abi there is a cleaner way. I did in my react project using:
1. Run:
`npm install @uniswap/v2-periphery`
2. import the json in the javascript file:
`import UniswapV2Router02 from '@uniswap/v2-periphery/build/UniswapV2Router02.json';
`
3. Access the abi:
` const abi: AbiItem | AbiItem[] = UniswapV2Router02['abi'] as AbiItem | AbiItem[];
`
4. get contract object:
` const uniswapRouter = new web3.eth.Contract(abi, UniSwapV2_Router02_Address);
`
that works too :)
@@EatTheBlocks Great Tutorial. Thank you. I am unable to understand how to pass gasPrice value. Here the default you gave was 20e9 which is 20 Gwei. But, how to I convert 200 Gwei to this similar value to 20e9 ? Actually what are these 20e9 representation of the values? Can you please point me to right direction on this? Thank you.
Is there any library which provide ABI of any contract runtime in node js?
I'm facing issue to approve token node js . acn you provide info on that?
sir how can i contact you?
For all those stuck at the 'INVALID_ARGUMENTS portion, this is a better solution!
Thank you so much! Your tutorials really help me with getting started with solidity! Nice cap btw :)
Great Video😃Learned a lot.
Glad you enjoyed it!
Very well explained thank you!
Glad it was helpful!
Built this today. Cool tutorial for sure my guy. Very advanced stuff made fairly simple
Exactly what i was looking for, thank you sir 🙏
Perfect video! Thank you very much for the explanation & code
Glad it helped!
Hello,
I have a question about Why have we use uniswap in our contract tokens?
What is the adventatge about not use that?
Because I can do liquduity in pancakeswap for example.
Thanks
Hi Julian, love your channel.
Q: are you able to show to clone Geth and modify the Gas function to be lower?
Thank you so much! Thank you so much! Thank you so much! Thank you so much! Thank you so much!
Great! So, is it safer to do it through uniswap SDK or is it better through an smart contract??
Wsp bro I'm trying to integrate the interface on my swapliquify function but it's not working sits giving an error on my contract any way I can use to resolve this issue 🙏🙏🙏
Great video! Really helpful! Question, why do you add 15 zeros after the 100 ETH when creating the TokenAmount.
the input value is in WEI, and not ETHER. so 1000000000000000 wei is equal to 1 ETH.
Bro awesome tutotial please make video with flash loan and arbaitage it will be very helpful
Thanks man:)
I have a full playlist about Flashloan:
ruclips.net/p/PLbbtODcOYIoEMz-XatfkcFMsEwMmYShwk
And a course about Flashloan arbitrage:
eattheblocks-pro.teachable.com
we also need one approve to transfer balance from msg.sender to smart contract dont we.
is uniswap/sdk also work for pancakswap?
Dont you need to approve first before calling transferFrom function ?
Hello, thanks for this great tutorial. Unfortunately i can't find a link to the presented code... Isn't it in your Github repo?
Great content, as always!
Can you interact with multiple block chains?
do you have a pancakeswap version of this?
How on earth did you acquire so much knowledge?
Thanks for this guide.
I have a question! I used the RINKEBY test network (chain id =4 ) for both Uniswap and my Infura. But I dont see any transaction occuring in my Metamask. How do I test the program?
Awesome tutorial!
Quick question.
How can someone create a route for a token pair that does not exist programatically?
Have you found something usefull for this ?
How to convert some % off selling fee and send to a wallet as dev fee...like if some one try to sell on defi exchange my token 5% cut as a fee and convert to WETH and send to a particular add.
hey do you know how to attract liquidity providers except a vampire attack (what sushiswap did) to attract liquidity providers
how does poocoin find out before executing a transaction what the slippage tolerance will be?
I really like the Uniswap tutorial, it helped me a lot, I'm trying to use USDT to swap to others cryptos and encountered some problems,do you have any course for similar stuff?or anyone could help with this,if so, i can willing to pay for it
Great video. Thanx.
Now a lazy question:
Is there a max slippage like in the Uniswap app (49%) or is it possible to set it at any percentage?
You specify this is the min/max token you are willing to receive in the swap functions
@@EatTheBlocks Yep, but is there a max limit do you know?
At the min 4:03 you said that me as trader i can send WETH to the pair contract in exchange for DAI. I tried to send a small amount of WETH from my metamask to the pair contract and i lose my WETH. I did not became any DAI back on my wallet. Can you explain if it is a way to swap (trade) WETH for another token without using the Uniswap UI. Better to say is there a way to trade in backend of uniswap? Thank you!
what is font family in your IDE ?
Nice tutorial. Thank you!
Is it possible to pass also gas Limit value and how?
The same question about nonce - whether it is possible to assign a nonce number or send tx with the same number (to cancel the tx).
Yes its possible, by customizing the tx object. The syntax is different depending on whether you are using Web3 or Ethers. You have to look at the doc of these projects for specific syntax.
TO swap back in node how to approve token for uniswap? Kindly, provide info on that as well.
awesome tutorial, i want to use it from javascript
Great!
Is there a reason tokens don't use the "exclusive fee" model? Meaning the token sender will send the (transaction amount + fees) and the recipient just gets the transaction amount?
is that terminal node?
Error: invalid BigNumber value
How can I solve this? This happened from the contract part.
Did you solve it? I have the same issue
@@jiml581 same here, let us know if you found a fix
how to add liquidity from add liquidity function can anybody help with that it's showing out of gas limit while doing that
How would you approach / what would the code be for a payable function interaction like swapExactETHForTokens?
In the solidity code, Do you ever import Uniswap and OpenZeppelin files in any moment? Because I only see that you call IUniswap and IERC20 but without importing any file. This is ok?
Thanks for the great tutorial. What if I want to change it to token to token? For example, DAI->BAT. Then am i specifying path[0] = DAI and pair[1] = BAT?
Yes, correct
great tutorial. could you explain all the zero's on the tokenamount? is it in wei or something?
I dont have this tutorial fresh in my mind, but tokens like ETH have decimals.
ETH have 18 decimals. And most token have 18 decimals too, with some exceptions like USDC (6 decimals).
@@EatTheBlocks const trade = new Trade(route, new TokenAmount(weth, '100000000000000000'), TradeType.EXACT_INPUT);
you used 18 digits total, which means this 0.1 Eth. Yet you said 100 Eth in the video. Can you please confirm it is 0.1 eth and not 100 eth? thanks.
@@EatTheBlocks im not able to pass a value greater than 100 in TokenAmount. it says invalid Big number. any ideas?
Yeah because ETH is represented in denomination of WEI which have 18 zero's
Did you make an error when you call the contract function? Shouldn't it be swapExactETHForTokens() not 'send'?
It should be swap. Probably typo.
@@sabbir883 is it swapExactETHForTokens() , isn'it ? I think it is not sendExactETHForTokens. Someone to confirm ?
Hi Julian, great video! I have one question ... how to test the Solidity program? I have already tested some smart contracts using Truffle and Ganache, but they were simple local project. In this case how could I test it without spending real ETH?
Thanks a lot : )
Checkout this video:
ruclips.net/video/b2VInFwZmNw/видео.html
@@EatTheBlocks thanks for signaling this! I went through it very quickly and it only talks about how to write tests for code that can run on a local blockchain. I was referring to testing the code above which requires interaction with Uniswap, that is how to run it on test nets. So this is not exactly what I was looking for. Thanks anyway!
@@emanuelkent were u able to do this ? Let me know
One huge part that I am confused about - how do you use these interfaces without having to import those other smart contracts?! Actually, I am very confused about these Interfaces and how you are using them within your functions.
real nice bro - TY !!
can you make a video on how to create your own ethereum node?
I keep getting this error. I did exact copy of your javascript code with my private key.
(node:3550) UnhandledPromiseRejectionWarning: Error: resolver or addr is not configured for ENS name (argument="name", value="", code=INVALID_ARGUMENT, version=contracts/5.0.5)
Hello, I have this error too. Did you found a solution ?
having same error. did u find a solution?
@@elxanito123 Not yet...
@EatTheBlocks we would appreciate your help! :) stuck on this problem unfortunately
@@BlackFearOpsOne Please inform me if u do find. will do the same
14:04 , I think it needs to be 18 zeros, am I right? I am currently experimenting to compare my execution price with uniswap interface on the website. The numbers are only correct when i use 18 zeros.
I don't remember how much I wanted to specify. We need 18 zeros for 1 WETH. So add even more zeros if you want 10, 100 WETH or more.
@@EatTheBlocks ah ok that makes it clear thanks
I have an additional question. I have seen that there are a number of front run bots and they seem to work with a contract on the ethereum network and call that contract whenever they want to execute a front run trade. Could you know why they would use an onchain-contract that they published themselves to execute trades rather than using node.js. Is this necessary?
@@567BTHTY hey I also want to know, is there a way to front run, this has become the painpoint
@@kttalkZ I have done some research. The front run trade bots use a on chain contract to interact with to prevent their front run trades from being front run again by other bots.
Was anyone able to use code to do fast buy ?
Hello brother, I need to make a token with automatic burning in each transaction, do you know how I could do it?
@EatTheBlocks hey man, thank you so much for this tutorial, is very helpful. How APYs in staking pools or farming pools are calculated? I'm very curious about that
It depends on the staking mechanism.
Let's stay you earn some reward tokens RT for staking some other tokens, ST
They take the current price of the reward token, calculate how much you get per block with your current stake, and convert this per block profit in the unit of the staking token (ST). They they annualize this amount, assuming the price of the reward token will stay the same (it will not of course, this is just a theoritical APY).
@@EatTheBlocks hey do you know how to attract liquidity providers except a vampire attack (what sushiswap did) to attract liquidity providers
Error: Invariant failed: CHAIN_ID how can i solve this?
at invariant (/path/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:14:11)
at Function.fetchPairData (/path/node_modules/@uniswap/sdk/dist/sdk.cjs.development.js:1556:79)
at init (/path/index.js:13:40)
I get the same error, did you figure out how to solve it?
Very Good
How can I change gas Limit ?
Thank you for the update.
Hello, you know how to inform how I can create a platform similar to a Tron clone or ethereum, there is a tutorial or video explaining how to create this type of eco system
good suggestion :)
can you make uniswap tutorial but with uniswap V3
Very Cool, thanks
I just launched a bep20 token and it seems like the smart contract is accumulating tokens with each transactions. It’s got something to do with auto liquidity. Will the tokens be stuck inside the contract? Will the amount keeps growing?...
how to calculate price in js with multihops?
Ok if I route someToken with WETH it's ok. But I cant route between two different tokens. I get an error.
And how to make a transaction if an exchange needs a path for example 3 or more tokens from A to B.
Really helpful video
Glad to hear that
Pure gold!
Please release a video for V3 SDK, documentation is no help.
There is a live training on Uniswap V3 in the EatTheBlocks academy
where does the requests go? I mean which/what server is responding to the requests? who is hosting the servers.
Uniswap is a smart contract, there is no server, it's on the blockchain
@@EatTheBlocks Yes I know, but the smart contracts only swap tokens right(that is execute the transactiona) ? But how the sdk is proving the prices?
You can tell the smart contracts are not being executed as the action of getting the prices, transaction costs etc is not requiring any gas fees.
My understanding was executing any smart contract requires gas fees. Correct me If I am wrong.
@@raunaquepatra3966
Not all transactions require gas fees ... ... ... you can read BlockChain data without creating an entire transaction .... as long as you're not changing blockchain state.
Thanks for the tutorial. but it would be a lot more useful to show us how to debug the remix version...
can I link the script with an ethers API Key Token?
Unable to trade with "Fail with error 'UniswapV2Router: INVALID_PATH". Any idea how to fix?
Hello Julian, nice work...watched a couple of your livestreams. Say I'm at another academy and progressed through it a fair bit but I am no where near launching my own project...actually that is the stage I am at right now. Do you have a bulletin board in your academy where I can post my queries? I am keen to start a 'travelhealth' utility token for a network of healthcare providers in Egypt. I seek to target UK and european clients looking for discount but high quality healthcare and tourism and the token would be used amongst the providers. I would likely register in Malta as technically Egypt is crypto hostile. I myself am a dental surgeon seeking licensure in Egypt with an active license in California, USA. I seek to be the bridge consultant especially for larger cases such as full mouth reconstruction and facial plastic surgeries. While I have taken C++, Solidity and advanced Ethereum programming courses...I know my limit and it is best for me to partner with another to get this project rolling. Your thought?
Hi John,
Nice project!
I dont know much about travel, health in Egypt, but I can certainly help you on the technical side.
We do have a forum but that's mostly for students of my courses:
forum.eattheblocks.com
If you need some customized help, you can book me for a 1h private session here:
eattheblocks-pro.teachable.com/p/private-coaching
I can help you translate your business needs into a technical architecture, and make you save time, and feel confident that you are going in the right direction.
Cheers,
Julien
hope your project is running now!!
nice content thx !
Glad you enjoyed!
Hi man, thank you for you efforts for providing such a good knowledge, ( Please can you tell me how I can get Uniswap Api Key ) So I can use this in my website for displaying data from uniswap, such as trade history, prices and top coins etc. I am unable to find api key from uniswap. I will appreciate alot any kind of help. Thanks.
I am not aware of an API key for using the Uniswap API. You can use it without API key.
running this code in remix with injected web3-Metamask. Contract deployed to Rinkeby. But when calling swapTokenForETH, given amountIn - 1. But facing this error: Uni::transferFrom: transfer amount exceeds spender allowance". Can you please help me with it.
Can anyone help me with this? It would be greatly appreciated.
Thank you but ı have a problem
TypeError: uniswap.sendExactETHForTokens is not a function what is wrong
@Jackson Aguasme too , I think he made a mistake. It should be swapExactForTokens()
Getting this when trying to swap UNI for ETH (part 2 solidity)
"Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
execution reverted: UniswapV2Router: EXPIRED { "originalError": { "code": 3, "data": "0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000018556e69737761705632526f757465723a20455850495245440000000000000000", "message": "execution reverted: UniswapV2Router: EXPIRED" } }"
Any suggestions? Thanks
Your probably not sending enough gas fee in your transaction and therefore no miner will accept it.
@@MaxPicAxe Thanks for your reply, the reason was the desktop time, so it was reverted because of timestamp and it worked after taking that part to solidity))
Hi Julian. I am trying to use the code for pancakeswap, but I got this error: .. unsupported getDefaultProvider network (operation="getDefaultProvider", network={"chainId":56,"name":"unknown"}.. Could you help me to solve it ?
You need to be connected to Binance Smart Chain.
How did you know that Ethers package was missing? What made you suspect that?
When I tried to install Uniswap SDK I think it mentioned some sub-package of ethers was missing.. that gave me a hint
I have got this error: "UnhandledPromiseRejectionWarning: Error: invalid BigNumber value"
Please help me.
Got the same problem too. Line const tx = await uniswap.swapETHForExactTokens
You have to change the value to Hex format.
@@王先生-f6c Which value? Here is my code that got error:
const tx = await uniswap.swapExactETHForTokens(
amountOutMin,
path,
to,
deadline,
{value,gasPrice: 20000000000}
);
Thank you so much.
@@ongNguyen-vj5xw Try this. const amountOutMin = toHex(trade.minimumAmountOut(slippageToLerance)); const value = toHex(trade.inputAmount); function toHex(currencyAmount) {
return `0x${currencyAmount.raw.toString(16)}`
}
@@王先生-f6c Thanks. It worked like a charm. But I got the error "Error: processing response error".
Maybe it was caused by Infura. Could you please send me the full code that work. I'm newbie and I find it difficult to identify the error :(
did you upload the node js code in your github? can't find it ;) Thanks
github.com/jklepatch/eattheblocks/tree/master/screencast/217-uniswap-v2
in javascript folder
@@EatTheBlocks are you available on twitter or telegram, I want to add a uniswap watcher to this?
This video is so good. If i want to send 0.01 eth then i will do const trade = new Trade(route, new TokenAmount(weth, '0.001000000000000000000'), TradeType.EXACT_INPUT). ?
Your video is quite nice.It will better if you can...give us code...in the description
You can checkout the github repo of eattheblocks, the code of the youtube videos is in the `screencast` folder.
I would like to learn solidity with you. I have zero experience in computer language.
Hi Misael. You can start with this free series on Solidity:
ruclips.net/video/CHLgAgWoUvo/видео.html
Then the next step, if you are committed to find a Blockchain job, is to take my course:
eattheblocks.com/6-figure-blockchain-developer/
Try to learn go, rust, python or js(typescript) at first, then go to solidity.
i trying at pancakeswap-sdk and returning this error, can you please help me?
(node:14348) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '
call' of null at Contract.
node_modules\@ether
sproject\contracts\lib\index.js:316:63)
Has anyone been able to get the reverse (swapExactTokenForETH) to work?
@EatTheBlócks thanks for the reply. I did end up figuring out my issue. I wasn't approving the transaction, so it was failing.
Hey there, we are looking for a fluent Solidity engineer to help us with one of our projects. Do you do any development privately? What is the best email to get in touch for business inquiries? If you can't if you know any other engineers that could help that would be great!
Hi! Thanks for a cool tutorial. i did exact same thing but i get an error:
UnhandledPromiseRejectionWarning: Error: resolver or addr is not configured for ENS name (argument="name", value="", code=INVALID_ARGUMENT, version=contracts/5.0.5)
same
i keep getting this error --> Error: invalid hexlify value (argument="value", value=[-1004487074,773], code=INVALID_ARGUMENT, version=bytes/5.0.5). happens even when i hexlify it or convert it to hex
Did you solve this?
@@awnihussein6590 no, however i made progress. passing in a value as a string (that is
@@dixon2233 I get this error when passing private key
@@dixon2233 I just scrolled through other questions in this video and they have an answer that I will try
@@awnihussein6590 Please post solution here or on stack overflow. Much appreciated
Where is the user wallet specified?
Hi! Did you find it? Where?
@@vrajakd I think in the wallet object. The all caps PRIVATE_KEY is a place holder not a constant
hi this is not working please add a real swap transaction
How cain i do this on BSC?
Check out Pancakeswap, it's a clone of Uniswap.
Is this the same as forking?
no its different, this is for using the Uniswap protocol, not a fork.