1

I'm not sure why this doesn't work. I have the exact same pattern for addresses and it does fine.

bytes32[] public someStorage;

function addToStorage(bytes32 someData) {
  someStorage.push(someData);
}

Then using web3:

instance.addToStorage("Some Data", {from: web3.eth.accounts[0], gas:1000000})

I get a tx address but in testrpc console I see a matching Runtime Error: Invalid Opcode and it always consumes the max gas that I set.

1 Answer 1

2

Looks like this is a result of truffle not updating the contract artifacts in the build folder.

I've had a couple gotcha's like this and found that compiling with truffle migrate --reset can help

0

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.