Most Popular
1500 questions
13
votes
4 answers
Solidity initialize memory array of fixed size
Using solidity 0.4.15, there is a function that takes a number and returns array of fixed length called traits:
function splitN(uint256 n) constant returns (uint8[12]) {
uint8[12] memory traits = new uint8[12];
// alter values in traits ...
…
Fabiano Soriani
- 385
- 1
- 4
- 13
13
votes
3 answers
How to connect to the Ropsten test-net using web3.js
I want to connect to the Ropsten test-net:
// Is there is an injected web3 instance?
if (typeof web3 !== 'undefined') {
App.web3Provider = web3.currentProvider;
web3 = new Web3(web3.currentProvider);
} else {
// If no…
Stepan Poperechnyi
- 790
- 2
- 9
- 23
13
votes
3 answers
How to get the contract ABI in new Remix IDE?
Waked up today just to find out the remix browser interface changed to this
what happened !!? I cannot find the contract details to get the json interface anymore.
Jose Victor
- 175
- 1
- 1
- 10
13
votes
2 answers
How to load Solidity source file into geth
Is it possible to load Solidity source file .sol file to go-ethereum.
I am using the 'loadScript' method by saving a .js file like the following and loads it.
source = "contract test {\n" +
" /// @notice will multiply `a` by 7.\n" +
" function…
niksmac
- 9,673
- 2
- 40
- 72
13
votes
2 answers
Local variable and state variable, and the difference between them
I am new to solidity. When I read the solidity documentation, it says local variable and state variable. But I can't find the definition of the two terms.
Can anyone explain the meaning of local variable and state variable, and the difference…
dingdang
- 175
- 1
- 2
- 7
13
votes
4 answers
With a ring signature mixer, will Ethereum transactions be completely anonymous?
I was reading the Serenity PoC2. The part quoted below grabbed my attention.
Does it imply full anonymity for Ethereum transactions should I decide to use the ring signature mixer?
Ring signature mixer – part of the test.py script now includes…
euri10
- 4,640
- 5
- 24
- 55
13
votes
2 answers
Convert with JS a Solidity bytes32 to a Solidity string
I have functions which are forced to return a bytes32 object, but then in my webapp I need to reconvert them to a classic string. How can I do that?
arodriguezdonaire
- 3,027
- 3
- 20
- 37
13
votes
2 answers
What is the difference between a static node and a trusted node?
In the docs, static nodes are described as
Geth supports a feature called static nodes if you have certain peers you always want to connect to. Static nodes are re-connected on disconnects.
There is a /static-nodes.json and a…
tayvano
- 15,961
- 4
- 45
- 74
13
votes
2 answers
What if two ether functions have the same signature?
It should not be hard to find collision.
There is only 4 294 967 296 possible signatures.
gkucmierz
- 773
- 2
- 8
- 15
13
votes
7 answers
How to get value of a contract public property using web3.eth
using web3 javascript library how do you get the current value of a public property. e.g.
contract MyContract {
address public owner;
...
}
Here's a snippet of the abi:
[{
"constant": true,
"inputs": [],
"name": "owner",
"outputs":…
mkaj
- 517
- 3
- 6
- 15
13
votes
1 answer
Usage of "storage" and "memory" keywords in struct declaration
I have recently ported my code to solidity 0.4.11 and have been noticing some warning errors upon declaring 'string' variables while declaring structs.
struct person {
string name;
string physicalAddress;
}
the warning I have been getting…
skarred14
- 945
- 1
- 9
- 18
13
votes
4 answers
"SyntaxError: Unexpected token import" on truffle test
I get an "SyntaxError: Unexpected token import" error when I do 'truffle test'. I am trying to import a function declared in another file into the java-script test file. I have been searching about this issue for quite sometime and couldn't find any…
trivikramak
- 440
- 3
- 14
13
votes
2 answers
Why do `throw` and `revert()` create different bytecodes?
throw and revert() are both compiling to the revert operation (opcode 0xfd). According to the docs:
The throw keyword can also be used as an alternative to revert().
Why is it then that the following contract
contract test {
function () {
…
SCBuergel
- 8,774
- 7
- 38
- 69
13
votes
1 answer
How to make external contract function calls from one contract to another?
I'm having a hard time understanding the documentation for making an external function call from one contract to another. In this tutorial there is an example:
contract InfoFeed {
function info() returns (uint ret) { return 42; }
}
contract…
Anandamide
- 445
- 3
- 10
13
votes
5 answers
What is an Ethereum contract?
Ethereum is described as using and enabling the creation of "Smart Contracts", sometimes called just "contracts". But what is an Ethereum contract? Is it a legal document, or something else?
Jeff Coleman
- 22,059
- 17
- 77
- 91