2

I tried to set contract with the promotion account, but kept getting this error:

cleos set contract promotion car_promotion -p promotion Reading WAST/WASM from car_promotion/car_promotion.wasm... Using already assembled WASM... Publishing contract... 257134ms thread-0 main.cpp:2493 main ] Failed with error: Assert Exception (10) !"unresolvable": env.free

What's wrong?

1 Answer 1

3

This means that your WASM is compiled such that it expects the symbol free to be provided at run time by the environment. In our WebAssembly toolchain, any unresolvable symbol left over after linking will be assumed part of the "env" module and present at execution time.

We don't provide a free intrinsic as our memory model operates underneath a usual memory allocator. It is likely that your contract code is assuming too much about the environment or your build chain is missing our standard C, C++, or EOSIO libraries.

1
  • I've figured it out, it's because that the sequence of arguments in my main struct doesn't match the sequence of data in EOSLIB_SERIALIZE inside one of the action struct; my contract code is indeed assuming too much. After fixing that, the contract run with no problem. Thanks!
    – Tim Zhang
    Commented Jun 1, 2018 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.