Skip to main content

Signature

IB20.sol

Description

Transfers amount from msg.sender to to. Emits Transfer.

Parameters

Returns

Always true on success.

Reverts

  • ContractPaused(TRANSFER) when TRANSFER is paused.
  • InvalidReceiver when to == address(0) or to == address(this).
  • InvalidSender when msg.sender == address(0).
  • PolicyForbids(TRANSFER_SENDER_POLICY, ...) when msg.sender is not authorized.
  • PolicyForbids(TRANSFER_RECEIVER_POLICY, ...) when to is not authorized.
  • InsufficientBalance when msg.sender’s balance is below amount.
Sending to the token’s own address (to == address(this)) now reverts with InvalidReceiver. A B20 token is a precompile with no holder key, so a balance credited there would be unrecoverable.

Access Control

Read-only or ERC-20-standard access rules unless the NatSpec states otherwise.

Policy Interaction

Checks TRANSFER_SENDER_POLICY and TRANSFER_RECEIVER_POLICY; approve and permit are not policy-gated.

Example

Usage Example