Bit Masking | EVM Storage 2

Поделиться
HTML-код
  • Опубликовано: 27 дек 2024

Комментарии • 8

  • @smartcontractprogrammer
    @smartcontractprogrammer  8 месяцев назад +2

    0:00 Intro
    3:13 Bit masking 16 bits of 1s
    5:53 All 0s except 16 bits of 1s in the middle
    8:03 All 1s except 16 bits of zeros in the middle
    Code
    solidity-by-example.org/evm/storage/
    Take a course
    www.smartcontract.engineer/
    Remix
    remix.ethereum.org

  • @joshuwa.jeremiah229
    @joshuwa.jeremiah229 7 месяцев назад

    I’m requesting videos regarding layer 2, I’m curious on how they interact with the EVM.

    • @smartcontractprogrammer
      @smartcontractprogrammer  7 месяцев назад +2

      It will take a while. I am still learning how Optimism works in my spare time

    • @joshuwa.jeremiah229
      @joshuwa.jeremiah229 7 месяцев назад

      @@smartcontractprogrammer alright thank you by the way for all the tutorials there not many like the ones you cover on RUclips at the moment. I’m confused because IS layer 2 like a smart contract deployed on an address? but I’ve read that it Optimism uses like a non contract address I’m not sure about the whole architecture lol.

    • @smartcontractprogrammer
      @smartcontractprogrammer  7 месяцев назад

      For Optimism, it's a mix of
      - L1 contracts deployed on ETH mainnet
      - L2 contracts deployed on OP
      - other softwares, such as op- node (a modified ETH node that run L2 transactions)
      Send ETH from L1 to L2
      1. Call OptimismPortal on L1. ETH is sent here and locked until withdrawal is initiated and finalized. It also emits a special event that the op-node monitors.
      2. This event signals op-node to execute a transaction on L2
      3. Transaction is executed on L2, ETH (minted on L2 by op-node) is allocated to msg.sender from step 1
      All transactions on L2 are compressed and submitted to an EOA on L1.
      This EOA is referred to as "batch inbox".
      Address of EOA on mainnet is this 0xFF00000000000000000000000000000000000010
      L2 state roots are written to a smart contract on L1, named L2OutputOracle.
      With the transactions in batch inbox, and state roots in L2OutputOracle, anyone should be able to reconstruct L2 states
      and prove that their transaction on L2 exists.
      Send ETH from L2 to L1
      1. Call L2CrossDomainMessenger on L2
      2. This transaction is stored into a contract called L2ToL1MessagePasser on L2
      3. Using info from batch inbox and L2OutputOracle, send a transcation to OptimismPortal on L1 that proves transaction from step 1.
      4. Wait 7 days challenge period
      5. Finanlize the transaction from step 3. ETH which was locked is released and sent backed to you.

  • @ferlast6762
    @ferlast6762 8 месяцев назад

    is their a gob in this field

  • @codeWithBala
    @codeWithBala 8 месяцев назад

    Whether the bitmask is used to write and read the packed variables?