Crate ink_macro

Source

Macros§

blake2x256
Computes and expands into the BLAKE2b 256-bit hash of the string input.
selector_bytes
Computes the ink! selector of the string and expands into its byte representation.
selector_id
Computes the ink! selector of the string and expands into its u32 representation.

Attribute Macros§

contract
Entry point for writing ink! smart contracts.
contract_ref
Defines the interface of a “callee” contract and generates a wrapper type which can be used for interacting with the contract.
error
Implements the necessary traits for ABI encoding/decoding this type as revert error data.
event
Implements the necessary traits for a struct to be emitted as an event from a contract.
scale_derive
Derive the re-exported traits ink::scale::Encode, ink::scale::Decode and ink::scale_info::TypeInfo. It enables using the built in derive macros for these traits without depending directly on the parity-scale-codec and scale-info crates.
storage_item
Prepares the type to be fully compatible and usable with the storage. It implements all necessary traits and calculates the storage key for types. Packed types don’t have a storage key, but non-packed types (like Mapping, Lazy etc.) require calculating the storage key during compilation.
test
Defines a unit test that makes use of ink!’s off-chain testing capabilities.
trait_definition
Marks trait definitions to ink! as special ink! trait definitions.

Derive Macros§

Event
Derives an implementation of the [ink::Event] trait for the given struct.
EventMetadata
Derives the [ink::EventMetadata] trait for the given struct, which provides metadata about the event definition.
SolDecode
Derives an implementation of ink::SolDecode for the given struct or enum.
SolEncode
Derives an implementation of ink::SolEncode for the given struct or enum.
SolErrorDecode
Derives an implementation of ink::sol::SolErrorDecode for the given struct or enum.
SolErrorEncode
Derives an implementation of ink::sol::SolErrorEncode for the given struct or enum.
SolErrorMetadata
Derives an implementation of ink::metadata::sol::SolErrorMetadata for the given struct or enum.
Storable
Derives ink::storage’s Storable trait for the given struct, enum or union.
StorableHint
Derives ink::storage’s StorableHint trait for the given struct or enum.
StorageKey
Derives ink::storage’s StorageKey trait for the given struct or enum.
StorageLayout
Derives ink::storage’s StorageLayout trait for the given struct or enum.