Skip to main content
Version: v1.4

ISCAccounts

ISCAccounts

Functions of the ISC Magic Contract to access the core accounts functionality

getL2BalanceBaseTokens

function getL2BalanceBaseTokens(struct ISCAgentID agentID) external view returns (uint64)

This function retrieves the balance of L2 base tokens for a given account.

Parameters

NameTypeDescription
agentIDstruct ISCAgentIDThe ID of the agent (account) whose balance is to be retrieved

Return Values

NameTypeDescription
[0]uint64The L2 base tokens balance of the specified account

getL2BalanceNativeTokens

function getL2BalanceNativeTokens(struct NativeTokenID id, struct ISCAgentID agentID) external view returns (uint256)

This function retrieves the balance of L2 native tokens for a given account.

Parameters

NameTypeDescription
idstruct NativeTokenIDThe ID of the native token
agentIDstruct ISCAgentIDThe ID of the agent (account) whose balance is to be retrieved

Return Values

NameTypeDescription
[0]uint256The L2 native tokens balance of the specified account

getL2NFTs

function getL2NFTs(struct ISCAgentID agentID) external view returns (NFTID[])

This function retrieves the IDs of NFTs owned by a given account.

Parameters

NameTypeDescription
agentIDstruct ISCAgentIDThe ID of the agent (account) whose NFTs are to be retrieved

Return Values

NameTypeDescription
[0]NFTID[]An array of NFTIDs representing the NFTs owned by the specified account

getL2NFTAmount

function getL2NFTAmount(struct ISCAgentID agentID) external view returns (uint256)

This function retrieves the number of NFTs owned by a given account.

Parameters

NameTypeDescription
agentIDstruct ISCAgentIDThe ID of the agent (account) whose NFT amount is to be retrieved

Return Values

NameTypeDescription
[0]uint256The amount of L2 NFTs owned by the specified account

getL2NFTsInCollection

function getL2NFTsInCollection(struct ISCAgentID agentID, NFTID collectionId) external view returns (NFTID[])

This function retrieves the NFTs of a specific collection owned by a given account.

Parameters

NameTypeDescription
agentIDstruct ISCAgentIDThe ID of the agent (account) whose NFTs are to be retrieved
collectionIdNFTIDThe ID of the NFT collection

Return Values

NameTypeDescription
[0]NFTID[]An array of NFTIDs representing the NFTs in the specified collection owned by the account

getL2NFTAmountInCollection

function getL2NFTAmountInCollection(struct ISCAgentID agentID, NFTID collectionId) external view returns (uint256)

This function retrieves the number of NFTs in a specific collection owned by a given account.

Parameters

NameTypeDescription
agentIDstruct ISCAgentIDThe ID of the agent (account) whose NFT amount is to be retrieved
collectionIdNFTIDThe ID of the NFT collection

Return Values

NameTypeDescription
[0]uint256The amount of L2 NFTs in the specified collection owned by the account

foundryCreateNew

function foundryCreateNew(struct NativeTokenScheme tokenScheme, struct ISCAssets allowance) external returns (uint32)

This function allows the creation of a new foundry with a specified token scheme and asset allowance.

Parameters

NameTypeDescription
tokenSchemestruct NativeTokenSchemeThe token scheme for the new foundry
allowancestruct ISCAssetsThe assets to be allowed for the foundry creation

Return Values

NameTypeDescription
[0]uint32The serial number of the newly created foundry

createNativeTokenFoundry

function createNativeTokenFoundry(string tokenName, string tokenSymbol, uint8 tokenDecimals, struct NativeTokenScheme tokenScheme, struct ISCAssets allowance) external returns (uint32)

This function allows the creation of a new native token foundry along with its IRC30 metadata and ERC20 token registration.

Parameters

NameTypeDescription
tokenNamestringThe name of the new token
tokenSymbolstringThe symbol of the new token
tokenDecimalsuint8The number of decimals for the new token
tokenSchemestruct NativeTokenSchemeThe token scheme for the new foundry
allowancestruct ISCAssetsThe assets to be allowed for the foundry creation

Return Values

NameTypeDescription
[0]uint32The serial number of the newly created foundry

mintNativeTokens

function mintNativeTokens(uint32 foundrySN, uint256 amount, struct ISCAssets allowance) external

This function allows the owner of a foundry to mint new native tokens.

Parameters

NameTypeDescription
foundrySNuint32The serial number of the foundry
amountuint256The amount of tokens to mint
allowancestruct ISCAssetsThe assets to be allowed for the minting process

__iscAccounts

contract ISCAccounts __iscAccounts