Most Popular
1500 questions
18
votes
4 answers
How to unit test contract private and internal functions?
How can we unit test contract private functions using the Truffle framework?
Since Solidity doesn't have package access or reflection language features, standard private testing approaches don't work.
Creating a test contract which inherits from the…
Daniel Que
- 783
- 7
- 21
18
votes
2 answers
Contract reading a string returned by another contract
I have 2 contracts, Parents and Child which has a public string variable - name.
contract Child {
string public name;
function child (string _name){
name = _name;
}
}
Parents needs to get that name:
contract Parents {
string…
shultz
- 1,091
- 2
- 13
- 20
18
votes
3 answers
How can I get my accounts into metamask or vice versa?
I need my accounts in Metamask to match my local machine so I can deploy from the machine (using truffle), and test in a browser. How can I either:
Upload my local geth accounts to Metamask
Bring my Metamask keys into geth
Truffle seems to…
ZMitton
- 2,750
- 4
- 19
- 34
18
votes
5 answers
Etherscan API - Get all token balances
Is there a way with the Etherscan API you can get all the erc20 token balances for a specific address?
As explained here, you can see token balances with their web UI (the token tracker dropdown).
Does their API provide equivalent functionality?
As…
phoebus
- 315
- 1
- 3
- 8
18
votes
1 answer
How to clear large arrays without blowing the gas limit?
As posted by redditor ethererik in the post GovernMental's 1100 ETH jackpot payout is stuck because it uses too much gas, 1,100 ethers are stuck in limbo because the payout of this GovernMental pyramid scheme requires the clearing out of the arrays…
BokkyPooBah
- 40,274
- 14
- 123
- 193
18
votes
1 answer
What is the difference between Casper and Tendermint
Both are consensus protocols that fall under the category proof of stake. However - they differ in some design goals. Casper favors availability over consistency in comparison to Tendermint. What does this mean?
mKoeppelmann
- 7,616
- 8
- 36
- 48
18
votes
2 answers
In Mist browser how can I move the data (blockchain) to another drive on Mac OSX?
My Mac "System" drive is almost full. As I actually have two drives, I want to move the blockchain from the default location to the second drive.
How can I do it ?
Maksim Ravnovesov
- 389
- 1
- 3
- 11
18
votes
2 answers
What does bytecode of blank contract do?
When I compile a blank contract:
contract A {}
with
solc --optimize --optimize-runs 300000 --opcodes test.sol
I get:
PUSH1 0x60 PUSH1 0x40 MSTORE PUSH1 0x6 DUP1 PUSH1 0x10 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN PUSH1 0x60 PUSH1 0x40 MSTORE STOP
What…
Brian
- 243
- 1
- 7
18
votes
5 answers
How will regular users be able to use dApps without buying ether?
Requiring users to get ether before they can use a dApp, is too much of a barrier for any kind of mainstream adoption. If dApps offer free ether in a naive way, they can be attacked by Sybils where a user just creates many "accounts" to get the…
eth
- 85,679
- 53
- 285
- 406
18
votes
5 answers
Is there any Ether mixer / tumbler available?
Quick checking around there are exactly two references to an Ether Mixer - this non functioning and here (r/ethereum) 24 days ago.
Unless I am missing something how can I hide the source of an ETH transfer? I have a couple of Genesis block pre sale…
steganographic
- 238
- 1
- 2
- 8
18
votes
1 answer
Inheritance and Function Overwriting: Who can call the parent function?
I want to know who is still able to call an original overwritten function in case of inheritance.
Let's assume I have the following setup:
contract A{
address public owner;
function A(){
owner = msg.sender;
}
function…
SmCaterpillar
- 499
- 3
- 12
18
votes
2 answers
What is the reason for writing truffle tests in .sol and .js files?
What is the reason that tests can be written in both? Is there any distinct advantage to using one over the other?
Or is one in general easy to work with?
dave kajpust
- 441
- 3
- 8
18
votes
4 answers
web3.js import contract abi from .json file
So I have a deployed contract with address0. I can easily interact with it using my index.html like so:
import contract_artifacts from '../../build/contracts/contract.json'
var contract0 = contract(contract_artifacts);
Then I can call it's…
porfavorite
- 511
- 1
- 5
- 14
18
votes
2 answers
web3.eth.sendRawTransaction: cannot unmarshal hex string without 0x prefix
When I call sendRawTransaction, I got
"[Error: invalid argument 0: json: cannot unmarshal hex string without
0x prefix into Go value of type hexutil.Bytes]"
I think all of params have "0x" prefix. Could you share your ideas how to fix it?
I'm…
zono
- 1,473
- 5
- 17
- 30
18
votes
3 answers
Etherscan: How can I verify a contract with multiple imports deployed with Truffle?
When I deploy a contract with Truffle that has an import statement, and try to verify it on etherscan, my understanding is that I need to paste in the contents of the imported file.
I get an error on etherscan that the bytecodes of the concatenated…
Travis Jacobs
- 1,535
- 1
- 13
- 25