Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 940 Bytes

transfer.md

File metadata and controls

42 lines (33 loc) · 940 Bytes

Transfer action

Configuration

  • detector id: transfer
  • severity: info

Description

Find all transfer actions.

This detector can help to locate all the transfer actions for both native tokens and NEP 141 tokens.

Sample code

// Promise::transfer
Promise::new(env::predecessor_account_id()).transfer(amount);
// NPE141 ft_transfer
// https://github.com/ref-finance/ref-contracts/blob/c580d8742d80033a630a393180163ab70f9f3c94/ref-exchange/src/account_deposit.rs#L446
ext_fungible_token::ft_transfer(
    sender_id.clone(),
    U128(amount),
    None,
    token_id,
    1,
    GAS_FOR_FT_TRANSFER,
)
.then(ext_self::exchange_callback_post_withdraw(
    token_id.clone(),
    sender_id.clone(),
    U128(amount),
    &env::current_account_id(),
    0,
    GAS_FOR_RESOLVE_TRANSFER,
))

In these samples, both the native token transfer and the NEP 141 token transfer can be detected by Rustle.