Most Popular

1500 questions
36
votes
10 answers

How can you handle an expected throw in a contract test using truffle and ethereum-testRPC?

Is it possible to write a test using truffle that attempts to confirm that a throw occurs in a contract? For example, if I had a contract with function... contract TestContract { function testThrow() { throw; } } if I write a test in…
thedob
  • 615
  • 1
  • 6
  • 7
36
votes
8 answers

Insufficient funds for gas * price + value

Sending Address has over 1 Eth in current Balance. Using the Geth console, I can send many transactions of any amount less than .033 eth.sendTransaction({to:'0x8B9da75fda99bAd680154050Ba386523CA3AD112',…
John Heeter
  • 521
  • 1
  • 4
  • 5
36
votes
9 answers

How to get transactions by account using web3 js?

I'm sure this question was asked before, but I did not find any result that helped my problem. How can I get the transactions (in and out) for a given account? I use nodejs and web3? With this line I get the number of sent…
Christoph Bergmann
  • 601
  • 1
  • 5
  • 6
36
votes
3 answers

How to explore all transactions for a given account?

After beeing able to check account balances, I am looking for a method to list all transactions for a given Ethereum account through json-rpc protocol. I haven't found any method suitable for that on https://github.com/ethereum/wiki/wiki/JSON-RPC .…
36
votes
1 answer

What is the receive keyword in solidity?

Solidity has a receive keyword. What is it and how do I use it?
Shane Fontaine
  • 18,036
  • 20
  • 54
  • 82
36
votes
6 answers

How to find the date of an Ethereum transaction while parsing it with web3?

Is there a way to know the date of a transaction by looking at the raw blockchain data? I know that Etherscan and other blockchain explorers have dates for the transactions, but I couldn't find a way to do it via web3. web3.eth.getTransaction, and…
user3498
  • 735
  • 2
  • 9
  • 12
36
votes
3 answers

'internal' keyword in a function definition in Solidity

Does the internal keyword in a function definition such as: function doSomeThing(uint _param) internal {...} work similar to designating a method as private in other languages and thus makes the function only callable from within the contract?
Terek Judi
  • 525
  • 1
  • 4
  • 7
36
votes
6 answers

What caused this error: Attempting to run transaction which calls a contract function, but recipient address is not a contract address

I have a contract and a set of mocha tests. I recently switched from using the ethereum client that comes with truffle (the one you get when you run truffle develop) to the ganache-cli. Somehow, in switching back and forth between them, I caused my…
Alex Altair
  • 883
  • 1
  • 7
  • 13
36
votes
2 answers

Can you create a constant (read-only) state variable in Solidity?

Can you declare a constant variable in Solidity? const uint answer = 42; Or is the only way to do it with a const function? function GetAnswer() constant returns(uint ret) { return 42; } I know you could always create a normal public variable…
Raine Revere
  • 3,600
  • 2
  • 23
  • 34
36
votes
3 answers

What is a replay attack?

During the launch of the frontier network, users were cautioned not to reuse keys from the Olympic testnet in order to prevent "replay attacks". What is a replay attack, and why would re-using a key from the testnet make someone vulnerable to one?
Jeff Coleman
  • 22,059
  • 17
  • 77
  • 91
36
votes
6 answers

Can I download the whole blockchain from somewhere?

Bitcoin used to offer sharing/downloading a bootstrap.dat which contains the whole blockchain. Are there alternatives to getting it trickling through the peer-to-peer network? Can I just download it somewhere? Wouldn't this be ideal for distribution…
Donavan Theodor
  • 1,943
  • 3
  • 20
  • 28
36
votes
2 answers

Ethereum ecrecover signature verification and encryption

The question of signing and verifying signatures with Solidity has been asked in these questions, both of which I have tried to study: How can I sign a piece of data with the private key of an Ethereum address? How can I verify a cryptographic…
arik
  • 503
  • 1
  • 4
  • 5
36
votes
5 answers

How to access the event log by knowing the contract address (web3)?

How can I access a log stored in one of the tx of the contract via web3? Code example: event newtest(string indexed name, uint indexed idlevel,string indexed multib, string objmulti, uint objnm); and newtest('test',5,'testj','obj2',30); Let's say…
b1818762
  • 363
  • 1
  • 3
  • 5
36
votes
6 answers

Can't send transaction -- "Exceeds block gas limit" or "Intrinsic gas too low"

I'm trying to send Ether using geth 1.3.5, like this: eth.sendTransaction({ from: eth.accounts[0], to:'0x[ADDRESS_HERE]', value: web3.toWei(5, "ether"), gas:21000 });` And I'm getting "Exceeds block gas limit" When I try: with gas=5000 I…
Dan Sandberg
  • 463
  • 1
  • 4
  • 5
36
votes
3 answers

ERC20 vs ERC223. List of differences

Is there a list of improvements that we will have in ERC223? Are there examples of contracts? Is there a migration path for existing ERC20 tokens?
rstormsf
  • 4,337
  • 2
  • 25
  • 42