Use Mainnet Fork to Swap Tokens on Uniswap with Code | Ethereum, EthersJS, Hardhat

Поділитися
Вставка
  • Опубліковано 8 лют 2025
  • Get my free EthersJS cheatsheet to master Web3!
    👉 blockman-codes...
    ------------------------------------------
    Courses:
    👉 Build a Uniswap V3 interface that can do swaps: bit.ly/3JkXYqL
    ------------------------------------------
    Learn to fork Ethereum mainnet with Hardhat and make swaps on Uniswap on the forked network.
    Forking mainnet with Hardhat gives us a generated wallet with generated ether that we can use to make transactions on Uniswap.
    These transactions will not persist.
    So it can be very useful for testing code when the price of test ether on networks like Goerli are too high.
    ------------------------------------------
    Code:
    gist.github.co...

КОМЕНТАРІ • 22

  • @blockmancodes
    @blockmancodes  Рік тому

    Learn to use all of Uniswap's swap and liquidity functionality with code. bit.ly/3JkXYqL

  • @elfridawestgate
    @elfridawestgate 4 місяці тому

    Thanks for the breakdown! I have a quick question: My OKX wallet holds some USDT, and I have the seed phrase. (air carpet target dish off jeans toilet sweet piano spoil fruit essay). How can I transfer them to Binance?

  • @harsh_pathak27
    @harsh_pathak27 Рік тому +2

    The RPC URL you have entered returned a different chain ID (31337). Please update the Chain ID to match the RPC URL of the network you are trying to add. error in Metamask Add network

  • @QuillénWhitset
    @QuillénWhitset 4 місяці тому

    Excellent analysis, thanks! 👌 Just a small off-topic question: 😅 I found these words 😅. (behave today finger ski upon boy assault summer exhaust beauty stereo over). How do I use this? 🤨

  • @amirnaderi-qe4qm
    @amirnaderi-qe4qm 5 місяців тому

    Hi can you explain how can we send transaction soon as swaped confirmed

  • @tonkihonks3430
    @tonkihonks3430 Рік тому

    Can you create some content on how to automate the action of Dollarizing a liquidity pool from a CRYPTO/STABLE pair as soon as and the lowest price range is met on Uniswap v3?
    That way we would avoid greater impermanent loss

  • @joondoe3387
    @joondoe3387 Рік тому

    Really enjoyed watching it. Thanks

  • @RobertReeds-c9m
    @RobertReeds-c9m Рік тому +1

    ❤🔥

  • @damienalves4234
    @damienalves4234 Рік тому

    Thanks for the video, and if I want use polygon ? how can I do it ?

    • @blockmancodes
      @blockmancodes  Рік тому

      I haven't tested but you can trying modifying the hardhat configuration to use Polygon

  • @ihrahat
    @ihrahat Рік тому

    Can you please make a video, How we can clone the uniswap interface and make swaps available with connecting liquidity

    • @blockmancodes
      @blockmancodes  Рік тому +1

      Thanks for watching! That's the topic of my Uniswap course :)

    • @ihrahat
      @ihrahat Рік тому

      @@blockmancodes Ok I need 3 answers before I enroll.
      1. Is there will be full swap functions with uniswap's liquidity ?
      2. Did you show how to interect with the uniswap interface ?
      3. How long is the course ?
      Please answer

  • @sbjj5076
    @sbjj5076 Рік тому

    Thank you!

  • @G-ZAFF
    @G-ZAFF Рік тому

    Bro you the best

  • @iamgadgetboy
    @iamgadgetboy Рік тому

    Mr Blocky i'm getting an error with the hardhat node coming up with a random address when running the code any idea what it could be? this is the error from the node side...
    eth_call
    WARNING: Calling an account which is not a contract
    From: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
    To: 0x8464135c8f25da09e49bc8782676a84730c318bc
    The meta mask address is loaded with eth from the hardhat node and is sending the eth but on my other terminal when i run it errors out on the second terminal---reason: 'invalid address or ENS name',
    code: 'INVALID_ARGUMENT',
    argument: 'name',
    value: undefined
    Thank you for your time