This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
feat: implement 0x40 - BlockHash Opcode #149
Labels
enhancement
New feature or request
opcode
Implementation of an opcode
smart-contract-logic
A specific type of opcode that requires smart contract logic as opposed to pure cairo
Milestone
Index 1 is top of the stack. See PUSH.
Stack input
blockNumber
: block number to get the hash from. Valid range is the last 256 blocks (not including the current one). Current block number can be queried with NUMBER.Stack output
hash
: hash of the chosen block, or 0 if the block number is not in the valid range.Examples
1
599423545
0x29045A592007D0C246EF02C2223570DA9522D0CF0F73282C79A1BC8F0BB2C238
Error cases
The state changes done by the current context are reverted in those cases:
The text was updated successfully, but these errors were encountered: