Crate dharitri_wasm

source ·

Re-exports§

Modules§

Macros§

  • Handy way of casting to a contract proxy trait. Would make more sense to be in dharitri-wasm-derive, but Rust “cannot export macro_rules! macros from a proc-macro crate type currently”.
  • Imports required for deriving serialization and TypeAbi.
  • Getting all imports needed for a smart contract.
  • Compact way to represent the BorrowedMutStorage type.
  • Converts usize to NonZeroUsize or returns SCError.
  • Very compact way of not allowing anyone but the owner to call a function.
  • Allows us to write Solidity style require!(<condition>, <error_msg>) and avoid if statements.
  • Compact way of returning a static error message.
  • Equivalent of the ? operator for SCResult.

Structs§

  • A pointer type that uniquely owns a heap allocation of type T.
  • A UTF-8–encoded, growable string.
  • A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Enums§

Traits§

  • Definition of the BigInt type required by the API.
  • Definition of the BigUint type required by the API. The API doesn’t care about the actual BigInt implementation. The Arwen VM provides an implementation directly in the protocol. For debugging we use a different implementation, based on Rust’s BigInt.
  • CallableContract is the means by which the debugger calls methods in the contract.
  • Interface to be used by the actual smart contract code.
  • Interface to only be used by code generated by the macros. The smart contract code doesn’t have access to these methods directly.