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.
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
Name | Type | Optional | Description |
---|---|---|---|
coinType | CoinType | No | The coin type |
Returns
None
sendTransaction
Sends a transaction to the EVM.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
transaction | *types.Transaction | No | The transaction to send |
Returns
None
callContract
Calls a contract on the EVM.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
callMessage | ethereum.CallMsg | No | The call message |
Returns
Name | Type | Description |
---|---|---|
functionResult | []u8 | The 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
Name | Type | Optional | Description |
---|---|---|---|
collectionID | iotago.Address | No | The collection ID |
Returns
None
newL1Deposit
Creates a new L1 deposit.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
l1DepositOriginatorAgentID | [u8; 32] | No | The originator agent ID |
targetAddress | [u8; 32] | No | The target address |
assets | Assets | No | The assets |
Returns
None
Views
getChainID
Returns the chain ID.
Parameters
None
Returns
Name | Type | Description |
---|---|---|
chainID | u16 | The chain ID |