ODCdataobjectswith-callback

FungibleFractionsWithTransferCallbackDO

Data Object that extends the FungibleFractionsDO functionality with transfer callback handlers

This contract extends the FungibleFractionsDO contract with the ability to register and unregister transfer callback handlers that will be called after fungible fractions transfers are performed (mint, burn, transferFrom and their batch variants) NOTE: This contract does not emit register and unregister events, it is expected that the DataManager contract will emit the events for register and unregister operations

ZeroAddressHandler

error ZeroAddressHandler()

Error thrown when the handler is the zero address

HandlerAlreadyRegistered

error HandlerAlreadyRegistered()

Error thrown when handler couldn't be added.

HandlerNotRemoved

error HandlerNotRemoved()

Error thrown when handler couldn't be removed.

DpData2

Data structure for storing transfer callback handlers

Parameters

NameTypeDescription
struct DpData2 {
  mapping(uint256 => struct EnumerableSet.AddressSet) singleIdHandlers;
  struct EnumerableSet.AddressSet allIdHandlers;
}

_dispatchWrite

function _dispatchWrite(DataPoint dp, bytes4 operation, bytes data) internal virtual returns (bytes)

_registerSingleIdFungibleFractionTransferCallback

function _registerSingleIdFungibleFractionTransferCallback(DataPoint dp, uint256 id, address handler) internal virtual

Function used to register a callback for a single id token transfer

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
iduint256The id of the token
handleraddressThe handler address NOTE: The handler MUST implement the IFungibleFractionsTransferCallback interface or it will revert when the callback is called

_unregisterSingleIdFungibleFractionTransferCallback

function _unregisterSingleIdFungibleFractionTransferCallback(DataPoint dp, uint256 id, address handler) internal virtual

Function used to unregister a callback for a single id token transfer

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
iduint256The id of the token
handleraddressThe handler address

_registerAllIdFungibleFractionTransferCallback

function _registerAllIdFungibleFractionTransferCallback(DataPoint dp, address handler) internal virtual

Function used to register a callback for all id token transfers

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
handleraddressThe handler address NOTE: The handler MUST implement the IFungibleFractionsTransferCallback interface or it will revert when the callback is called

_unregisterAllIdFungibleFractionTransferCallback

function _unregisterAllIdFungibleFractionTransferCallback(DataPoint dp, address handler) internal virtual

Function used to unregister a callback for all id token transfers

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
handleraddressThe handler address

_mint

function _mint(DataPoint dp, address to, uint256 id, uint256 value) internal virtual

After minting, this function notifies the registered handlers

_batchMint

function _batchMint(DataPoint dp, address to, uint256[] ids, uint256[] values) internal virtual

After minting, this function notifies the registered handlers

_burn

function _burn(DataPoint dp, address from, uint256 id, uint256 value) internal virtual

After burn, this function notifies the registered handlers

_batchBurn

function _batchBurn(DataPoint dp, address from, uint256[] ids, uint256[] values) internal virtual

After burn, this function notifies the registered handlers

_transferFrom

function _transferFrom(DataPoint dp, address from, address to, uint256 id, uint256 value) internal

After transfer, this function notifies the registered handlers

_batchTransferFrom

function _batchTransferFrom(DataPoint dp, address from, address to, uint256[] ids, uint256[] values) internal virtual

After batch transfer, this function notifies the registered handlers

_dpData2

function _dpData2(DataPoint dp) internal returns (struct FungibleFractionsWithTransferCallbackDO.DpData2)