Skip to main content

72 docs tagged with "EVM"

Ethereum Virtual Machine.

View All Tags

About How-to Guides

Explore the how-to guides for IOTA Smart Contracts, offering step-by-step instructions on various topics and functionalities.

Add Function Descriptors

The schema tool provides us with an easy way to get access to smart contract functions through function descriptors, which allow you to initiate the function by calling it synchronously, or posting a request to run it asynchronously.

Allow

How to allow native assets and base token

Call Context

The call context is a predefined parameter to each smart contract function, which allows you to access the functionality that the call environment provides.

Call Functions

Explore how synchronous function calls work between smart contracts, highlighting the role of function descriptors in parameter and token passage, and understanding the ISC host's role in this procedure.

Calling a Smart Contract

Smart contracts can be invoked through their entry points, from outside via a request, or from inside via a call.

Compatible Tools

Existing EVM tooling is compatible and can be used directly with an IOTA Smart Contracts chain running EVM. You can configure hardhat, metamask, remix, Ether.js and Web3.js among others.

Consensus

IOTA Smart Contracts consensus is how Layer 2 validators agree to change the chain state in the same way.

Core Contracts

There currently are 6 core smart contracts that are always deployed on each chain, root, _default, accounts, blob, blocklog, and governance.

Create ERC721 NFTs

Create and deploy a Solidity smart contract to mint NFTs using the ERC721 standard.

Data Access Proxies

As there is no way for the Wasm code to access any memory outside its own memory space, the WasmLib interface provides a number of proxies to make accessing data within the ISC sandbox as seamless as possible.

Define Function Parameters

Learn how to define function parameters using the 'params' subsection, and how the Schema Tool facilitates this process.

Define Function Results

Understand how to outline function results using the 'results' subsection and how the Schema Tool aids in this process.

Define Functions

The code generated for Funcs will be able to inspect and modify the smart contract state, whereas the code generated for Views will only be able to inspect the state.

Define the State

The smart contract state storage on the host consists of a single key/value map, as long as you access the data in the same way that you used to store it, you will always get valid data back.

Deploy a Smart Contract

Learn how to deploy smart contracts to IOTA EVM, Shimmer EVM and EVM Testnet using popular tools like Remix and Hardhat.

Example Tests

Use the SoloContext to create full-blown tests for the dividend example smart contract.

First Example

Example of a _Solo_ test. It deploys a new chain and invokes some view calls.

Get Allowance

How to get the allowance of native assets and base token

Get Randomness on L2

You can use the ISC Magic Contract in EVM contracts to access ISC functionality, such as randomness.

How Accounts Work

IOTA Smart Contracts chains keep a ledger of on-chain account balances. On-chain accounts are identified by an AgentID.

Initialize a Smart Contract

The init function will automatically be called immediately after the first time the contract has been deployed to the VM. This is a one-time initialization call, meant to be performed by the contract deployment mechanism.

Introduction

The current release of IOTA Smart Contracts also has experimental support for EVM/Solidity, providing limited compatibility with existing smart contracts and tooling from other EVM based chains like Ethereum.

Limit Access

This article explains how to define access controls for functions using the optional 'access' subsection in the schema definition file.

Minting NFTs and Time Locks

You can post a time-locked request by using the Delay() method. You can mint NFTs by using the MintNFT() method.

Post Asynchronous Requests

Asynchronous function calls between smart contracts are posted as requests on the Tangle. They allow you to invoke any smart contract function that is not a View on any smart contract chain.

Sandbox Interface

Smart Contracts can only interact with the world by using the Sandbox interface which provides limited and deterministic access to the state through a key/value storage abstraction.

Smart Contracts

Smart contracts are applications you can trust that run on a distributed network with multiple validators all executing and validating the same code.

Spec

The spec of schema tool and how to develop schema tool.

State Manager

State manager is Wasp component, which is responsible for keeping the store up to date.

State, Transitions, and State Anchoring

The state of the chain consists of balances of native IOTA digital assets and a collection of key/value pairs which represents use case-specific data stored in the chain by its smart contracts outside the UTXO ledger.

Structured Data Types

You can use structs directly as a type in state storage definitions and the schema tool will automatically generate the proxy code to access it properly.

Testing Smart Contracts

Learn how to test smart contracts before deploying them on public networks to avoid vulnerabilities and ensure functionality aligns with requirements using unit, and integration testing, alongside frameworks and testing with the IOTA Sandbox and the EVM Testnet.

Testing Smart Contracts

Testing of smart contracts happens in the Solo testing environment. This enables synchronous, deterministic testing of smart contract functionality without the overhead of having to start nodes, set up a committee, and send transactions over the _Tangle_.

The evm Contract

The evm core contract provides the necessary infrastructure to accept Ethereum transactions and execute EVM code.

The L2 Ledger

Smart contracts can exchange assets between themselves on the same chain and between different chains, as well as with addresses on the L1 ledger.

Thunk Functions

Learn about thunk functions and how the Schema Tool uses them to facilitate smart contract function calls.

Transfer Tokens

Explore methods in the Call Context that facilitate the handling and transfer of asset balances in smart contracts using the `dividend` example.

Trigger Events

This article outlines how to trigger events in smart contracts utilizing ISC sandbox's ScFuncContext and the Schema Tool for structured events.

Type Definitions

You can add a typedefs section to the schema definition file, where you can define a single type name for a container type. This way you can easily create containers that contain container types.

Use the Schema Tool

The `schema` tool will assist in creating a smart contract as unobtrusively as possible.

Use View-Only Functions

Explore the characteristics and constraints of view-only functions in smart contracts, illustrated through a 'getFactor' function example.

Validators

Each chain is run by a network of validator nodes which run a consensus on the chain state update.