Solidity: Basic Crowdfunding contract from eth tutorial problem

Created on 10 Aug 2017  路  4Comments  路  Source: ethereum/solidity

hello, newbie here with some basic programming knowledge here.
I created my own token, now I want to add crowdfunding contract to it. I get this error when copying code from official tutorial.
Using the latest ethereum mist and solidity 0.4.2

Unused local variable
contract token { function transfer(address receiver, uint amount){  } }

This is the code:

pragma solidity ^0.4.2;
contract token { function transfer(address receiver, uint amount){  } }

contract Crowdsale {
    address public beneficiary;
    uint public fundingGoal; uint public amountRaised; uint public deadline; uint public price;
    token public tokenReward;
    mapping(address => uint256) public balanceOf;
    ...

Thank you for your help! :)

Most helpful comment

The two variables address receiver, uint amount are not used in the code, please remove their names and just leave their types:

contract token { function transfer(address, uint){  } }

All 4 comments

The two variables address receiver, uint amount are not used in the code, please remove their names and just leave their types:

contract token { function transfer(address, uint){  } }

@alexvandesande is there a way to show warnings as warnings in Mist? They are currently treated as errors. This has come up quite a few times so far.

Perhaps with a tick box for "treat warnings as errors", which is on by default and turning it off shows a giant red popup message :)

@axic you're correct I will fix that

Tracked in https://github.com/ethereum/mist/issues/2797.

@alexvandesande apparently I've created an issue a while ago :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leviadam picture leviadam  路  4Comments

area picture area  路  3Comments

hiqua picture hiqua  路  4Comments

bshastry picture bshastry  路  3Comments

axic picture axic  路  3Comments