Most Popular

1500 questions
19
votes
2 answers

Can a contract access another contract's storage?

I have a contract with numerous complex structs. Is it possible for a second contract to iterate over this data directly? I can't really use public accessor/getter methods as it's not possible to use structs externally, so I would have to flatten…
slothbag
  • 433
  • 3
  • 10
19
votes
4 answers

Is it possible to check string variable's length inside the contract?

I want to sent a string as an argument to a function. But some user may enter maybe 100 size string or even larger. [Q] Inside the function is it possible to check the size of the string and return false if it exceeds the length limit that I have…
alper
  • 8,395
  • 11
  • 63
  • 152
19
votes
3 answers

Summary and history of the Ethereum hard forks

The question Please confirm what the hard forks of Ethereum were and when they took place was asked on Reddit by u/Tykerr.
BokkyPooBah
  • 40,274
  • 14
  • 123
  • 193
19
votes
5 answers

'Error: base fee exceeds gas limit' When creating new contract instance (Using Truffle, Web3Js and testrpc)

I have the following code in app.js file of my truffle project. import { default as Web3} from 'web3'; import { default as contract } from 'truffle-contract' import conferrence_artifacts from '../../build/contracts/Conferrence.json' var web3 = new…
Devendra Chouhan
  • 391
  • 1
  • 3
  • 10
19
votes
2 answers

How to access external knowledge / data in a smart contract

let’s say a contract wants to execute on knowledge contained outside the blockchain (e.g. whats the price of gold, what was the avg windspeed in NYC, how many people moved to portland in the last week) — what are common ways a contract might…
dougvk
  • 293
  • 2
  • 5
19
votes
2 answers

How to pass constructor parameters to a contract using Truffle?

I am using testrpc and truffle for deploying contracts.I want to pass constructor parameters while deploying. contract User { string public userName; function User(string _name) { userName=_name; …
Crissi Mariam Robert
  • 1,174
  • 1
  • 9
  • 25
19
votes
3 answers

Accessing past values of Smart Contract variables

I would like to know if is possible to inquiry variable values using older blocks. For example I have contract Simple { string32 message public; function Simple() { message = msg.sender; } } Is it possible to retrieve the value…
croll83
  • 193
  • 1
  • 5
19
votes
2 answers

What is embark?

What is the embark framework? Who can use it, who should use it? And what are the benefits?
q9f
  • 32,913
  • 47
  • 156
  • 395
18
votes
1 answer

How to read public variable from contract using ethers.js

I am trying to read public variable from contract on chain using ethers.js. Calling the methods work but I could not manage to read public property (without getter). The methods works like this: const ethers = require('ethers'); const provider = new…
senty
  • 297
  • 1
  • 2
  • 8
18
votes
6 answers

How can I recover or reset a lost wallet password?

Let's say that a user has lost or forgotten their password. Is there a way to reset the password or recover it?
Ethan Wilding
  • 4,821
  • 7
  • 24
  • 31
18
votes
1 answer

What is the difference between testRPC and geth?

I wonder what is the difference between testRPC and geth (on private network) because, they both can create: blockchains nodes accounts The "only" difference I see, is that the testRPC has almost unlimited Ether, which makes the mining process…
FrenchieiSverige
  • 1,498
  • 1
  • 12
  • 23
18
votes
1 answer

Concealing sensitive data in a public contract

I have some sensitive data I'd like to keep in my contract in privacy. I'd like to make a simple version of Zero-Knowledge Proofs and have an idea in mind. Let's say I have a customer who filled out 6 fields in my dapp: First Name as attr1 Last…
Igor Barinov
  • 2,138
  • 1
  • 16
  • 25
18
votes
2 answers

How can I check if a contract has self-destructed in Solidity?

I have got a problem: I have a contract factory that creates some temporary contracts. I want every contract to exist for about 5 days, afterwards, it self-destructs. However, I want to create a directory that stores the addresses of all temporary…
Bot X
  • 245
  • 2
  • 6
18
votes
1 answer

What does Solidity's "call" function mean?

address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2; nameReg.call("register", "MyName"); //1 nameReg.call(bytes4(sha3("fun(uint256)")), a); //2 if(!nameReg.call.value(10)){throw;} //3 Here it says, Furthermore, to interface with…
Jim Green
  • 687
  • 1
  • 5
  • 14
18
votes
2 answers

How much data can I store in a smart contract, what is the cost and how it is implemented?

If I suppose I use a smart contract as a database, how much data can I store? speaking only of strings and integers, save them in contract data structures does it cost in addition to the gas used for the variable store? The contract size must be a…
Chaos
  • 377
  • 1
  • 2
  • 10