29
votes
Accepted
How to unit test smart contracts
Via a Framework
There are currently four primary frameworks available that can facilitate writing unit tests for your contracts. Listed in order of Github stars as of 2016-01-25.
Disclaimer: I'm ...
24
votes
Accepted
What is the purpose of underscores in front of parameters?
There is no semantic difference. It is a style used to differentiate between function arguments and global variables.
In this case, it differentiates between the global variable named greeting and ...
17
votes
Accepted
Do I need a compiled contract just to get the ABI definition?
Seems like the contract address should be enough.
You're right, it would be better if the ABI could be obtained by just looking at the contract.
So why do contract writers need to also provide the ...
eth♦
- 85.6k
16
votes
What is the purpose of underscores in front of parameters?
In most situations the storage variable is going to be used in many more places throughout the contract's code. The function argument may show up in a few places, but in most cases it won't be as ...
16
votes
Accepted
Deploying the Greeter contract via the geth CLI is not registering in my private blockchain
Update Apr 23 2017
geth 1.6.0 has a breaking change to remove access to the Solidity compiler from within geth.
The workaround is detailed in How to compile Solidity contracts within geth with the ...
15
votes
Do I need a compiled contract just to get the ABI definition?
You don't need the source code, just the ABI. The ABI is produced when the code is compiled, but can be, and usually is, distributed separately.
The ABI is essentially just a list of the function ...
9
votes
Accepted
Unable to define greeterContract in the Greeter tutorial. Breaking change in Solidity 0.4.9!
Update Apr 23 2017
geth 1.6.0 has a breaking change to remove access to the Solidity compiler from within geth.
The workaround is detailed in How to compile Solidity contracts within geth with the ...
8
votes
Accepted
Can I compile a smart contract without removing the line breaks?
My advice would be to use the Browser Solidity:
Just copy paste your contract, and if it compiles without errors you can just copy past the content of Web3 deploy:
var _numProposals = /* var of type ...
6
votes
Accepted
Why do some functions from my contract end up in the ABI while others don't?
greeter and mortal are constructors, and like in other languages, only callable once, during instantiation.
eth♦
- 85.6k
5
votes
Accepted
Will contracts on Frontier be wiped before the move to Homestead?
You're correct, this is no longer the case:
Many of the planned Frontier gotchas (which included a chain reset at Homestead, limiting mining rewards to 10%, and centralized checkpointing) were deemed ...
4
votes
Deploying the Greeter contract via the geth CLI is not registering in my private blockchain
I totally follow this guide, but I still did not get the info" contract mined! address: xxx". I add a else{ console.log(e) into var greeter = greeterContract.new(_greeting,{from: eth.accounts[0], data:...
4
votes
Why can't I kill my contract on my private blockchain?
The Greeter tutorial page on the official site clearly states how to run the kill method under the "Cleaning up after yourself" section.
greeter.kill.sendTransaction({from:eth.accounts[0]})
3
votes
After loading the solidity script, i get null [object Object]. What should i do?
I posted this question a week ago and with the help of my peers i was able to solve it. The detailed answer is as follows:
Step 1:
Using the following command start your private blockchain network( ...
3
votes
What is the purpose of underscores in front of parameters?
There is a recommendation from Oyente that
Allow _ at the beginning of the mixed_case match for private variables
and unused parameters.
And says:
mixedCase (differs from CapitalizedWords by ...
3
votes
Can I compile a smart contract without removing the line breaks?
Heres a javascript command that will strip newlines
xmlStr = xmlStr .replace(/\n/gi, ""); // strip newlines
3
votes
Accepted
Smart contact disappears over time?
Nothing disapears, if you have mined your contract (deployed in the blockchain) as in the mentioned tutorial you need to have its address to call it anytime you want.
in the tuto you have :
var ...
2
votes
Unable to make greeter contract
I think you meant to say that your account has ether in it, not ethereum.
My first guess is that you don't have enough ether. Try
web3.fromWei(eth.getBalance(eth.coinbase),'ether')
You might ...
2
votes
Accepted
What is an 'uDApp'?
A uDApp is short for Universal DApp and is described as "A Universal Interface for contracts on the Ethereum blockchain".
As the project hasn't been maintained for 5 months and the demo is currently ...
eth♦
- 85.6k
2
votes
Accepted
Why is my Greeter contract not mined on --testnet?
Here's a step-by-step guide of deploying and running Greeter on Testnet.
I you do not already have a coinbase account, run the following command:
user@Kumquat:~$ geth --testnet account new
Your new ...
2
votes
Unable to define greeterContract in the Greeter tutorial. Breaking change in Solidity 0.4.9!
There are still more breaking changes in the newest Solidity. I used the following to fix my error in 0.4.9 latest commit.
You need to copy the filename from the compiled code. In my example, this is ...
1
vote
How to interact with a greeter contract?
Generally there will be one node which initiates the contract.
and when it is mined, the contract would be added to the blockchain which returns a contract address.
The peer nodes which are ...
1
vote
Contract Greeter - Windows - Browser solidity
Welcome to Ethereum - a world of dragons and tools that constantly outpace any documentation.
I would suggest that you start playing with smart contracts (e.g. the greeter) only in the browser using ...
1
vote
Greeter Contract - deploy command results in "undefined"
Variable declarations will return undefined. Its not an error.
In order to get contract address you need to mine in your private network. Make sure that your are mining.
1
vote
Accepted
On Populus I am unable to make Basic Testing (Greeter Contract) work due to py.test
Just adding the answer from the above comments, so that this question can be closed:
sudo pip install --upgrade populus should solve this problem. Although no one is likely to have this specific ...
1
vote
Instantiate a deployed Smart Contract
I think I found what was the problem: lack of double quotes.
When instantiating the Smart Contract using the literal ABI from https://ethereum.github.io/browser-solidity/ everything works!
> var ...
1
vote
How i can access the contract functions (After run compiling the contract source code)
That callback is being called twice, the first time when you send the creation contract transaction and the second when the contract is actually mined and has an address (when the else fires in the ...
1
vote
Why is my Greeter contract not mined on --testnet?
Because you did not add it.
greeter.at("0xXXXXXXXX")
Where XXXX is the address displayed in the console. Then, the greeter will have an address.
If you missed the message in the console, you can ...
1
vote
Accepted
Greeter variables are all undefined and contract doesn't run
Please refer to Deploying the Greeter contract via the geth CLI is not registering in my private blockchain for a step-by-step guide for running the greeter example in your local dev blockchain.
The ...
1
vote
How to unit test smart contracts
Brownie
One of the best blockchain development framework written in Python. It supports native pytest which is able to run unit as well as integration tests.
The whole info on how to write and perfrom ...
1
vote
Unable to make greeter contract
I have just added a step-by-step example of running the greeter example documented in Deploying the Greeter contract via the geth CLI is not registering in my private blockchain .
This guide provides ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
greeter × 28go-ethereum × 12
contract-deployment × 10
solidity × 6
contract-development × 6
private-blockchain × 4
contract-invocation × 3
abi × 3
transactions × 2
blockchain × 2
remix × 2
web3js × 1
contract-design × 1
mining × 1
dapps × 1
etherscan × 1
dapp-development × 1
contract-debugging × 1
web3.py × 1
storage × 1
testing × 1
golang × 1
compilation × 1
ubuntu × 1
homestead × 1