is_mint_transfer

Documentation for eth_defi.erc_4626.vault_protocol.flying_tulip.historical_context.is_mint_transfer function.

is_mint_transfer(from_topic, to_topic)

Classify a zero-address ERC-20 transfer as a supply mint or burn.

ERC-20 emits a mint with the zero address as sender and a burn with the zero address as recipient. The caller has already filtered ordinary transfers before invoking this helper.

Parameters
  • from_topic (str) – Normalised indexed ERC-20 transfer sender topic.

  • to_topic (str) – Normalised indexed ERC-20 transfer recipient topic.

Returns

True for a mint and False for a burn.

Raises

ValueError – If the transfer does not alter token supply.

Return type

bool