Deposits
Last updated
Last updated
The Verifier contract implements the interface, part of the .
To deposit tokens into the Verifier contract, users must call the function ft_transfer_call
(see the function signature ) on the token, with an msg
parameter specifying information about the user, whose account will be assigned as the owner of the tokens.
msg
parameter to assign ownership of tokens inside the Verifier contractThe msg
parameter must follow a specific format to ensure proper token deposit within the contract. The msg
parameter supports three formats:
It can be empty, with size 0 bytes, which will assign ownership to the sender of the transaction (i.e., the predecessor in NEAR terminology)
A simple string that contains an account id, for example alice.near
A JSON object, referred to as DepositMessage
, with the following fields:
receiver_id
, a string with an account id taking ownership
execute_intents
, a list of intents to be executed, right after the deposit is complete.
refund_if_fails
, a boolean, when false
(the default), will execute the intents as a detached promise, decoupling any failure during the execution of the intents from the deposit operation.
Examples of ft_transfer_call
parametrization in JSON:
With empty msg
or non-existing msg
, granting the tokens to the sender/creator of that transaction
With an msg
that explicitly assigns ownership to another account:
With an msg
that is a DepositMessage
object
or
Note: msg is always a string—even when it contains a JSON-encoded object. Proper character escaping is required.
To transfer NFTs to the Verifier
, use nft_transfer_call
, following the same msg
format rules as for fungible tokens. The msg
parameter dictates how ownership of the transferred tokens will be assigned.
The Verifier contract implements the interface. This is standard.