1

When trying to compile my contract, I use the -abigen flag in order to auto-generate the necessary ABI file. This did not work, and gave no errors or warnings.

The code to compile the contract is as follows:

eosio-cpp ../src/mycontract.cpp -o mycontract.wasm -abigen

1 Answer 1

2

The solution to my problem was that the wasm file had to exactly match the name of the contract in the attributes of the contract class. So as my file was called mycontract.wasm, I had to have the following in my contract class:

class [[eosio::contract("mycontract")]] token : public contract { // the name of the class must be mycontract
...
};

After this, the ABI Generator worked as expected.

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.