Skip to main content

102 docs tagged with "Move Smart Contracts"

Move Smart Contract programming language.

View all tags

Abilities

Abilities in Move allow customizing type behaviors. This section covers the introduction to abilities, how they work, and how to use them in Move.

Abilities

Abilities are a typing feature in Move that control what actions are permissible for values of a given type. This system grants fine grained control over the "linear" typing behavior of values, as well as if and how values are used in global storage. This is implemented by gating access to certain bytecode instructions so that for a value to be used with the bytecode instruction, it must have the ability required (if one is required at all—not every instruction is gated by an ability).

Access On-Chain Time

Access network-based time for your transactions. IOTA provides a Clock module to capture near-real time or epoch time in your IOTA packages.

Action Request

The main difference between tokens and coins is that tokens do not allow transfers, conversions, or spends by default. There is an authorization mechanism, however, that allows these actions. This mechanism is called an ActionRequest. You can choose to allow or disallow any of the actions independently (see the Request confirmation section).

Address-Owned Objects

Address-owned objects are owned by a specific IOTA 32-byte address, either an account address or an object ID, and are accessible only to their owner.

Asset Tokenization

Learn how to tokenize assets on the IOTA blockchain. Asset tokenization refers to the process of representing real-world assets, such as real estate, art, commodities, stocks, or other valuable assets, as digital tokens on the blockchain network.

Automated Address Management

When you publish or upgrade a package, its address (also known as the package ID) is tracked in the Move.lock file. This bookkeeping is done automatically so that you can avoid recording or updating hex addresses (for example, in the Move.toml file).

Before You Start

A guide to familiarizing yourself with the IOTA repository, branch and network structure, SDKs, CLI, and recommended IDEs and plugins.

Capabilities

Introduction to capabilities and their use in authorizing actions within the Move language.

Challenge 0: Mint Leap Frog NFT

In this challenge, your task is to mint the Leap Frog NFT. The package has already been deployed on the testnet, and the address of the deployed package is provided below.

Challenge 1: Checkin

In this first challenge, your task is to interact with a basic Move contract. The contract defines a Flag object, which you need to retrieve by calling a specific function.

Challenge 2: Lucky Number

In this challenge you are supposed to get the flag Event by passing in the right parameters to the get_flag function in the luckynumber module. If you do this correctly you should get a Flag event in return.

Challenge 3: MintCoin Mechanics

In this challenge, you'll dive into the mechanics of "MintCoin," a coin that allows anyone to mint new tokens using a "Proof of Move" process. However, minting alone will not be enough to get the flag—you'll need to go a step further.

Challenge 4: Airdrop

Your mission is to participate in the "Horse Token" airdrop and capture the elusive flag. You'll need to mint some Horse Tokens and claim your share through the airdrop mechanism. But simply collecting tokens won’t be enough—securing the flag requires a bit more effort.

Challenge 5: Perfect Pizza

When in Italy, pizza is a way of life. Crafted from simple ingredients with an artful touch, only the perfect combination will gain the approval of the pizzaiolo (master pizza maker). Choose your ingredients wisely—anything less than perfection and your creation won’t pass the test.

Challenge 6: Go Recycle!

The City of Venice is tired of all the trash ending up in the canals, especially pizza boxes still filled with a certain type of pizza which are just dumped everywhere are ruining the experience. They decided to start a recycling program rewarding people who do their part with a Venetian Flag; Go grab one!

Challenge 7: PTBs

In response to the recent pizza challenge, the city of Venice has implemented a smart contract to efficiently manage ingredients and prevent hoarding. Participants are invited to utilize these perishable ingredients, which must be used immediately to create dough.

Challenge 8: Flash!

In this challenge, you will explore a decentralized exchange (DEX) with a critical flaw you can exploit to capture the flag. This exchange operates with two tokens—CTFA and CTFB—and features a vault that allows users to take flash loans. Your objective is to manipulate the token balances effectively to obtain the flag by using the vulnerabilities in the DEX's flash loan mechanism.

Closed-Loop Token

Using the Closed-Loop Token standard, you can limit the applications that can use the token and set up custom policies for transfers, spends, and conversions. The iota::token module in the IOTA framework defines the standard.

Coin Manager

The Coin Manager Standard provides additional assurances and functionality when it comes to managing Coin supply and metadata.

Coin Standard

The IOTA Coin standard enables you to create a broad range of fungible tokens on the IOTA network to satisfy a number of use cases. The Coin standed on IOTA is equivalent to the ERC-20 technical standard on Ethereum.

Collections

An overview of various collection types in the IOTA framework.

Conventions

Recommended Move 2024 best practices for the IOTA blockchain.

Copy Ability

In Move, the copy ability on a type indicates that the instance or the value of the type can be copied. This section covers the copy ability, how it works, and how to use it in Move.

Custom Policies

A guide to understanding and implementing secure package upgrade policies in IOTA using Move.

Custom Transfer Rules

Custom transfer rules enable you to define a set of rules that must be met before IOTA considers a transfer operation valid.

Debugging

Learn how to use the std::debug module in Move for debugging and printing values.

Drop Ability

In Move, the drop ability on a type indicates that the instance of the type can be ignored or discarded. This section covers the drop ability, how it works, and how to use it in Move.

Dynamic Object Fields

Dynamic fields and dynamic object fields on IOTA allow flexible storage and manipulation, with the ability to add, remove, and store heterogeneous values dynamically while only affecting gas costs when accessed.

Elliptic Curve Verifiable Random Function

Elliptic curve verifiable random function is a cryptographic algorithm that enables you to generate a random number and provide proof that the number used a secret key for generation.

Events

Events are the main way to track actions on chain.

Generics

Generics are a way to define a type or function that can work with any type. This is useful when you

Generics

Generics can be used to define functions and structs over different input data types. This language feature is sometimes referred to as parametric polymorphism. In Move, we will often use the term generics interchangeably with type parameters and type arguments.

Groth1

A zero-knowledge proof allows a prover to validate that a statement is true without revealing any information about the inputs. For example, a prover can validate that they know the solution to a sudoku puzzle without revealing the solution.

Hashing

IOTA supports SHA2-256, SHA3-256, Keccak256, Blake2b-256 cryptographic hash functions.

Hot Potato

Introduction to the hot potato pattern in Move and its practical application.

ID Pointer

Overview of the ID pointer technique in Move and its practical applications.

Immutable Objects

Immutable objects on IOTA cannot be mutated, transferred, or deleted once frozen. These objects are ownerless and can be used by anyone on the network.

Intent Signing

In IOTA, an intent is a compact struct that serves as the domain separator for a message that a signature commits to. The data that the signature commits to is an intent message. All signatures in IOTA must commit to an intent message, instead of the message itself.

Introducing Move 2024

New features are becoming available to Move in 2024. These features are opt-in, so existing code will continue to function as expected. If you want to use these features in code you've already written, however, there are some steps you must take and breaking changes to be aware of to migrate to Move 2024.

IOTA Kiosk

Kiosk is a decentralized system for commerce applications on IOTA. Kiosk is a part of the IOTA framework, native to the system, and available to everyone.

IOTA Object Display

The IOTA Object Display standard is a template engine that enables on-chain management of off-chain representation (display) for a type.

IOTA On-Chain Signatures Verification in Move

Move contracts in IOTA support verifications for several signature schemes on-chain. Not all signatures supported in on-chain verification are supported as user signature verification. See IOTA Signatures for valid signature schemes for transaction authorization.

Key Ability

In Move, the key ability on a type indicates that the instance of the type can be stored in the storage. This section covers the key ability, how it works, and how to use it in Move.

Kiosk Apps

Kiosk apps are a way to extend the functionality of IOTA Kiosk while keeping the core functionality intact. You can develop apps to add new features to a kiosk without having to modify the core code or move the assets elsewhere.

Managing Package Upgrades

Learn how to upgrade your packages on the IOTA network while maintaining their immutable properties.

Marketplace Extension

A brief introduction to implementing NFT marketplace extension using the Kiosk Apps standard in IOTA's Move language.

Migrating a Coin to Coin Manager

The previous articles in this section showcase how to create a Coin object with different constructors. Namely, createcurrency and createregulated_currency.

Module Initializers

Learn about the `init` function in Move modules, including its unique characteristics and proper usage.

Move Concepts

Move is an open source language for writing safe packages to manipulate on-chain objects

Object Model

Everything on the IOTA blockchain is an object, with metadata, type of ownership, and a referencing scheme.

Object Ownership

Overview of the different types of object ownership in IOTA and their implications for transactions and access.

On-Chain Randomness

Randomness is a valuable tool to simulate chance on chain, but can also expose flaws in your logic. Understanding the vulnerabilities and accounting for them can mitigate the threat exposure for your smart contracts.

One-Time Witness

An overview of the One-Time Witness (OTW) type in Move, which ensures actions occur only once within a module.

Ownership and Scope

Learn about variable ownership and scope in Move, how it works, and how to use it in Move.

Package Upgrades

Learn how to upgrade Move packages on IOTA without affecting existing dependencies.

Patterns

Move coding patterns and techniques to solve logic challenges when developing Move packages for the IOTA blockchain, including capabilities, witness and transferable witness, hot potato, and ID pointer.

Publish a Package

Learn how to publish your Move package on the IOTA network and interact with it using programmable transaction blocks.

References

References in Move allow passing a value to a function without giving up the ownership. This section covers references, how they work, and how to use them in Move.

Rules

Rules are programmable restrictions that you can apply to any action in the TokenPolicy. They are the tool of compliance, regulation, and enforcement of certain business logic in the closed-loop system.

Shared Objects

Anyone can access shared objects on the IOTA network, so care must be taken to secure access, if needed.

Shared versus Owned Objects

On IOTA, you can use shared objects, owned objects, or both in your transactions. Weigh the benefits of each to decide the best approach for your project.

Spending

Because Token types do not have the store ability, it is impossible to store them in another object. Hence, Coin-like approaches to spending are not possible - an application that takes Token as a payment won't be able to add it to its balance. To address this issue, Token has a spend method, which allows spending it in one application and then delivering it as a spent_balance to the TokenPolicy or burning right away with a TreasuryCap.

Sponsored Transactions on IOTA

A guide to understanding and implementing sponsored transactions on the IOTA blockchain, including roles, use cases, workflows, and risk considerations.

Store Ability

In Move, the store ability on a type indicates that the instance of the type can be stored in objects. This section covers the store ability, how it works, and how to use it in Move.

Strings

While Move does not have a built-in type to represent strings, it does offer two standard implementations for strings:

Struct

Custom types in Move can be defined using the struct keyword. This section covers the struct definition, how to create and use an instance, and how to unpack a struct.

Table and Bag

IOTA provides `Table` and `Bag` collections built using dynamic fields, offering additional support to count entries and prevent accidental deletion when non-empty.

Token Policy

TokenPolicy is a shared object that you, as the token owner, can create using the TreasuryCap. Having a publicly available TokenPolicy enables on-chain discovery of allowed actions and their conditions. This is useful for wallets and other services that want to provide a better user experience for token holders.

Transactions

An introduction to transactions, their types, metadata, and execution flow in Move-based blockchain networks.

Transfer to Object

On IOTA, you can transfer objects to objects in the same way you can transfer objects to addresses.

Transferable Witness

Learn about the transferable witness pattern in Move for advanced authorization scenarios.

UID and ID

The UID type is defined in the iota::object module and is a wrapper around an ID which, in

Visibility Modifiers

Every module member has a visibility. By default, all module members are private - meaning they

Wallet Standard

The Wallet standard defines how wallets can automatically be discovered and interacted with from dApps.

Witness Pattern

Overview of the witness pattern in Move and its implementation.

Wrapped Objects

In programming, nesting complex data structures within others is common for organizing information.