Introduction
This section documents the magic contract and all it's interfaces:
📄️ Introduction
This section documents the magic contract and all it's interfaces:
📄️ ERC20BaseTokens
The ERC20 contract directly mapped to the L1 base token.
📄️ ERC20ExternalNativeTokens
The ERC20 contract for externally registered native tokens (off-chain foundry).
📄️ ERC20NativeTokens
The ERC20 contract native tokens (on-chain foundry).
📄️ ERC721NFTCollection
The ERC721 contract for a L2 collection of ISC NFTs, as defined in IRC27. Implements the ERC721 standard and extends the ERC721NFTs contract. For more information about IRC27, refer to: https://github.com/iotaledger/tips/blob/main/tips/TIP-0027/tip-0027.md
📄️ ERC721NFTs
This contract represents the ERC721 contract for the "global" collection of native NFTs on the chains L1 account.
📄️ ISC
This library contains various interfaces and functions related to the IOTA Smart Contracts (ISC) system. It provides access to the ISCSandbox, ISCAccounts, ISCUtil, ERC20BaseTokens, ERC20NativeTokens, ERC721NFTs, and ERC721NFTCollection contracts.
📄️ ISCAccounts
Functions of the ISC Magic Contract to access the core accounts functionality
📄️ ISCPrivileged
The ISCPrivileged interface represents a contract that has some extra methods not included in the standard ISC interface. These methods can only be called from privileged contracts.
📄️ ISCSandbox
This is the main interface of the ISC Magic Contract.
📄️ ISCTypes
ISCMAGICADDRESS
📄️ ISCUtil
Functions of the ISC Magic Contract not directly related to the ISC sandbox
Call a Native Contract
You can call native contracts using ISC.sandbox.call
:
pragma solidity >=0.8.5;
import "@iota/iscmagic/ISC.sol";
contract MyEVMContract {
event EntropyEvent(bytes32 entropy);
function callInccounter() public {
ISCDict memory params = ISCDict(new ISCDictItem[](1));
bytes memory int64Encoded42 = hex"2A00000000000000";
params.items[0] = ISCDictItem("counter", int64Encoded42);
ISCAssets memory allowance;
ISC.sandbox.call(ISC.util.hn("inccounter"), ISC.util.hn("incCounter"), params, allowance);
}
}
ISC.util.hn
is used to get the hname
of the inccounter
contract and the
incCounter
entry point. You can also call view entry points using
ISC.sandbox.callView.