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
Name | Type | Description |
---|---|---|
agentID | struct ISCAgentID | The ID of the agent (account) whose balance is to be retrieved |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint64 | The 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
Name | Type | Description |
---|---|---|
id | struct NativeTokenID | The ID of the native token |
agentID | struct ISCAgentID | The ID of the agent (account) whose balance is to be retrieved |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The 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
Name | Type | Description |
---|---|---|
agentID | struct ISCAgentID | The ID of the agent (account) whose NFTs are to be retrieved |
Return Values
Name | Type | Description |
---|---|---|
[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
Name | Type | Description |
---|---|---|
agentID | struct ISCAgentID | The ID of the agent (account) whose NFT amount is to be retrieved |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The 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
Name | Type | Description |
---|---|---|
agentID | struct ISCAgentID | The ID of the agent (account) whose NFTs are to be retrieved |
collectionId | NFTID | The ID of the NFT collection |
Return Values
Name | Type | Description |
---|---|---|
[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
Name | Type | Description |
---|---|---|
agentID | struct ISCAgentID | The ID of the agent (account) whose NFT amount is to be retrieved |
collectionId | NFTID | The ID of the NFT collection |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The 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
Name | Type | Description |
---|---|---|
tokenScheme | struct NativeTokenScheme | The token scheme for the new foundry |
allowance | struct ISCAssets | The assets to be allowed for the foundry creation |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint32 | The 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
Name | Type | Description |
---|---|---|
tokenName | string | The name of the new token |
tokenSymbol | string | The symbol of the new token |
tokenDecimals | uint8 | The number of decimals for the new token |
tokenScheme | struct NativeTokenScheme | The token scheme for the new foundry |
allowance | struct ISCAssets | The assets to be allowed for the foundry creation |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint32 | The 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
Name | Type | Description |
---|---|---|
foundrySN | uint32 | The serial number of the foundry |
amount | uint256 | The amount of tokens to mint |
allowance | struct ISCAssets | The assets to be allowed for the minting process |
__iscAccounts
contract ISCAccounts __iscAccounts