These are chat archives for ethereum/tutorials

21st
Sep 2017
REDEYEFILMS
@REDEYEFILMS
Sep 21 2017 07:26
Hi there... Do u have staff that can help create our coin?
patch083
@patch083
Sep 21 2017 09:38
Total noob question. Trying to run the MyToken tutorial code from website. Get an error Source file requires different compiler version (current compiler is 0.4.13+commit.0fb4cb1a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.4.16;
deepakdunitech
@deepakdunitech
Sep 21 2017 10:11
hi
how to create token
robsuit
@robsuit
Sep 21 2017 19:45
Are Rinkeby Tesnets and regular ETH network running the same versions of ETH??
I copy and pasted a smart contract from regular eth to a testnet wallet and I am getting complier errors. Do I need to include compiler inside of smart contract code? It's a github gist .
shouldn't this smart contract already have a complier inside if it was already an active smart contract. I took the smartcontract code from Etherscan.io and pasted it into my testnet wallet running on metamask
and it won't work .
I can't deploy the contract
if anyoen could help that would be great. thanks
Alex Van de Sande
@alexvandesande
Sep 21 2017 19:48
@robsuit are you using Mist or Remix? What compiler errors?
robsuit
@robsuit
Sep 21 2017 19:49
I'm a noob. Just cut and pasted right for etherscan into my wallet trying to deploy the contract. Did I need to use mist and Remix to compile first??
I thought the wallet had a complier
built in
Alex Van de Sande
@alexvandesande
Sep 21 2017 19:50
Yes it has.
Do you see a URL bar in the top of your app?
robsuit
@robsuit
Sep 21 2017 19:53
app or code?
Alex Van de Sande
@alexvandesande
Sep 21 2017 19:53
Your app. Is it called Ethereum Wallet or Mist?
Also, what contract are you trying to deploy?
GK
@gktown
Sep 21 2017 19:54
Hey guys, I'm looking for a smart contract that can accept multiple erc20 tokens in crowdsale. Do you happen to know a resource I could use?
robsuit
@robsuit
Sep 21 2017 19:54
I'm using https://wallet.ethereum.org as UI for my metamask Rinkeby Testnet
This contract is for distributing funds to multiple wallets while also receiving funds from one wallet
meaning sending funds from 5 wallets and sending it to 1 - then that 1 wallet would distribute tokens back to those 5 wallets in a ratio that matches each wallets contributions
Alex Van de Sande
@alexvandesande
Sep 21 2017 19:57
@robsuit if you are using Metamask then I recommend switching to remix.ethereum.org for contract deployment. The wallet fails in some more complex contracts
robsuit
@robsuit
Sep 21 2017 20:01
I got thanks so much!!!
GO ETH!!!
Alex Van de Sande
@alexvandesande
Sep 21 2017 20:01
:D
jmelendez025
@jmelendez025
Sep 21 2017 21:35
Please Help. I am trying to implement the BlockChain Congress (https://www.ethereum.org/dao), but it seems that the contract has an error
pragma solidity ^0.4.16;

contract owned {
    address public owner;

    function owned() {
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    function transferOwnership(address newOwner) onlyOwner {
        owner = newOwner;
    }
}

contract tokenRecipient {
    event receivedEther(address sender, uint amount);
    event receivedTokens(address _from, uint256 _value, address _token, bytes _extraData);

    function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData){
        Token t = Token(_token);
        require(t.transferFrom(_from, this, _value));
        receivedTokens(_from, _value, _token, _extraData);
    }

    function () payable {
        receivedEther(msg.sender, msg.value);
    }
}

interface Token {
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
}


    // Contract Variables and events
    uint public minimumQuorum;
    uint public debatingPeriodInMinutes;
    int public majorityMargin;
    Proposal[] public proposals;
    uint public numProposals;
    mapping (address => uint) public memberId;
    Member[] public members;

    event ProposalAdded(uint proposalID, address recipient, uint amount, string description);
    event Voted(uint proposalID, bool position, address voter, string justification);
    event ProposalTallied(uint proposalID, int result, uint quorum, bool active);
    event MembershipChanged(address member, bool isMember);
    event ChangeOfRules(uint newMinimumQuorum, uint newDebatingPeriodInMinutes, int newMajorityMargin);

    struct Proposal {
        address recipient;
        uint amount;
        string description;
        uint votingDeadline;
        bool executed;
        bool proposalPassed;
        uint numberOfVotes;
        int currentResult;
        bytes32 proposalHash;
        Vote[] votes;
        mapping (address => bool) voted;
    }

    struct Member {
        address member;
        string name;
        uint memberSince;
    }

    struct Vote {
        bool inSupport;
        address voter;
        string justification;
    }

    // Modifier that allows only shareholders to vote and create new proposals
    modifier onlyMembers {
        require(memberId[msg.sender] != 0);
        _;
    }

    /**
     * Constructor function
     */
    function Congress (
        uint minimumQuorumForProposals,
        uint minutesForDebate,
        int marginOfVotesForMajority
    )  payable {
        changeVotingRules(minimumQuorumForProposals, minutesForDebate, marginOfVotesForMajority);
        // It’s necessary to add an empty first member
        addMember(0, "");
        // and let's add the founder, to save a step later
        addMember(owner, 'founder');
    }

    /**
     * Add member
     *
     * Make `targetMember` a member named `memberName`
     *
     * @param targetMember ethereum address to be added
     * @param memberName public name for that member
     */
    function addMember(address targetMember, string memberName) onlyOwner {
        uint id = memberId[targetMember];
        if (id == 0) {
            memberId[targetMember] = members.length;
            id = members.length++;
        }

        members[id] = Member({member: targetMember, memberSince: now, name: memberName});
        MembershipChanged(targetMember, true);
    }

    /**
     * Remove member
     *
     * @notice Remove membership from `targetMember`
     *
     * @param targetMember ethereum address to be removed
     */
    function removeMember(address targetMember) onlyOwner {
        require(memberId[targetMember] != 0);

        for (uint i = memberId[targetMember]; i<members.length-1; i++){
            members[i] = members[i+1];
        }
        delete members[members.length-1];
        members.length--;
    }

    /**
     * Change voting rules
     *
     * Make so that proposals need tobe discussed for at least `minutesForDebate/60` hours,
     * have at least `minimumQuorumForProposals` votes, and have 50% + `marginOfVotes