Skip to main content

Module nep_macros

Module nep_macros 

Source
Expand description

NEP standard-library macros (L5).

These declarative macros were intended to emit the canonical NEP method surface + Transfer event for a standard in one invocation.

§Status: unavailable on the current wasm32 export ABI

A compliant NEP-17 / NEP-11 contract needs string method returns (symbol, name) and Hash160 (ByteString) account/token-id parameters. The #[neo_method] auto-export wrappers currently marshal scalar integer/boolean types only across the wasm32 → NeoVM boundary, so these macros cannot generate a working, standards-compliant contract yet.

Before v0.13.2 the macros emitted those signatures but the export collector silently dropped every method (it matched the #[neo_method] attribute by bare ident and missed the macro-emitted qualified #[$crate::neo_method] form), so contracts built with them deployed with no callable methods. As of v0.13.2 the attribute matching is fixed and the macros fail to compile with actionable guidance instead of producing a silently-broken contract.

§What to do instead

Write the contract by hand with #[neo_contract] + #[neo_method] using integer account ids — the same pattern every working example in this repo uses. See contracts/nep17-token and contracts/nep11-nft for complete, exported, callable token contracts.