This is the main interface of the ISC Magic Contract.
function getRequestID() external view returns (struct ISCRequestID)
Retrieves the ID of the current ISC request.
Name | Type | Description |
---|
[0] | struct ISCRequestID | The ISCRequestID of the current request. |
function getSenderAccount() external view returns (struct ISCAgentID)
Retrieves the AgentID of the account that sent the current ISC request.
Name | Type | Description |
---|
[0] | struct ISCAgentID | The ISCAgentID of the sender. |
function triggerEvent(string s) external
Triggers an event in the ISC system with the given string.
Name | Type | Description |
---|
s | string | The string to include in the event. |
function getEntropy() external view returns (bytes32)
Retrieves a random 32-bit value derived from the hash of the current ISC state transaction.
Name | Type | Description |
---|
[0] | bytes32 | A random bytes32 value. |
function allow(address target, struct ISCAssets allowance) external
Authorizes the specified target address to take the given assets from the caller's account.
Name | Type | Description |
---|
target | address | The address of the target EVM contract. |
allowance | struct ISCAssets | The assets to be allowed. |
function takeAllowedFunds(address addr, struct ISCAssets allowance) external
Takes the specified assets from the given address if they have authorized the caller. If the allowance is empty, all allowed funds are taken.
Name | Type | Description |
---|
addr | address | The address to take funds from. |
allowance | struct ISCAssets | The assets to take. |
function getAllowanceFrom(address addr) external view returns (struct ISCAssets)
Retrieves the amount of assets the specified address has allowed the caller to take.
Name | Type | Description |
---|
addr | address | The address that has allowed funds. |
Name | Type | Description |
---|
[0] | struct ISCAssets | The allowed ISCAssets. |
function getAllowanceTo(address target) external view returns (struct ISCAssets)
Retrieves the amount of assets the caller has allowed the specified address to take.
Name | Type | Description |
---|
target | address | The address allowed to take funds. |
Name | Type | Description |
---|
[0] | struct ISCAssets | The allowed ISCAssets. |
function getAllowance(address from, address to) external view returns (struct ISCAssets)
Retrieves the amount of assets allowed between the specified addresses.
Name | Type | Description |
---|
from | address | The address that has allowed funds. |
to | address | The address allowed to take funds. |
Name | Type | Description |
---|
[0] | struct ISCAssets | The allowed ISCAssets. |
function send(struct L1Address targetAddress, struct ISCAssets assets, bool adjustMinimumStorageDeposit, struct ISCSendMetadata metadata, struct ISCSendOptions sendOptions) external payable
Sends the specified assets from the caller's L2 account to a L1 address and includes the specified metadata and options. This can also be used to create on-ledger requests to the chain itself.
Name | Type | Description |
---|
targetAddress | struct L1Address | The L1 address to send the assets to. |
assets | struct ISCAssets | The assets to be sent. |
adjustMinimumStorageDeposit | bool | Whether to adjust the minimum storage deposit. |
metadata | struct ISCSendMetadata | The metadata to include in the request. |
sendOptions | struct ISCSendOptions | The options for the send operation. |
function call(ISCHname contractHname, ISCHname entryPoint, struct ISCDict params, struct ISCAssets allowance) external returns (struct ISCDict)
Calls the specified entry point of the ISC contract with the given parameters and allowance.
Name | Type | Description |
---|
contractHname | ISCHname | The hname of the contract. |
entryPoint | ISCHname | The entry point to be called. |
params | struct ISCDict | The parameters to pass to the entry point. |
allowance | struct ISCAssets | The assets to be allowed for the call. |
Name | Type | Description |
---|
[0] | struct ISCDict | The return data from the ISC contract call. |
function callView(ISCHname contractHname, ISCHname entryPoint, struct ISCDict params) external view returns (struct ISCDict)
Calls the specified view entry point of the ISC contract with the given parameters.
Name | Type | Description |
---|
contractHname | ISCHname | The hname of the contract. |
entryPoint | ISCHname | The view entry point to be called. |
params | struct ISCDict | The parameters to pass to the view entry point. |
Name | Type | Description |
---|
[0] | struct ISCDict | The return data from the ISC contract view call. |
function getChainID() external view returns (ISCChainID)
Retrieves the ChainID of the current ISC chain.
Name | Type | Description |
---|
[0] | ISCChainID | The ISCChainID of the current chain. |
function getChainOwnerID() external view returns (struct ISCAgentID)
Retrieves the AgentID of the owner of the current ISC chain.
Name | Type | Description |
---|
[0] | struct ISCAgentID | The ISCAgentID of the chain owner. |
function getTimestampUnixSeconds() external view returns (int64)
Retrieves the timestamp of the current ISC block in seconds since the UNIX epoch.
Name | Type | Description |
---|
[0] | int64 | The timestamp of the current block. |
function getBaseTokenProperties() external view returns (struct ISCTokenProperties)
Retrieves the properties of the base token used in the ISC system.
Name | Type | Description |
---|
[0] | struct ISCTokenProperties | The ISCTokenProperties of the base token. |
function getNativeTokenID(uint32 foundrySN) external view returns (struct NativeTokenID)
Retrieves the NativeTokenID of a native token based on its foundry serial number.
Name | Type | Description |
---|
foundrySN | uint32 | The serial number of the foundry. |
Name | Type | Description |
---|
[0] | struct NativeTokenID | The NativeTokenID of the specified native token. |
function getNativeTokenScheme(uint32 foundrySN) external view returns (struct NativeTokenScheme)
Retrieves the NativeTokenScheme of a native token based on its foundry serial number.
Name | Type | Description |
---|
foundrySN | uint32 | The serial number of the foundry. |
Name | Type | Description |
---|
[0] | struct NativeTokenScheme | The NativeTokenScheme of the specified native token. |
function getNFTData(NFTID id) external view returns (struct ISCNFT)
Retrieves the details of an NFT based on its ID.
Name | Type | Description |
---|
id | NFTID | The ID of the NFT. |
Name | Type | Description |
---|
[0] | struct ISCNFT | The ISCNFT data of the specified NFT. |
function getIRC27NFTData(NFTID id) external view returns (struct IRC27NFT)
Retrieves the details of an IRC27 NFT based on its ID.
Name | Type | Description |
---|
id | NFTID | The ID of the IRC27 NFT. |
Name | Type | Description |
---|
[0] | struct IRC27NFT | The IRC27NFT data of the specified NFT. Note: the metadata.uri field is encoded as a data URL with: base64(jsonEncode({ "name": NFT.name, "description": NFT.description, "image": NFT.URI })) Note: metadata does not include attributes, use getIRC27TokenURI to get those attributes off-chain in JSON form. |
function getIRC27TokenURI(NFTID id) external view returns (string)
Retrieves the URI of an IRC27 NFT based on its ID.
Name | Type | Description |
---|
id | NFTID | The ID of the IRC27 NFT. |
Name | Type | Description |
---|
[0] | string | The URI of the specified IRC27 NFT. |
function erc20NativeTokensAddress(uint32 foundrySN) external view returns (address)
Retrieves the address of an ERC20NativeTokens contract based on the foundry serial number.
Name | Type | Description |
---|
foundrySN | uint32 | The serial number of the foundry. |
Name | Type | Description |
---|
[0] | address | The address of the specified ERC20NativeTokens contract. |
function erc721NFTCollectionAddress(NFTID collectionID) external view returns (address)
Retrieves the address of an ERC721NFTCollection contract based on the collection ID.
Name | Type | Description |
---|
collectionID | NFTID | The ID of the NFT collection. |
Name | Type | Description |
---|
[0] | address | The address of the specified ERC721NFTCollection contract. |
function erc20NativeTokensFoundrySerialNumber(address addr) external view returns (uint32)
Retrieves the foundry serial number from the address of an ERC20NativeTokens contract.
Name | Type | Description |
---|
addr | address | The address of the ERC20NativeTokens contract. |
Name | Type | Description |
---|
[0] | uint32 | The foundry serial number. |
function registerERC20NativeToken(uint32 foundrySN, string name, string symbol, uint8 decimals, struct ISCAssets allowance) external
Registers a new ERC20NativeTokens contract with the specified foundry and token details. Only callable by the foundry owner.
Name | Type | Description |
---|
foundrySN | uint32 | The serial number of the foundry. |
name | string | The name of the new token. |
symbol | string | The symbol of the new token. |
decimals | uint8 | The decimals of the new token. |
allowance | struct ISCAssets | The assets to be allowed for the registration. |
contract ISCSandbox __iscSandbox