Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
1answer
43 views

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

I'm running 3 cores confirmed on virtual machine (per solve for similar problem), and I'm still getting this error: ~/eos$ eosio-cpp -abigen -o hello.wasm hello.cpp error: error reading '/home/corey/...
2
votes
0answers
48 views

CPU-Usage Optimization

I'm trying to figure out how to optimize one of my smart contracts for less billed CPU-usage. There are typically different methods to optimize performance of algorithms but I'm not clear about if a ...
1
vote
1answer
32 views

Duplicate symbol WASM compilation error when using header/hpp for contract

I'm looking to use a hpp file as an interface for multiple contracts. I've created a test contract and receiving a WASM compilation error. I based the test contract on the format used by eosio.token....
0
votes
0answers
54 views

/eosio.cdt/bin/wasm-ld: error: ios.obj: undefined symbol: std::uncaught_exception() while using eosio-cpp

WHAT I AM USING CDT: eosio.cdt-1.4.1 WHAT I AM DOING I am getting this error while trying to compile a contract: /usr/local/eosio.cdt/bin/wasm-ld: error: ios.obj: undefined symbol: std::...
2
votes
0answers
75 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
104 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
84 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
225 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?
7
votes
1answer
113 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
140 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
342 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
410 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
60 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
189 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
44 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
261 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
4answers
228 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
156 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
304 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
233 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
159 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
612 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
23 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
268 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
81 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
73 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
647 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?