4

I am not sure why I am being told my function is not a function.

I am doing calls as I always do from the Truffle console.

pragma solidity >=0.4.22 <0.6.0;

contract store {
    string public storage_;

    function store_it(string memory s) public {
        storage_=s;
    }
}

stor = store.at(store.address)

stor.store_it("string")

TypeError: stor.store_it is not a function

What is going wrong?

5

It seems you are using truffle v5. In that version you have to use await to obtain the result of .at

stor = await store.at(store.address)
stor.store_it("string")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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