implement the blockhash opcode (#114)

This commit is contained in:
Cyrill Leutwiler
2024-11-15 13:11:04 +01:00
committed by GitHub
parent c9dd347755
commit 6a120463c2
6 changed files with 62 additions and 12 deletions
+2
View File
@@ -70,6 +70,8 @@ POLKAVM_IMPORT(void, balance, uint32_t)
POLKAVM_IMPORT(void, balance_of, uint32_t, uint32_t)
POLKAVM_IMPORT(void, block_hash, uint32_t, uint32_t)
POLKAVM_IMPORT(void, block_number, uint32_t)
POLKAVM_IMPORT(uint32_t, call, uint32_t)
+4 -1
View File
@@ -20,6 +20,8 @@ pub static BALANCE: &str = "balance";
pub static BALANCE_OF: &str = "balance_of";
pub static BLOCK_HASH: &str = "block_hash";
pub static BLOCK_NUMBER: &str = "block_number";
pub static CALL: &str = "call";
@@ -62,12 +64,13 @@ pub static VALUE_TRANSFERRED: &str = "value_transferred";
/// All imported runtime API symbols.
/// Useful for configuring common attributes and linkage.
pub static IMPORTS: [&str; 25] = [
pub static IMPORTS: [&str; 26] = [
SBRK,
MEMORY_SIZE,
ADDRESS,
BALANCE,
BALANCE_OF,
BLOCK_HASH,
BLOCK_NUMBER,
CALL,
CALLER,