A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Hot answers tagged

2

You can avoid the modifier and the hashing. It is simpler to do: function set(uint _index, string calldata _data_to_store) external { require(bytes(storedData[_index]).length == 0); storedData[_index] = _data_to_store; } Checking the length of the bytes was inspired by this answer.


1

The error message is misleading. You can safely disregard it since you aren't calling the constructor or sending funds. It's a lot of code to wade through so this won't be very specific. You say this seems to be the issue: request.recipient.transfer(request.value); The most likely cause is the contract doesn't have sufficient funds to make that happen. ...


1

Your technical mistake is that uint[] memory count is not initialized, so any access attempt of the sort count[number] or count[i] will naturally cause your function to revert; you must find the maximum value in the input array, and then initialize count = new uint[](maxInputValue + 1). Your logical mistake is that instead of this: if (count[number] > ...


1

0x147 ... is going to the constructor and ultimately to wallet in the code. 0xCA3 ... is msg.sender 0x692 ... is the contract. Remix looks after that for you, but raw transactions would be to the contract, from: 0xCA3 ... and about 0x147 ... which is being passed as msg.data and unpacked by functions like buy() ... { which uses it. Hope it helps. ...


1

Expand the transaction receipt to see the log. Hope it helps.


1

What is the difference between the 3 addresses? Account: the account that you are currently using in order to execute transactions (i.e., deploy contracts and/or call contract functions); It has to be unlocked on your environment Deploy _wallet: the input argument that you need to pass to the constructor of contract MyContractEtherEvents in order to deploy ...


1

The increment people count is added before adding the person to the mapping. So nothing is added to the people[ 1 ] spot in the mapping. As is, the first spot in the mapping that gets filled is people[ 0 ]. Move incrementCount() to after adding the person to the mapping.


1

I am pasting the solution here that i got as a response from the slack channel, almost verbatim. By default, EthereumJS-Tx signs for the Ethereum Mainnet. Transactions made for custom networks have some of their values changes, and this needs to be taken into account when signing the transactions. What has happened here is we have signed the transaction ...


1

First of all, you are using People, while the name of your variable is people. Second, you can call push on an array, but you are trying to call it on an array element. In short, replace this: People[0].push(...); With this: people.push(...);


1

Person is declared as an array of structure having a variable people. But with ‘people’ we are not using square brackets. Is this not required in Solidity? When can we use square brackets with 'people'? That's wrong, Person is just a structure type name; Person[] people is an array of structures. You typically use square brackets in Solidity when you want ...


Only top voted, non community-wiki answers of a minimum length are eligible