lane
May 8, 2024, 1:29am
8
Here’s the actual, complete set of syscalls from a production embedded blockchain VM. We may want a slightly different list but we’ll need to make sure we account for most of these.
// Copyright 2022-2023, Offchain Labs, Inc.
// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/stylus/licenses/COPYRIGHT.md
//! Raw host I/Os for low-level access to the Stylus runtime.
//!
//! This module is only available when the `hostio` feature flag is enabled, which exposes
//! low-level functions for accessing the VM directly. Most users should instead use the
//! high-level equivalents of [`block`](crate::block), [`contract`](crate::contract),
//! [`crypto`](crate::crypto), [`evm`](crate::evm), [`msg`](crate::msg), and [`tx`](crate::tx).
//!
//! ```ignore
//! use stylus_sdk::hostio;
//! use stylus_sdk::{alloy_primitives::Address, msg};
//!
//! let mut sender = Address::ZERO;
//! unsafe {
//! hostio::msg_sender(sender.as_mut_ptr());
//! }
//!
//! assert_eq!(sender, msg::sender());
This file has been truncated. show original
1 Like