Hot answers tagged

4

you have to configure a new network to connect to via Metamask open Metamask go to settings > network > add network ! and there add your new network if it's a local node in RPC URL put: http://127.0.0.1:7545 and chose a name for it and save then go on the top menu of Metamask and choose your newly created network to be the host of the communication and that'...


2

An invalid opcode exception typically implies either one of the following two scenarios: An assert(cond) statement with cond == false An array[i] expression with i >= array.length You don't have any assert statements in your code, so you should start by looking into every x[y] statement. However, some of those statements in your code are with x being a ...


1

I got a little lost in it, in part because we can't see the whole thing and in part because the data structure is leading to convoluted code. You eluded to that. Btw. I realize that arrays are a terrible data structure for what I'm trying to do to begin with. If Solidity has better data structures available (like a binary heap for starters), please let ...


1

They are approximately the same. Your fixed-size array lays out a very large address space where every possible address equivalent has a slot. That's logically equivalent to what mapping does, although laid out differently (See Ismael's comment below) and slight different in gas cost as a result. I would incline to the mapping for readability. Solidity ...


1

UPDATE: The answer below refers to the difference between: a mapping(address => uint) an array of struct {address key; uint value;} elements Which is not what's being asked here. I'm leaving it here because I feel that it still contributes something in the context of this question... I hope that this table answers your question: |----------------|---...


1

Ethereum and others are protocols. The protocols are silent on implementation details such as language and physical storage. Ethereum is perhaps the truest to this ideal in that they released multiple clients on day 1 (go, c++). Among other things, this helped ensure that the protocol spec was authoritative and no implementation quirks would rise to the ...


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