Expand description
Macros for near-sdk-contract-tools.
Attribute Macros§
- Smart
#[event]
macro.
Derive Macros§
- Creates a managed, lazily-loaded
Escrow
implementation for the targeted#[near(contract_state)]
struct. - Implements NEP-141, NEP-145, and NEP-148 functionality, like
#[derive(Nep141, Nep145, Nep148)]
. This is the recommended way to implement a fungible token, as it also ensures that all of the standards integrate with each other correctly. - Migrate a contract’s default struct from one schema to another.
- Adds NEP-141 fungible token core functionality to a contract. Exposes
ft_*
functions to the public blockchain, implements internal controller and receiver functionality. - Adds NEP-145 fungible token core functionality to a contract. Exposes
storage_*
functions to the public blockchain, implements internal controller functionality. - Adds NEP-148 fungible token metadata functionality to a contract. Metadata must be initialized during contract creation using
Nep148Controller::set_metadata
. - Adds NEP-171 non-fungible token core functionality to a contract. Exposes
nft_*
functions to the public blockchain, implements internal controller and receiver functionality. - Adds NEP-177 non-fungible token metadata functionality to a contract.
- Adds NEP-178 non-fungible token approvals functionality to a contract.
- Adds NEP-181 non-fungible token enumeration functionality to a contract.
- Use on a struct to emit NEP-297 event strings.
- Implements all NFT functionality at once, like
#[derive(Nep171, Nep177, Nep178, Nep181)]
. - Creates a managed, lazily-loaded
Owner
implementation for the targeted#[near(contract_state)]
struct. - Makes a contract pausable. Provides an implementation of the
Pause
trait. - Adds role-based access control. No external methods are exposed.
- Create a simple multisig component. Does not expose any functions to the blockchain. Creates implementations for
ApprovalManager
andAccountApprover
for the target contract struct. - Create an upgrade component. Does not expose any functions to the blockchain.