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 ...
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, ...
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.
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
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 ...
3
votes
Accepted
How does WASM get interpreted by the EOS virtual machine?
WASM is the form that the virtual machine understands.
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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, ...
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-...
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 ...
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 ...
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, ...
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 ...
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
= ...
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 ...
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 ...
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 ...
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 ...
1
vote
How does WASM get interpreted by the EOS virtual machine?
"EOS virtual machine" == WAVM or binaryen, which is a WASM-specific VM.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
wasm × 32smart-contract × 17
eosio-code × 5
c++ × 4
abi × 4
compilation × 4
eosio.cdt × 2
cpu × 2
api × 2
performance × 2
typescript × 2
cleos × 1
eosjs × 1
transactions × 1
testnet × 1
javascript × 1
security × 1
unit-tests × 1
error × 1
exchange × 1
cmake × 1
boost × 1
abigen × 1