Insecure Source of Randomness | Hack Solidity (0.6)

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

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

  • @smartcontractprogrammer
    @smartcontractprogrammer  4 года назад +4

    Vulnerability 0:23
    Vulnerable smart contract 0:52
    Code for exploit 4:32
    Demo setup 6:12
    Demo 7:17

  • @0x_minato4thh
    @0x_minato4thh 10 месяцев назад +1

    whenever i have interviews i always come to your channel to revise.....best one for advanced topics...great job 👍👍

  • @simplatory802
    @simplatory802 2 года назад +2

    Hey, I really like your content. I did read through the comments and didn't understand your reasoning for why we don't have the current block number. So, I tried it in Remix and it works.

  • @raunaquepatra3966
    @raunaquepatra3966 2 года назад

    This Chanel so underrated, bet It will blow up in 1 - 2 yrs

  • @kowsikgelli7257
    @kowsikgelli7257 4 года назад +3

    Thanks for this Unique Content : )

  • @MrAshay12
    @MrAshay12 2 года назад +2

    you said can't calculate blockhash for current block, then how can you have block.timestamp as well? shouldnt it be (block-1).timestamp

  • @salem232
    @salem232 4 года назад +3

    That’s pretty crazy to see the hack of a random number ~~ thanks for the 🙏 good video !!!

  • @yugabro
    @yugabro 3 года назад

    Thanks keep up the good work 😊 Amazing video

  • @shivangsaini3940
    @shivangsaini3940 2 года назад +1

    WholeSome Content

  • @sauravverma6179
    @sauravverma6179 4 года назад +3

    Dont they have different block number? If you are deploying it at different instances of time, they must be included in different blocks of Local Blockchain.
    How is this possible?

    • @smartcontractprogrammer
      @smartcontractprogrammer  4 года назад +6

      They are deployed at different times. But the block at which the two functions (attack and guess) are called are on the same block. blockhash, block.number and block.timestamp are values when those functions are called, not when the contract was deployed

    • @sauravverma6179
      @sauravverma6179 4 года назад +1

      @@smartcontractprogrammer thanks for the awesome video and taking the time to answer my question. Thank you.

  • @braigetori
    @braigetori 2 года назад

    you are god's gift to smart contract teaching. thank you !

  • @황원태-j8f
    @황원태-j8f 2 года назад

    I really like it

  • @福瑞黃
    @福瑞黃 2 года назад

    I understand that we don't know the block number when the the function is called and executing, but we should not know the block.timestamp with the same reason? ! Please advise, thanks!

  • @SaintsUp1
    @SaintsUp1 3 года назад +1

    hey question for tokens that have random Lottery winners / Is it really random or can it be manipulated ???
    if the same wallets win multiple times for random draws ?

    • @smartcontractprogrammer
      @smartcontractprogrammer  3 года назад +1

      hard to tell without looking at the code

    • @SaintsUp1
      @SaintsUp1 3 года назад +1

      @@smartcontractprogrammer 0x9c9d4302a1a550b446401e56000f76bc761c3a33 that's the token contract

    • @smartcontractprogrammer
      @smartcontractprogrammer  3 года назад +1

      @@SaintsUp1 that's not a contract, probably a scam

  • @sdfsfsfd437
    @sdfsfsfd437 4 года назад

    Muchas gracias por estos videos. Muy buenos. Many thanks for all your videos!

  • @aromax504
    @aromax504 2 года назад

    It took me a while to get this. Even though they are deployed in different blocks the function call execution will always happen at same block

  • @2das
    @2das 3 года назад +2

    Nice try, but attacker just bit himself in the finger because he forgot to add a withdrawal function - now the jackpot is locked forever 😂

  • @batatacity2288
    @batatacity2288 2 года назад

    how to fix ?

  • @raunaquepatra3966
    @raunaquepatra3966 2 года назад +1

    This Chanel so underrated, bet It will blow up in 1 - 2 yrs