Most Popular
1500 questions
17
votes
1 answer
truffle migrate: How to deploy a contract whose constructor takes a parameter
I'm using Truffle Version 4 to develop a simple smart contract and am stuck on something I think reflects a very basic misunderstanding that I just can't get my head around.
Here's my simple contract, in contracts/BaconSupplier.sol
contract…
Dave Sag
- 879
- 1
- 11
- 22
17
votes
2 answers
does revert()/require() revert changes made to other contracts?
Let's say I call functions from several external contracts in a function and check for their return values (given the fact they return a bool) either with require() or revert().
Pseudocode:
function storeDataInDifferentContracts() {
…
Daniel Gretzke
- 1,279
- 1
- 9
- 23
17
votes
5 answers
How do you verify a contract on etherscan that is deployed by another contract?
How do you properly verify a contract on etherscan that is deployed by another contact?
I deployed a contract that deploys other contracts onto the blockchain.
The original contract is verified , however when that contract deploys contract onto the…
Dino Anastos
- 847
- 1
- 13
- 22
17
votes
3 answers
How can you share a struct definition between contracts in separate files?
I can't declare a stand-alone struct in its own file, what gives?
pfrank
- 696
- 1
- 6
- 13
17
votes
2 answers
How do I control compiler settings with truffle?
I'm using truffle development environment for prototype contract development and I need to change compiler setting (e.g. turn optimization on and off).
The documentation for the development environment does not say how to control the compiler…
Paul S
- 4,271
- 1
- 22
- 48
17
votes
1 answer
Solidity: private vs public variables
In a smart contract, if we make a member variable public:
Question 1: Can a malicious party write a transaction/contract and change the value/state of the public variable in the contract?
Question 2: Would the problem be solved by only turning…
Aydin
- 2,117
- 6
- 25
- 41
17
votes
4 answers
What are the best practices to allow user signup and login for a dapp?
From what I have researched, it seems that all of the methods for allowing a user to signup and login for an Ethereum dapp are very cumbersome for the user to use. What are the best practices to allow signup and login that match the following…
Jason Cochran
- 337
- 4
- 15
17
votes
6 answers
Elegant way to detect current provider int web3.js
I want to know what provider the user is using (Metamaks, Mist...)so I can give better user experience. E.g. Give tips on how to unlock an account
I'm currently doing this, but is far from elegant. Is there a more correct/reliable way achieve the…
xavivives
- 171
- 1
- 1
- 4
17
votes
1 answer
what is the difference between hard cap and soft cap in ethereum ICO
Please someone provide me details about the hard cap and soft cap in ICO. I have to build an ICO with an hard cap. How do I implement it in a smart contract using solidity? Provide me concept behind the hard cap so I will implement the same in a…
Satyam Agrawal
- 775
- 1
- 8
- 19
17
votes
2 answers
Multiple Inheritance and Linearization
Hello to everyone. I am looking at multiple inheritance in Solidity. I came across this example within their documentation, but it is not understandable enought for me.
Can someone explane this sentence in more detail:
The reason for this is that…
branko terzic
- 473
- 4
- 12
17
votes
2 answers
Decimals on ERC20 Tokens
I'm having an odd problem working with some ERC20 token contracts I've written:
When I specify a decimal value, let's say 4 here for simplicity, the values show up differently in Mist vs etherscan.
For example, if I create a token with a supply of…
Davis Jef
- 171
- 1
- 1
- 4
17
votes
4 answers
How to calculate transaction fee?
For calculating the transaction fee using web3js I am using it's gas price:
eth.getTransaction("txhash").gasPrice
multiplied by how much gas was actually used:
eth.getTransactionReceipt("txhash").gasUsed
Is it correct? Is there a simpler way?
DeV1doR
- 617
- 1
- 6
- 14
17
votes
1 answer
now keyword in Solidity
I was unable to find any relevant documentation for the now keyword within the Solidity documentation, other than its usage in examples. What exactly does the now keyword return, how is it determined and what are the associated gas costs? I assume…
Michael
- 1,065
- 2
- 9
- 8
17
votes
3 answers
'authentication needed: password or unlock' Error when trying to call smart contract method via web3
I am trying to call the smart contract method (deployed on remote ethereum account) from my nodejs DAPP, and getting the following error-
Error: authentication needed: password or unlock
at Object.InvalidResponse…
rsingh
- 171
- 1
- 1
- 3
17
votes
6 answers
Is there the start/stop script of geth after Debian/Ubuntu booting?
Is there any start/stop shell script for geth which is executed after Debian or Ubuntu OS boot up?
For example, startup scripts usually located under
/etc/init.d/
/etc/rc.local
Satoshi Nakanishi
- 5,749
- 7
- 38
- 57