package
1.4.0-rc.2
Repository: https://github.com/iotaledger/wasp.git
Documentation: pkg.go.dev

# README

@iota/iscmagic

The Magic contract is an EVM contract deployed by default on every ISC chain, in the EVM genesis block, at address 0x1074000000000000000000000000000000000000. The implementation of the Magic contract is baked-in in the evm core contract; i.e. it is not a pure-Solidity contract.

The Magic contract has several methods, which are categorized into specialized interfaces: ISCSandbox, ISCAccounts, ISCUtil and so on. You can access these interfaces from any Solidity contract by importing this library.

The Magic contract also provides proxy ERC20 contracts to manipulate ISC base tokens and native tokens on L2.

Read more in the Wiki.

Installing @iota/iscmagic contracts

The @iota/iscmagic contracts are installable via NPM with

npm install @iota/iscmagic

After installing @iota/iscmagic you can use the functions by importing them as you normally would.

pragma solidity >=0.8.5;

import "@iota/iscmagic/ISC.sol";

contract MyEVMContract {
    event EntropyEvent(bytes32 entropy);

    // this will emit a "random" value taken from the ISC entropy value
    function emitEntropy() public {
        bytes32 e = ISC.sandbox.getEntropy();
        emit EntropyEvent(e);
    }
}

# Functions

ERC20ExternalNativeTokensAddress creates an Ethereum address for an ERC20 contract for native tokens with an off-chain foundry.
ERC20NativeTokensAddress returns the Ethereum address of the ERC20 contract for native tokens with an on-chain foundry.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

go:embed ISCAccounts.abi.
No description provided by the author
No description provided by the author
go:embed ERC20BaseTokens.abi.
go:generate sh -c "solc --abi --bin-runtime --overwrite @iscmagic=`realpath .` ERC20BaseTokens.sol -o .".
go:generate sh -c "solc --abi --bin-runtime --overwrite @iscmagic=`realpath .` ERC20BaseTokens.sol -o .".
go:embed ERC20ExternalNativeTokens.abi.
go:generate sh -c "solc --abi --bin-runtime --storage-layout --overwrite @iscmagic=`realpath .` ERC20ExternalNativeTokens.sol -o .".
go:embed ERC20NativeTokens.abi.
go:generate sh -c "solc --abi --bin-runtime --storage-layout --overwrite @iscmagic=`realpath .` ERC20NativeTokens.sol -o .".
go:embed ERC721NFTCollection.abi.
go:generate sh -c "solc --abi --storage-layout --bin-runtime --overwrite @iscmagic=`realpath .` ERC721NFTCollection.sol -o .".
go:embed ERC721NFTs.abi.
go:generate sh -c "solc --abi --bin-runtime --overwrite @iscmagic=`realpath .` ERC721NFTs.sol -o .".
go:generate sh -c "solc --abi --bin-runtime --overwrite @iscmagic=`realpath .` ERC721NFTs.sol -o .".
go:embed ISCPrivileged.abi.
go:embed ISCSandbox.abi.
go:embed ISCUtil.abi.

# Structs

IRC27NFT matches the struct definition in ISCTypes.sol.
IRC27NFTMetadata matches the struct definition in ISCTypes.sol.
ISCAgentID matches the struct definition in ISCTypes.sol.
ISCAssets matches the struct definition in ISCTypes.sol.
ISCDict matches the struct definition in ISCTypes.sol.
ISCDictItem matches the struct definition in ISCTypes.sol.
No description provided by the author
ISCNFT matches the struct definition in ISCTypes.sol.
ISCRequestID matches the struct definition in ISCTypes.sol.
No description provided by the author
No description provided by the author
No description provided by the author
L1Address matches the struct definition in ISCTypes.sol.
NativeToken matches the struct definition in ISCTypes.sol.
NativeTokenID matches the struct definition in ISCTypes.sol.

# Type aliases

ISCChainID matches the type definition in ISCTypes.sol.
NFTID matches the type definition in ISCTypes.sol.