Skip to main content

Crate thruput_contract_util

Crate thruput_contract_util 

Source
Expand description

Naming and hashing rules shared by thruput-macros and host tooling: entrypoint and interface IDs, exception selectors, event signatures and export names, and contract version handling (semver).

remote holds the runtime side of the off-chain proxies that thruput-sdk’s remote feature generates.

Modules§

remote
Invoking a deployed contract from off-chain code.
semver

Structs§

EntrypointSignature
NormalizedMethodSignature
Standard signature for a contract method.

Constants§

UNNAMED_INTERFACE
The interface name used when a free function has no explicit interface = "..." override.

Functions§

contract_entrypoint_id
Derive a standard entrypoint ID for a contract method. The interface name is a domain separator.
entrypoint_export_name
entrypoint_export_name_for
The export symbol name of the entrypoint for the given (interface, version, method) triple: contract_entrypoint_id rendered through entrypoint_export_name. Use this instead of composing the two by hand so that every caller stays in sync if the ID preimage ever changes (for example, if a signature checksum is added to it).
entrypoint_link_name
Human-readable symbol name carrying the entrypoint-ID preimage, used as the rv32 wrapper’s export_name so a duplicate entrypoint ID fails the build with an error naming the interface and method (rather than a bare 16-hex ID). Built from the same (interface, MAJOR version, method signature) triple as contract_entrypoint_id, so link-name equality coincides exactly with entrypoint-ID equality. Symbol names never reach the lowered rv32 image (they live in non-allocatable ELF sections), so readability costs nothing in the deployed artifact.
event_signature
Derive a standard event signature for a contract event type.
exception_selector
Derive a standard exception selector for a contract exception type.
exception_selector_from_major
exception_selector with the major version already derived (the exact preimage component, e.g. "1" or "0.9" — not a full semver string).
interface_id
Derive the interface ID of an (interface name, version) pair: the identity of an interface at a major version, shared by every entrypoint the interface exports.