Skip to main content

The evm Contract

The evm contract is one of the core contracts on each IOTA Smart Contracts chain.

The evm core contract provides the necessary infrastructure to accept Ethereum transactions and execute EVM code. It also includes the implementation of the ISC Magic contract.

note

For more information about how ISC supports EVM contracts, refer to the EVM section.


Entry Points

Most entry points of the evm core contract are meant to be accessed through the JSON-RPC service provided automatically by the Wasp node so that the end users can use standard EVM tools like MetaMask. We only list the entry points not exposed through the JSON-RPC interface in this document.

registerERC20Coin

Registers an ERC20 contract to act as a proxy for the L1 coin, at address 0x107402xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, where xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is the first 17 bytes of the Keccak hash of the coin type (0x123...module::yourcoin).

Only the foundry owner can call this endpoint.

Parameters

NameTypeOptionalDescription
coinTypeCoinTypeNoThe coin type

Returns

None

sendTransaction

Sends a transaction to the EVM.

Parameters

NameTypeOptionalDescription
transaction*types.TransactionNoThe transaction to send

Returns

None

callContract

Calls a contract on the EVM.

Parameters

NameTypeOptionalDescription
callMessageethereum.CallMsgNoThe call message

Returns

NameTypeDescription
functionResult[]u8The result of the call

registerERC721NFTCollection

Registers an ERC721 contract to act as a proxy for an NFT collection, at address 0x107404xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, where xxx... is the first 17 bytes of the collection ID.

The call will fail if the address is taken by another collection with the same prefix.

Parameters

NameTypeOptionalDescription
collectionIDiotago.AddressNoThe collection ID

Returns

None

newL1Deposit

Creates a new L1 deposit.

Parameters

NameTypeOptionalDescription
l1DepositOriginatorAgentID[u8; 32]NoThe originator agent ID
targetAddress[u8; 32]NoThe target address
assetsAssetsNoThe assets

Returns

None


Views

getChainID

Returns the chain ID.

Parameters

None

Returns

NameTypeDescription
chainIDu16The chain ID