ODCinterfacesdataobject-interfaces

IFungibleFractionsOperations

Provides the operations of the FungibleFractionsDO to interact with fungible fractions tokens and their associated data

balanceOf

function balanceOf(address account, uint256 id) external view returns (uint256)

Operation used to get the balance of an account

Parameters

NameTypeDescription
accountaddressThe account address
iduint256The id of the token

Return Values

NameTypeDescription
[0]uint256The balance of the account

balanceOfBatch

function balanceOfBatch(address account, uint256[] ids) external view returns (uint256[])

Operation used to get the balance of an account

Parameters

NameTypeDescription
accountaddressThe account address
idsuint256[]The ids of the tokens

Return Values

NameTypeDescription
[0]uint256[]The balance of the account

balanceOfBatchAccounts

function balanceOfBatchAccounts(address[] accounts, uint256[] ids) external view returns (uint256[])

Operation used to get the balance of multiple accounts

Parameters

NameTypeDescription
accountsaddress[]The account addresses
idsuint256[]The ids of the tokens

Return Values

NameTypeDescription
[0]uint256[]The balance of the accounts

totalSupply

function totalSupply(uint256 id) external view returns (uint256)

Operation used to get the total supply of a token

Parameters

NameTypeDescription
iduint256The id of the token

Return Values

NameTypeDescription
[0]uint256The total supply of the token

totalSupplyAll

function totalSupplyAll() external view returns (uint256)

Operation used to get the total supply of all ids tokens

Return Values

NameTypeDescription
[0]uint256The total supply of all ids tokens

exists

function exists(uint256 id) external view returns (bool)

Operation used to check if an id exists

Parameters

NameTypeDescription
iduint256The id of the token

Return Values

NameTypeDescription
[0]boolTrue if the id exists, false otherwise

transferFrom

function transferFrom(address from, address to, uint256 id, uint256 value) external

Operation used to transfer tokens from one account to another

Parameters

NameTypeDescription
fromaddressThe account to transfer from
toaddressThe account to transfer to
iduint256The id of the token
valueuint256The amount of tokens to transfer

batchTransferFrom

function batchTransferFrom(address from, address to, uint256[] ids, uint256[] values) external

Operation used to transfer tokens from one account to another

Parameters

NameTypeDescription
fromaddressThe account to transfer from
toaddressThe account to transfer to
idsuint256[]The ids of the tokens
valuesuint256[]The amounts of tokens to transfer

mint

function mint(address to, uint256 id, uint256 value) external

Operation used to mint tokens

Parameters

NameTypeDescription
toaddressThe account to mint to
iduint256The id of the token
valueuint256The amount of tokens to mint

burn

function burn(address from, uint256 id, uint256 value) external

Operation used to burn tokens

Parameters

NameTypeDescription
fromaddressThe account to burn from
iduint256The id of the token
valueuint256The amount of tokens to burn

batchMint

function batchMint(address to, uint256[] ids, uint256[] values) external

Operation used to mint tokens

Parameters

NameTypeDescription
toaddressThe account to mint to
idsuint256[]The ids of the tokens
valuesuint256[]The amounts of tokens to mint

batchBurn

function batchBurn(address from, uint256[] ids, uint256[] values) external

Operation used to burn tokens

Parameters

NameTypeDescription
fromaddressThe account to burn from
idsuint256[]The ids of the tokens
valuesuint256[]The amounts of tokens to burn