When a call fails, the engine panics and nothing in the call changes: no balances, no storage. Deposits with *_transfer_call are refunded by the token contract. Operations after an OracleRequest run in a later receipt, so they fail on their own, see Oracles. The message is in the receipt’s failure, after Smart contract panicked: . Many messages come after a source location and a line break, like panicked at src/lib.rs:491:18:, and some have details after them, so match the messages below as substrings.
<asset> is an asset ID, <owner> is Account(<account id>) or Dex(<dex id>).
| Message |
Cause |
Contract is paused |
The contract is paused. Try again later |
Requires attached deposit of exactly 1 yoctoNEAR |
The method needs exactly 1 yoctoNEAR attached |
Deposit of at least one yoctoNEAR is required. |
execute_operations was called without a deposit |
Failed to deserialize input from JSON. Error: <error> |
Malformed arguments, for example an asset ID without its nep141: prefix (Invalid asset id: ...), a DEX ID without / (Invalid dex id: ...), or a missing required argument |
| Message |
Cause |
Asset <asset> is not registered for <owner> |
The owner would receive or spend an asset that isn’t registered for them |
Failed to deposit assets to contract tracked balance: asset not registered |
Nobody ever registered this asset. Register it for yourself |
Insufficient balance for <owner> and asset <asset>: <balance> < <amount> |
Not enough in your inner balance |
Insufficient balance of <asset> for <owner>: <balance> < <amount> |
Not enough in your inner balance for the attached_assets of a DEX call |
Balance not found for <owner> and asset <asset> |
An asset in the attached_assets of a DEX call isn’t registered for you |
Not enough balance for withdraw <asset>: <balance> < <at_least>, Not enough balance for withdrawal of <asset>: <balance> < <at_least> |
A Full withdrawal with a balance lower than at_least. The second one is a Withdraw in a deposit message |
Invalid input array lengths |
A multi token contract called mt_on_transfer with arrays of different lengths |
account_id and dex_id are mutually exclusive |
registered_assets_of needs exactly one of them |
No assets to register |
register_assets or a RegisterAssets operation with an empty asset_ids |
| Message |
Cause |
Output amount is less than constraint |
An ExactIn swap would give less than constraint. The price moved: get a new quote |
Input amount is greater than constraint |
An ExactOut swap would cost more than constraint, referral fees included |
At most 5 referrers are allowed |
More than 5 accounts in referral_fees |
Referral fees must add up to at most 50000 |
The referral_fees add up to more than 5% |
Insufficient balance for <owner> and asset <asset>: <balance> < <amount>, with a Dex owner |
The DEX doesn’t hold enough asset_out |
Amount in does not match, Amount out does not match |
The DEX returned a different exact amount than requested. A bug in the DEX |
Dex code not found |
No DEX with this ID |
At least one swap option is required |
A SwapAdvanced with an empty options |
All swap options failed |
Every option of a SwapAdvanced failed, or, with FallbackQueue, didn’t meet the constraint. The receipt logs why each was skipped |
| Message |
Cause |
Failed to call function '<method>': [<dex id>] Dex panicked: <message> |
The DEX refused the swap or call. It comes after Running wasm failed: . <method> is swap for swaps. <message> comes from the DEX, which can also panic without one. A message raised with a Rust panic!, like Plach’s Invalid message, starts with panicked at <file>:<line>:<col>: and a line break. One raised with env::panic_str, like Plach’s No routes, has no prefix |
Failed to get function '<method>' |
The DEX has no such method. It comes after Running wasm failed: |
Failed to instantiate module: <error> |
The DEX imports a host function the engine doesn’t have, like attached_deposit or log_utf8. It comes after Running wasm failed: |
Failed to load the code of <dex id>, which translate_dex_codes translates again: <error> |
The engine was upgraded to a WebAssembly interpreter that doesn’t run the stored translation of the DEX’s code. Call translate_dex_codes for it |
Method name 'swap' is reserved for the swap operation |
dex_call and dex_view can’t call swap. Use swap_simple |
Cannot modify data in view-only mode |
The DEX tried to change its storage in dex_view. It comes after Running wasm failed: Failed to call function '<method>': |
| Message |
Cause |
Failed to parse operations |
msg of a deposit isn’t a valid DepositMessage |
Operation only available in execute_actions |
RegisterAssets in a deposit message |
Sandboxed assets must be empty after execution. Did you forget to withdraw <amount> <asset>? |
Operations in a deposit didn’t use up everything. Add a Withdraw or TransferAsset for the rest |
Asset in not found in anonymous assets, Asset to withdraw not found in anonymous assets, Asset to transfer not found in anonymous assets |
An operation in a deposit uses an asset that wasn’t deposited and isn’t the output of an earlier swap |
Not enough balance in anonymous assets, Not enough input balance in anonymous assets |
An operation in a deposit uses more than what’s left. The second one is a swap whose input is more than what’s left, for example an ExactOut swap that needs more than was deposited |
No rescue address provided and user doesn't have a registered balance for this asset |
A Withdraw in a deposit needs the sender or rescue_address to have the asset registered. See Withdrawing from a deposit |
Asset <asset> was not attached, while specified that it was attached, Not enough balance for attached deposit of <asset> |
A DexCall in a deposit attaches an asset that wasn’t deposited, or more than what’s left |
Near balance not found in anonymous assets, Not enough near balance in anonymous assets |
A StorageDeposit in a deposit uses NEAR that wasn’t deposited, or more than what’s left |
Amount is required for the first swap operation |
OutputOfLastIn without a swap before it |
Amount can only be omitted if the last swap asset out matches the current asset in |
OutputOfLastIn after a swap to a different asset |
PreviousSwapOutput can only be used after a swap, in the same operation batch |
PreviousSwapOutput without a swap before it |
PreviousSwapOutput can only be used if the last swap asset out matches the withdraw asset |
PreviousSwapOutput after a swap to a different asset |
Only the previous owner can execute operations on behalf of the previous owner |
An NFT or multi token sent with an approval, with a non-empty msg |
Operations can only follow a transfer of one token |
An mt_batch_transfer_call of several tokens with a non-empty msg |
r#for is required for StorageDeposit operation |
StorageDeposit without for |
| Message |
Cause |
Only the first operation can be an oracle request |
An OracleRequest after the first operation |
Request is more than 1024 bytes, Response is more than 1024 bytes |
The request of an OracleRequest, or a response, is too long |
Oracle <oracle key> has no fee receiver |
There’s no oracle with this key |
Oracle <oracle key> doesn't take fees in <asset> |
The asset of the fee isn’t in the oracle’s oracle_fees |
The fee of oracle <oracle key> is <fee> <asset>, not <amount> |
The fee isn’t exactly what the oracle takes in that asset. Read oracle_fees again |
The oracle's fee must be in the deposited asset, not <asset> |
In a deposit, the fee is in another asset and there’s no swap to buy it |
Deposit of <amount> <asset> is less than the oracle's fee of <fee> |
The deposit doesn’t cover the oracle’s fee |
The oracle fee swap must be from another asset than the fee's <asset> |
The asset_in of the swap is the asset of the fee |
Oracle didn't respond in time |
The oracle didn’t respond within 200 blocks. Its fee was refunded |
Operations after the oracle request failed |
The operations after the request failed once the oracle responded. The receipt of after_oracle_response has their error |
The transaction that creates an oracle key must be signed with it |
create_oracle_key signed with another key |
Attach at least <amount> for the storage of the key |
create_oracle_key with less than the storage of the key attached |
Failed to add the oracle key, Failed to remove the oracle key |
The engine’s account couldn’t add or delete the key, for example because it already exists, or because its gas balance is more than 1 NEAR |
Only the fee receiver of the oracle can set its fees |
set_oracle_fees by another account |
Only the dex's account itself can call oracle_respond |
oracle_respond that isn’t signed with an oracle’s key |
Nonce must be 32 bytes |
A nonce of oracle_respond isn’t 32 bytes. Pass the nonce of the oracle_request event as it is |
| Message |
Cause |
Fee discounts are disabled |
There’s no fee discount signer |
Invalid signature |
The signature isn’t as long as the signatures of the signer’s curve |
Fee discount signature verification failed |
The signature isn’t by the fee discount signer, or isn’t of this discount |
Fee discount is for other operations |
A ForOperations discount for other operations. Get a new quote |
Fee discount is for another trader |
trader_id isn’t the caller, or the alleged sender of a deposit |
Fee discount expired |
The discount is past its expiration_block_height. Get a new quote |
Trader fee discounts can only be used in direct calls, not in transfer calls |
A ForTrader discount in a deposit message |
Trader fee discount expires more than 1008000 blocks from now |
A ForTrader discount that expires too late |
Fee discount can't exceed 100% |
The signed fee_discount is above 1000000 |
| Message |
Cause |
Storage used (<used>) exceeds total (<total>) |
Not enough storage balance: yours for a registration or the records of your oracle, the DEX’s for its code and its translation, or for a swap or call that stores more data. Deposit more |
Deposit amount <amount> is less than the minimum bound 0.005 NEAR |
Storage deposits must be at least 0.005 NEAR |
Storage used not found |
storage_withdraw from an account without a storage balance |
Amount exceeds storage used |
storage_withdraw of more than available |
Only the deployer can withdraw dex storage |
dex_storage_withdraw by someone other than the DEX’s deployer |
not implemented: Storage unregistration is not supported |
storage_unregister isn’t supported |
Amounts in storage errors are in NEAR, rounded up, like 0.006 NEAR.
| Message |
Cause |
Only the trusted code deployer can deploy dex code |
deploy_dex_code by another account |
Only the trusted code deployer can transfer this permission |
set_trusted_code_deployer by another account |
Only authorized accounts can pause the contract |
pause or unpause by another account |
The translator didn't translate the code of <dex id>: <error> |
deploy_dex_code or translate_dex_codes with code that the translator refused. Its receipt before this one failed with Invalid dex code: <error>, for code that isn’t valid WebAssembly |
The code of <dex id> changed while it was translated |
translate_dex_codes for a DEX whose code was replaced before the translation came back |
Only <bytes> bytes of the code are stored, so a chunk can't start at byte <offset>, The code stored so far doesn't have the hash it should have |
store_code_chunk or deploy_code_chunks with a chunk that doesn’t follow the chunks before it |
Contract must be paused to rescue assets |
rescue while the contract isn’t paused |
Nothing to rescue |
rescue with nothing untracked, or an amount of 0 |