Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wasm]

The tag has no usage guidance.

1
vote
0answers
3 views

Deploy Contract from browser using eosjs

so I would like to deploy an EOS contract using eosjs. I encountered several problems (especially with converting the .abi and .wasm files). All the examples either use node (so fs is available) or an ...
1
vote
1answer
48 views

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

[[eosio::action]] void hi(){ string strNum; strNum.push_back('3'); float currNum = std::stof(strNum);// print("currNum=",currNum); } ...
2
votes
1answer
61 views

Deterministic Smart Contracts

How does EOS ensure contracts are deterministic? If WASM is used doesn't that mean developer can write non-deterministic contracts which break the network? Update I understand the properties of a ...
2
votes
1answer
87 views

How does EOS integrate WASM?

WASM (Web Assembly) is relatively new. How does EOS make use of WASM? And are there other blockchains working with WASM?
0
votes
0answers
93 views

Error 3070002: Runtime Error Processing WASM

I am getting this error on the testnet: Error 3070002: Runtime Error Processing WASM Error Details: access violation pending console output: testdauser11.hpp file: #include "../eosiolib/eosio.hpp" #...
7
votes
1answer
97 views

Using “native” wat/wasm function in smart-contract

I have to do some heavy computation in my smart-contract, like say a+b. Fortunately, I have written some very efficient implementation in "native" (web)assembly, like: File add.wast: (module (func ...
3
votes
2answers
100 views

Meaning of N() function in multi_index

What is the role of N() in defining tables using multi_index. The primary key function does not return string. Why so? e.g. string primary_key() const {return Some_String_Object}. This throws an error....
9
votes
1answer
281 views

Compile Rust to WebAssembly for EOS Smart Contract?

So I'm familiar with the fact that the supported language for EOS smart contracts is C++. However, the EOS docs mention that even the C++ needs to compile down to WebAssembly. So my question is, ...
2
votes
2answers
241 views

Does EOS VM support solidity?

EOS smart contracts are writeen in c++, but does EOS VM also support (Ethereum's) solidity?
5
votes
1answer
55 views

How does eosio support complex structure as the input of a contract's method?

AFAIK, the data type in Wasm only supports i32,i64,f32,f64, but when we use eosio contract, we can pass a string as a parameter. Anyone can tell me how eosio does that?
4
votes
1answer
163 views

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

We are compile the eosio.contract v1.2.0 using Clion by following that: Dependencies: eosio v1.1.2 eosio.wasmsdk v1.1.0 Cannot get compiler information: Compiler exited with error code 1: /usr/...
3
votes
1answer
39 views

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

Let's say I'm going to write a simple smart-contract to be executed in wasm. Is there any inherit overhead by the language I will use? In particular I'm interested of overhead between following ...
3
votes
1answer
203 views

How can I generate an ABI out of a wasm?

Currently I've written a rust program to print "5" and converted the same into wasm using the the rust tool (target add wasm32-unknown-unknown). I want this wasm to be executed on the local blockchain ...
4
votes
3answers
156 views

Testing Contracts

There used to be a directory wasm_tests in the eos/tests directory which contained several c++ files that unit tested contracts. https://github.com/EOSIO/eos/tree/dawn-v3.0.0/tests/wasm_tests . This ...
1
vote
1answer
135 views

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

I have written a smart contract and I want to start testing it, it contains an apply function, which currently checks for a transfer, and then calls the appropriate function: void mycontract::apply(...
1
vote
0answers
250 views

How do I set CMake on for Windows CLion?

Update: Running: Visuals Studios w/ Ubuntu Module Windows (Mac Answer Below) CLion I was able to figure out MinGW (probably not ideal solution if you want to use Git) / OpenSSL / Boost / WASM / ...
1
vote
1answer
197 views

Error 3070002: Runtime Error Processing WASM - i64.rem_u by 0

My contract deployed fine. However, when I try to call an action I get the following error: Error 3070002: Runtime Error Processing WASM Error Details: i64.rem_u by 0 And the log from the nodeos: ...
2
votes
1answer
145 views

Adding a new api for smart contracts to WASM

I'm trying to add a new smart contract API to wasm_interface.cpp. I did the same things like context_free_transaction_api::tapos_block_prefix(), https://github.com/EOSIO/eos/pull/1217, adding ...
3
votes
2answers
450 views

Why WASM instead of custom virtual machine?

Is there design rationale why EOS chose to go along with WASM virtual machine? Are the pros and cons discussed here? What other alternatives there would have been, besides EVM? How much WASM had to be ...
1
vote
0answers
22 views

injectors in wasm_eosio_injection.hpp

What are injectors defined in wasm_eosio_injection.hpp? What do they do? The following is a snippet. An illustration on how one injector is used will be very helpful. struct pre_op_injectors : ...
13
votes
1answer
247 views

How is EOS WASM virtual machine hardened?

WASM, famous from web browsers, regularly sees breaking out of sandbox issues. For example, see WebAssembly notes here: https://www.cisecurity.org/advisory/multiple-vulnerabilities-in-google-chrome-...
5
votes
1answer
71 views

How difficult would it be to incorporate AssemblyScript?

It would be awesome to see support for AssemblyScript (which compiles typescript to wasm). So how can we do this? The database interface seems like the main headache. Boost seems to be way too ...
1
vote
1answer
62 views

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

I was able to run Dawn 3, but ran into a snag with Dawn 4: Using a fresh CentOS7 VM in VirtualBox, building the dawn-v4.0.0 tag using the eosio_build.sh: [ 80% ] Building CXX object libraries/testing/...
5
votes
3answers
438 views

How does WASM get interpreted by the EOS virtual machine?

WASM is meant to be executed by general purpose computers. How does the low level WASM get converted to a form that the EOS virtual machine can understand?