Geth version: geth version 1.7.0
OS & Version: Windows 10
Commit hash : (if develop)
Deploy the crowdsale contract in the Ethereum wallet. The code from: https://www.ethereum.org/crowdsale. The code is pragma solidity ^0.4.16.
It won't. It says: Could not compile source code. And then the error stated below this text. Does anybody know how to still deploy a crowdsale?
````
Could not compile source code.
This declaration shadows an existing declaration.
event GoalReached(address beneficiary, uint amountRaised);
^-----------------^
````
Geth has little to do with compiling smart contracts. The crowdsale contract is old and the solidity language and compiler has evolved quit a bit. So that is probably why you get these issues. When I copied the crowdsale contract into remix (remix.ethereum.org) it raises several warnings but no errors. I assume that the javascript solidity compiler that is loaded in Mist/wallet treats all warnings as errors or is an older version of browser solidity that contains a bug.
The best way to solve this is to ask the question in the Mist repo that can be found here https://github.com/ethereum/mist. Maybe they need to upgrade to the latest solidity version.
Same problem. It's not just the mist, but ethereum-wallet too. Using the latest version of EW and Gist.
This is a bit of a problem when the sample code provided won't compile. How the heck do I learn this correctly if the samples are faulty in Mist?
@fjl please reopen this issue. Same problem. Watch @wrisx comment.
@dansterling1 @Kowmung @gevglevskiy @dansterling1 @wrisx
Has anyone resolved this?
Used the same code from the ethereum website on the latest ethereum wallet and receiving same error.
yep, here is the solution: just rename the two variables (address beneficiary, uint amountRaised); to different names, for example: (address _beneficiary, uint _amountRaised), and it'll compile fine.
The example code on the site needs to be updated by the maintainers of course.
When I do the solution of wrisx it does work only it gives this error:
Identifier not found or not unique.
event GoalReached(address_beneficiary, unit_amountRaised);
^-----------------^
How do I get past it?
You need a space before the dash:
address _beneficiary...
Then still:
Identifier not found or not unique.
event GoalReached(address _beneficiary, unit _amountRaised);
^--^
Oww typo unint. Thanks
Most helpful comment
yep, here is the solution: just rename the two variables (address beneficiary, uint amountRaised); to different names, for example: (address _beneficiary, uint _amountRaised), and it'll compile fine.
The example code on the site needs to be updated by the maintainers of course.