Questions tagged [move-lang]

Move is a programming language for writing safe smart contracts. It was created to write contracts for the Diem blockchain. Use this tag for questions about writing or working with code in Move.

Move is a programming language for writing safe smart contracts originally developed at Facebook to power the Diem blockchain. Move is designed to be a platform-agnostic language to enable common libraries, tooling, and developer communities across diverse blockchains with vastly different data and execution models. Move's ambition is to become the "JavaScript of web3" in terms of ubiquity--when developers want to quickly write safe code involving assets, it should be written in Move.

37 questions
5
votes
3 answers

Is Move a Turing-complete language?

Will Move (on the Diem platform), like Ethereum, be turing complete? I have read the white paper but have been unable to decide. This is the white paper:…
Aminadav Glickshtein
  • 23,232
  • 12
  • 77
  • 117
4
votes
3 answers

How do you define and query a read function in a Move module on Aptos Blockchain?

In the Aptos Move docs, it explains how to interact with a smart contract which has exposed "entry functions".In the hello_blockchain example, set_message is used. Move modules expose access points, also referred as entry functions. These access…
Jolow
  • 41
  • 1
3
votes
1 answer

How do I call a function in a different Move module / smart contract?

I know there is a Move module (smart contract) on chain with a function that looks like this: public entry fun do_nothing() {} I know it is deployed at 6286dfd5e2778ec069d5906cd774efdba93ab2bec71550fa69363482fbd814e7::other::do_nothing. You can see…
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44
3
votes
1 answer

How to define Move Error types in Sui blockchain

Trying to understand the idiomatic way we should set Errors in Sui blockchain smart contracts. From the provided examples it seems that we should define constants per different expected error i.e. in Marketplace smart contract two errors are…
Kostas Kryptos
  • 4,081
  • 2
  • 23
  • 24
2
votes
0 answers

How do I call functions in Move?

I currently have this function public entry fun create_game( account: &signer, prize_pool_amount: u64, player_one_address: address, player_two_address: address ) acquires State { // TODO: Call…
2
votes
1 answer

Local dependency cannot be resolved

I know there is a similiar question right below this one but the answer does not solve my issue. I have a published package and would like to refer to it from another one. The dependency is defined locally (not git), however the build command…
calimoose
  • 115
  • 6
2
votes
0 answers

How do I create a custom token in the Libra TestNet?

I want to create my custom token in Libra TestNet. I don't have much knowledge about the move programming language and need a lot of help. Is it possible to create our own implementation and execute in Libra Testnet? What is sample implementation…
karthi keyan
  • 213
  • 2
  • 19
2
votes
2 answers

How to Compile and Deploy Move smart contracts on Diem (Libra) Blockchain?

I know that compiling a Move source code is given on their documentation here But how exactly do I deploy the binary to the network? The simple command line at the moment does not have the deploy binary option.
zeh
  • 1,197
  • 2
  • 14
  • 29
1
vote
0 answers

Launch tests in Move language

I'm learning Move language and I'd like to run tests to make sure my module is valid. Here is example taken from docs (file sources/MyModule.move): module 0xCAFE::BasicCoin { #[test_only] use std::signer; struct Coin has key { …
strukovsky
  • 11
  • 1
1
vote
0 answers

Move Language: How to interact with move vm cache

In the move vm repository, I know that there exist different caches such as AccountCache or TransactionDataCache, but how, when and where does the diem blockchain actually interact with said cache and store the changes in the cache in persistent…
a6i09per5f
  • 260
  • 1
  • 15
1
vote
0 answers

How to create multi agent transactions in Aptos blockchain?

I've written multi-agent-transaction implementation using Aptos Typescript SDK. Steps Create a new TransactionBuilderRemoteABI instance using the aptosClient and sender address const builder = new TransactionBuilderRemoteABI(aptosClient, { …
Anto
  • 153
  • 1
  • 7
1
vote
1 answer

Aptos Bytecode / ABI to move file?

I have an address with some deployed modules, is there a way for me to translate the Bytecode / ABI info to a file.move so it will be human readable?
Bob Sfog
  • 105
  • 8
1
vote
1 answer

How do I execute a Move script with the Aptos CLI?

Let's say I have a Move script like this: script { use std::signer; use aptos_framework::aptos_account; use aptos_framework::aptos_coin; use aptos_framework::coin; fun main(src: &signer, dest: address, desired_balance: u64) { …
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44
1
vote
1 answer

How do I execute a Move script on Aptos using the Rust SDK?

I want to execute this Move script, e.g. at sources/top_up.move: script { use std::signer; use aptos_framework::aptos_account; use aptos_framework::aptos_coin; use aptos_framework::coin; fun main(src: &signer, dest: address,…
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44
1
vote
1 answer

why do `coin::initialize` enforce `coin_address == account_addr`?

In coin.move: assert!( coin_address() == account_addr, error::invalid_argument(ECOIN_INFO_ADDRESS_MISMATCH), ); My guess is it prevents account A from initializing coins on behalf of account B to avoid scam? But look forward to…
0xbe1
  • 15
  • 4
1
2 3