Raine Revere
  • Member for 5 years, 9 months
  • Last seen more than a month ago
Can you create a constant (read-only) state variable in Solidity?
Accepted answer
42 votes

Found the answer: State variables can be declared as constant (this is not yet implemented for array and struct types and not possible for mapping types). contract C { uint constant x = 32*...

View answer
How does Solidity's sha3 / keccak256 hash uints?
Accepted answer
28 votes

Jehan's answer is great, but we need to explain one more thing: Why does sha3(1) in solidity produce b10e2d...fa0cf6? This is because solidity's sha3 function hashes its inputs based on the argument ...

View answer
Are funds returned if one transfers from an exchange to an invalid Ethereum address?
Accepted answer
9 votes

Depends on "how" invalid it is. If you send ether to a public address that does not exist (i.e. nobody has the private key for), assuming that the format of the address is correct (hex, correct ...

View answer
How can a factory contract clone the bytecode of an existing contract?
Accepted answer
8 votes

Martin Holst Swende published an implementation of a cloner contract here! https://gist.github.com/holiman/069de8d056a531575d2b786df3345665 Excerpt: function clone(address a) returns(address){ /...

View answer
web3: Do I need to `get` past events and `watch` future events separately?
Accepted answer
4 votes

Semantically, past events are a finite list, while future events are an infinite list (i.e. stream). The latter can encompass the former, but not the other way around, i.e. you could represent all ...

View answer
Mix: In the sample project, where is the "contracts" JS global defined?
Accepted answer
4 votes

Mix automatically generates the contracts array for you. You can manually create contract objects with code like the following: var MyContract = web3.eth.contract(abiArray); // instantiate by ...

View answer
.new() does not work in jQuery click handler
Accepted answer
2 votes

The default behavior of a button click is to submit a form. When you click the link, the page refreshes from the form submit, interrupting the web3 request. Add return false to the end of your click ...

View answer
Is there a Solidity decompiler?
Accepted answer
1 votes

There is no decompiler to Solidity. This is in principle possible to some degree, but for example variable names will be lost and great effort will be necessary to make it look similar to the ...

View answer
Is it possible to do something on a specific block number?
Accepted answer
0 votes

Transactions are not guaranteed to happen on the next block or any future specific block, since it is up to the miners to include transactions and not up to the submitter of the transaction. This ...

View answer