Most Popular

1500 questions
16
votes
1 answer

Getting the wrong address back from ecrecover

When I sign a string using the following code I get back a different address to the one I signed with. The address returned is different for different strings. const util = require('ethereumjs-util') const msg = web3.sha3('hello!'); const sig =…
Joe
  • 1,173
  • 1
  • 11
  • 31
16
votes
4 answers

What design patterns are appropriate for data structure modification within Ethereum smart contracts?

I am looking to hear about design patterns that people have implemented within Ethereum smart contracts to allow for post deploy modification of data structures. For example, say I have a contract which contains a struct defining an Address. Should…
Thomas Clowes
  • 4,385
  • 2
  • 19
  • 43
16
votes
1 answer

Connecting to hosted web3 provider from NodeJS backend

I'm using these instructions from etherchain. Here's a similar question(seems like duplicate, but it's not). The solution provided there doesn't work for me, because I don't have a local ethereum client to connect to. I want to use one provided by…
manidos
  • 4,298
  • 3
  • 31
  • 55
16
votes
3 answers

What is formal verification, and why is it important for smart contracts?

"Formal verification" has appeared in various previous questions and answers, and I believe was the topic for one of the talks at DevCon2. Main question: It's perhaps quite broad, but what is formal verification in the context of Ethereum, and why…
Richard Horrocks
  • 37,835
  • 13
  • 87
  • 144
16
votes
1 answer

Sending transactions after London Fork considering EIP 1559

I have an application that sends legacy transactions containing to, from, gasPrice, gasLimit, value and data properties. I know that following the London Fork there is backward compatibility with legacy transactions, however, in order to prepare and…
Darren Jensen
  • 545
  • 4
  • 12
16
votes
1 answer

Why were empty accounts allowed to be on the blockchain?

It's hard to see what the benefits of allowing empty accounts to be on the blockchain are. This was a known subtlety (see "note: there is a difference between zero-balance and nonexistent") and exploited by a "state-bloat" attack. What were the…
eth
  • 85,679
  • 53
  • 285
  • 406
15
votes
2 answers

How can ERC20 token implementations be verified?

The ERC20 Token Standard is great, in that it allows wallets, exchanges, and client implementations to allow users to interface with a variety of tokens in a common way. But how can one of these clients verify that the underlying implementation of a…
thedob
  • 615
  • 1
  • 6
  • 7
15
votes
1 answer

Understanding OpenZeppelin's Context contract

I'm new to solidity and trying to understand OpenZeppelin's Context contract. At the time of writing, the documentation says: While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner,…
ChubbyAvocado
  • 185
  • 1
  • 4
15
votes
4 answers

Is there an Infura equivalent for BSC?

I am new to infura and was wondering how people interact with other smart chains. Is there an equivalent service like infura for the Binance Smart Chain? Or can you still use infura for BSC?
YulePale
  • 1,843
  • 3
  • 19
  • 46
15
votes
2 answers

Calling debug_traceTransaction from web3 API

I want to use debug.traceTransaction to get internal transactions from NodeJS using web3 API. I'm using web3 0.17 beta and I don't see any debug_traceTransaction on the code. Am I missing something or I have to call directly to the RPC?
Paul Exchange
  • 2,723
  • 3
  • 21
  • 26
15
votes
1 answer

Struct not being stored in mapping when it contains more than two 'string' properties. Bug?

I am playing around with Solidity, and have encountered an extremely bemusing issue. I want to have a mapping of Address instances (postal addresses NOT the address type) Address is a custom defined struct as follows: //Struct representing a postal…
Thomas Clowes
  • 4,385
  • 2
  • 19
  • 43
15
votes
9 answers

Error: [ethjs-query] while formatting outputs from RPC: "message":"invalid sender"

I'm using MetaMask with an app I'm developing, and previously working functions are now returning a quite ferocious error. This error has been duplicated on a number of functions in the platform, so I won't provide specific code to any given…
The Renaissance
  • 2,749
  • 1
  • 17
  • 45
15
votes
2 answers

When a smart contract is deployed, is its source code publicly viewable?

When a smart contract is deployed to the blockchain, is the source code then publicly viewable to all participants? For example, what you see here in Etherchain. I am aware that there are some contracts in there with source code provided as no, but…
jsquaredlau
  • 185
  • 5
15
votes
2 answers

ERC20 Tokens with Rewards?

How hard is it to implement rewards into ERC20 Tokens? By this I mean a ERC20 Token that receives a reward in the form of Ether from a rewardAccount that is distributed evenly between all tokens. After some basic searching I found this question: How…
milkywaymasta
  • 311
  • 2
  • 7
15
votes
2 answers

Is Chainlink's price reference data free to consume?

I was looking at feeds.chain.link and it's not immediately obvious if anyone can tap into all these price feeds without incurring a cost: For instance, I did find the ETH/USD aggregator contract, which has a "latestAnswer" property that anyone can…
Paul Razvan Berg
  • 17,902
  • 6
  • 73
  • 143