Hot answers tagged

5 votes
Accepted

Why WASM instead of custom virtual machine?

Yes, Dan made a post about their decision to choose WASM--it boils down to performance, cross-compatibility, wide industrial support, and flexibility. Excerpt from post: Web Assembly is an emerging ...
confused00's user avatar
  • 5,554
5 votes
Accepted

Compile Rust to WebAssembly for EOS Smart Contract?

While executing the contracts in the VM, it doesn't really matter what was the source language: be it C++ or Rust. It only cares about the compiled WASM being accepted by the WASM interpreter. Yes, ...
confused00's user avatar
  • 5,554
4 votes

Meaning of N() function in multi_index

The primary key for a multi_index table can not be a string. In general it should be an int. The N() macro converts the contents within the brackets into a uint64_t.
Phillip Hamnett - EOS42's user avatar
4 votes
Accepted

Testing Contracts

Try eosfactory Here is a simple tutorial you can follow: https://medium.com/coinmonks/your-first-eos-dapp-using-eosfactory-aa0394df95d9
Rajat Chaudhary's user avatar
4 votes

How does WASM get interpreted by the EOS virtual machine?

WebAssembly is indeed the instruction format that the virtual machine understands. The actual interaction between the eos library and the wasm binary is done through WebAssembly modules. Every ...
wanheda's user avatar
  • 303
3 votes
Accepted

How does WASM get interpreted by the EOS virtual machine?

WASM is the form that the virtual machine understands.
bytemaster's user avatar
  • 1,434
3 votes
Accepted

Dawn4 build error - eosio.token/eosio.token.wast.hpp: No such file or directory

I had the same error, and filed a bug (which has been assigned). A short-term fix supplied by someone, which seems to work: go into build/contracts, run make, return to top level and run the original ...
expaand's user avatar
  • 654
3 votes

How is EOS WASM virtual machine hardened?

The Web Assembly Website has information on the potential security issues for both users and developers when coding in WASM. With regards to arbitrary code execution in EOS, @confused00 points out ...
Phillip Hamnett - EOS42's user avatar
1 vote
Accepted

Error 30700002: Smart contract's apply function not exported; non-existent; or wrong type

UPDATE: Based on the details you provided in the comments, I think the error might be coming from how you are compiling the code. You said you are running these commands: eosiocpp -o mycontract.wasm ...
Andres Berrios's user avatar
1 vote

Adding a new api for smart contracts to WASM

At that point you posted this question, you need to add max_net_usage to eosio.imports, but now eosio_wasm_import attribute can do same thing. Add __attribute__((eosio_wasm_import)) before function ...
conr2d's user avatar
  • 2,320
1 vote

Does EOS VM support solidity?

Dan mentioned in a comment on this website that "EOSIO will not support the EVM." However, if a Solidity to WASM compiler will exist, then Solidity can be supported.
confused00's user avatar
  • 5,554
1 vote
Accepted

Does EOS VM support solidity?

According to official eos developer guide https://developers.eos.io/eosio-cpp/docs/required-knowledge It doesn't support solidity now. It only supports c++ but they have also mentioned that there ...
yash vadhvani's user avatar
1 vote

eosio.contract cannot compile with error code 1 of eosio.wasmsdk by Clion

I think there are two things going on: I've run into problems with Ninja and eosio.wasmsdk. Give make a shot instead of ninja. Those options look like they're for compiling the compiler, not for ...
James Moore's user avatar
1 vote

What is an overhead of a smart-contracts compiled to WebAssembly using different languages?

Theoretically C++ is the most efficient language, since it is the native language for wasm, no one thinks of writing assembly by hand. Next are Rust and Go, these probably add some overhead since ...
Ami Heines's user avatar
  • 1,686
1 vote
Accepted

How can I generate an ABI out of a wasm?

There are currently no recommended tools for generating ABI automatically. However, there's an article in the documentation about how to write an ABI file yourself. From the article: As of v1.2.0, ...
confused00's user avatar
  • 5,554
1 vote
Accepted

Compiling smart contract not getting done

a few things to consider: it is not advisable to compile on your servers. you need tbe full blown dev environment to be set up correctly (all dependencies) in order to compile successfuly; when eosio-...
ovi's user avatar
  • 371
1 vote

Does the size of a contract affect CPU consumption

Probably not. A contract loaded by a node is just a block of bytecode that's already in RAM. When you execute an action on a contract, there will be a lookup operation that will find the RAM address ...
Fabiana Cecin's user avatar
1 vote

running hello.cpp tutorial, stuck at compiling WASM, abigen error, file read error

It says there is (likely) no file named hello.cpp in your /home/corey/eos directory. Check the previous steps in the tutorial. Find the step which was supposed to put this file there. Find out what ...
Gassa's user avatar
  • 598
1 vote

CPU-Usage Optimization

Is this CPU-billing-scheme still in use? To the best of my knowledge, yes Points 2. and 3. My understanding of CPU billing works is as follows: A BP receives your transaction, starts a timer, ...
Phillip Hamnett - EOS42's user avatar
1 vote

Runtime Error Processing WASM in ``` std::stof```?

I couldn't make that happen either but I did make this work: std::string s("limit: 686.97"); float limit = atoi(s.c_str()); printf("limit [%f]\n", limit); * Edit I * of course, that gets us to ...
ekkis's user avatar
  • 515
1 vote

Deterministic Smart Contracts

All inputs are based on the shared data on a public ledger. There are no analog or non-deterministic input like the time of a day or random number generator. Same inputs Same code Same results = ...
Mikko Ohtamaa's user avatar
1 vote
Accepted

How does EOS integrate WASM?

Smart contract in EOS are developed in C++, then compiled into wasm code using eosiocpp (or eosio-cpp) and uploaded to the blockchain using cleos set contract. Why wasm? Read this post, basically for ...
damianodamiano's user avatar
1 vote

Using "native" wat/wasm function in smart-contract

Theoretically, the final linking stage of the compiler pulls different wasm modules together, so you could include your own wasm code in a module and then link it at that stage. However, this isn't ...
Phillip Hamnett - EOS42's user avatar
1 vote

Why WASM instead of custom virtual machine?

As EOS chooses a web assembly, the advantages that a web assembly can provide are all there. The benefits of web assembly are outlined below. https://webassembly.org/ The two most important reasons ...
smarteasy's user avatar
  • 1,015
1 vote
Accepted

How difficult would it be to incorporate AssemblyScript?

The answer to this question is being documented here. TL/DR: Getting the most basic functionality to work is very easy. You only need to export an apply(uint64, uint64, uint64) function in ...
wanheda's user avatar
  • 303
1 vote

How does WASM get interpreted by the EOS virtual machine?

"EOS virtual machine" == WAVM or binaryen, which is a WASM-specific VM.
Stephen D's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible