Contract calls (#19)

This commit is contained in:
Cyrill Leutwiler
2024-06-01 20:48:20 +02:00
committed by GitHub
parent 532721f3be
commit 1ba806be1f
27 changed files with 540 additions and 929 deletions
@@ -1,57 +1,68 @@
//! Runtime API import and export symbols.
/// The contract deploy export.
pub static CALL: &str = "call";
pub mod exports {
/// The contract deploy export.
pub static CALL: &str = "call";
/// The contract call export.
pub static DEPLOY: &str = "deploy";
/// The contract call export.
pub static DEPLOY: &str = "deploy";
/// All exported symbols.
/// Useful for configuring common attributes and linkage.
pub static EXPORTS: [&str; 2] = [CALL, DEPLOY];
/// All exported symbols.
/// Useful for configuring common attributes and linkage.
pub static EXPORTS: [&str; 2] = [CALL, DEPLOY];
}
pub static ADDRESS: &str = "address";
pub mod imports {
pub static ADDRESS: &str = "address";
pub static BLOCK_NUMBER: &str = "block_number";
pub static BLOCK_NUMBER: &str = "block_number";
pub static CALLER: &str = "caller";
pub static CALL: &str = "seal_call";
pub static CODE_SIZE: &str = "code_size";
pub static CALLER: &str = "caller";
pub static DEPOSIT_EVENT: &str = "deposit_event";
pub static CODE_SIZE: &str = "code_size";
pub static GET_STORAGE: &str = "get_storage";
pub static DEPOSIT_EVENT: &str = "deposit_event";
pub static HASH_KECCAK_256: &str = "hash_keccak_256";
pub static GET_STORAGE: &str = "get_storage";
pub static INPUT: &str = "input";
pub static HASH_KECCAK_256: &str = "hash_keccak_256";
pub static INSTANTIATE: &str = "instantiate";
pub static INPUT: &str = "input";
pub static NOW: &str = "now";
pub static INSTANTIATE: &str = "instantiate";
pub static RETURN: &str = "seal_return";
pub static NOW: &str = "now";
pub static SET_STORAGE: &str = "set_storage";
pub static RETURN: &str = "seal_return";
pub static VALUE_TRANSFERRED: &str = "value_transferred";
pub static RETURNDATACOPY: &str = "returndatacopy";
/// All imported runtime API symbols..
/// Useful for configuring common attributes and linkage.
pub static IMPORTS: [&str; 12] = [
ADDRESS,
BLOCK_NUMBER,
CALLER,
DEPOSIT_EVENT,
GET_STORAGE,
HASH_KECCAK_256,
INPUT,
INSTANTIATE,
NOW,
RETURN,
SET_STORAGE,
VALUE_TRANSFERRED,
];
pub static SET_STORAGE: &str = "set_storage";
pub static VALUE_TRANSFERRED: &str = "value_transferred";
/// All imported runtime API symbols.
/// Useful for configuring common attributes and linkage.
pub static IMPORTS: [&str; 15] = [
ADDRESS,
BLOCK_NUMBER,
CALL,
CALLER,
CODE_SIZE,
DEPOSIT_EVENT,
GET_STORAGE,
HASH_KECCAK_256,
INPUT,
INSTANTIATE,
NOW,
RETURN,
RETURNDATACOPY,
SET_STORAGE,
VALUE_TRANSFERRED,
];
}
/// PolkaVM __sbrk API symbol to extend the heap memory.
pub static SBRK: &str = "__sbrk";