public address variable causes BadFunctionCall exception

2018-04-16 14:55:03

See the contracts at the bottom. You will notice that the contracts are identical, except that the first contract's authority field is marked public, while the second isn't.

The second contract works fine. I can call hash(), test(), whatever, and everything works as expected.

However, nothing works with the first contract. I can use neither call() nor transact() on any function (although estimateGas() works fine). Instead, I get the following error:

eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes. Only got 0 bytes

web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced?

I'm not sure what the problem is, can anyone enlighten me? Here are the contracts:

contract Award {

address public authority;

string public hash;

bool itWorked = false;

mapping(address => bool) users;

function Award(string _hash) public {

authority = msg.sender;