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 ...
Piper Merriam's user avatar
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 ...
Tjaden Hess's user avatar
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's user avatar
  • 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 ...
Piper Merriam's user avatar
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 ...
BokkyPooBah's user avatar
  • 40.3k
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 ...
Tjaden Hess's user avatar
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 ...
BokkyPooBah's user avatar
  • 40.3k
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 ...
jayD's user avatar
  • 2,462
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's user avatar
  • 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 ...
Tjaden Hess's user avatar
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:...
Eleven 's user avatar
  • 113
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]})
Richard Horrocks's user avatar
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( ...
Rahul Sharma's user avatar
  • 1,303
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 ...
Ender's user avatar
  • 265
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
TonyB's user avatar
  • 31
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 ...
Badr Bellaj's user avatar
  • 18.8k
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 ...
shiso's user avatar
  • 1,036
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's user avatar
  • 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 ...
BokkyPooBah's user avatar
  • 40.3k
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 ...
Jus12's user avatar
  • 356
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 ...
praveen kumar's user avatar
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 ...
SCBuergel's user avatar
  • 8,774
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.
ygnr's user avatar
  • 56
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 ...
carver's user avatar
  • 6,381
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 ...
Juan Ignacio Pérez Sacristán's user avatar
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 ...
Sergeon's user avatar
  • 396
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 ...
bortzmeyer's user avatar
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 ...
BokkyPooBah's user avatar
  • 40.3k
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 ...
Sevasoft's user avatar
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 ...
BokkyPooBah's user avatar
  • 40.3k

Only top scored, non community-wiki answers of a minimum length are eligible