Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 05 2016 10:31
    @alexvandesande banned @adamskee
  • Mar 16 2016 01:12
    @alexvandesande banned @scbosse
seidelion
@seidelion
Help please
Brooks Boyd
@MidnightLightning
Just go to https://www.ethereum.org/ and read down; the first tutorial is there under the 'Issue your token' button.
Are you looking for a general description of what Ethereum is, or help getting started as a developer in Ethereum?
seidelion
@seidelion
I would like both, as well as a few other concepts
I am a new developer, many ideas but need to understand the framework, and how to earn
Dane Lowrey
@dlowrey
I just started through the tutorials, can someone tell me if I am correct? Ethereum contracts are essentially just programs on a decentralized blockchain that get executed by 'miners' who then get to keep a fee for executing the program?
Brooks Boyd
@MidnightLightning
The last part of that is mostly true: The smart contracts are instructions, which first miners just store on the blockchain (developer pays a transaction fee for it to be included in the blockchain). Then any user can request those instructions be triggered (send a transaction that names a function they want executed), and then they pay for the executing of that function (to the miners). So, there's two steps, first create/store the contract on the decentralized blockchain, and then a separate transaction to execute it.
gabrielmoreira1975
@gabrielmoreira1975
Algum desenvolvedor brasileiro por aqui?
Preciso contratar consultoria...
@MidnightLightning https://www.ethereum.org/ codes are not compiling do you have any other tutorial for crowdfunding
?
gabrielmoreira1975
@gabrielmoreira1975
@MidnightLightning follow the code, it's the tutorial code just fixing the throw issue...

pragma solidity ^0.4.2;

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);
}

}

contract Token {
mapping (address => uint256) public balanceOf;
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
}

/ The shareholder association contract itself /

contract Association is owned, tokenRecipient {

/* Contract Variables and events */
uint public minimumQuorum;
uint public debatingPeriodInMinutes;
Proposal[] public proposals;
uint public numProposals;
Token public sharesTokenAddress;

event ProposalAdded(uint proposalID, address recipient, uint amount, string description);
event Voted(uint proposalID, bool position, address voter);
event ProposalTallied(uint proposalID, uint result, uint quorum, bool active);
event ChangeOfRules(uint newMinimumQuorum, uint newDebatingPeriodInMinutes, address newSharesTokenAddress);


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

struct Vote {
    bool inSupport;
    address voter;
}

/* modifier that allows only shareholders to vote and create new proposals */
modifier onlyShareholders {
    require (sharesTokenAddress.balanceOf(msg.sender) > 0);
    _;
}

/* First time setup */
function Association(Token sharesAddress, uint minimumSharesToPassAVote, uint minutesForDebate) payable {
    changeVotingRules(sharesAddress, minimumSharesToPassAVote, minutesForDebate);
}

/// @notice Make so that proposals need tobe discussed for at least `minutesForDebate/60` hours and all voters combined must own more than `minimumSharesToPassAVote` shares of token `sharesAddress` to be executed
/// @param sharesAddress token address
/// @param minimumSharesToPassAVote proposal can vote only if the sum of shares held by all voters exceed this number      
/// @param minutesForDebate the minimum amount of delay between when a proposal is made and when it can be executed    
function changeVotingRules(Token sharesAddress, uint minimumSharesToPassAVote, uint minutesForDebate) onlyOwner {
    sharesTokenAddress = Token(sharesAddress);
    if (minimumSharesToPassAVote == 0 ) minimumSharesToPassAVote = 1;
    minimumQuorum = minimumSharesToPassAVote;
    debatingPeriodInMinutes = minutesForDebate;
    ChangeOfRules(minimumQuorum, debatingPeriodInMinutes, sharesTokenAddress);
}

/// @notice Propose to send `weiAmount / 1E18` ether to `beneficiary` for `JobDescription`. `transactionBytecode ? Contains : Does not contain` code.
/// @param beneficiary who to send the ether to      
/// @param weiAmount amount of ether to send, in wei       
/// @param JobDescription Description of job
/// @param transactionBytecode bytecode of transaction
function newProposal(
    address beneficiary,
    uint weiAmount,
    string JobDescription,
    bytes transactionBytecode
)
    onlyShareholders
    returns (uint proposalID)
{
    proposalID = proposals.length++;
    Proposal storage p = proposals[proposalID];
    p.r
shaannara
@shaannara
Hello i want ask one information about etherium wallet software
Dinesh karthik
@vscindia01
Hello
I am new developer for ethereum ...can anyone help me create architecture for crowdfunding with ethereum?
Sohail Munir Khan
@ccdatatraits
Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
Anybody got a later code than what's on the website so I can play with dao?
or a github repo with code equivalent for dao. I am sure they would have an equivalent test for compiler for 0.4.13
or later?
parsparab
@parsparab
@vscindia01 You can get ethereum contract on github and customized accordingly your need.
Brooks Boyd
@MidnightLightning
@gabrielmoreira1975 I submitted a pull request for the Ethereum.org site to update to the latest Solidity version, which would help with that. If you want to get the code as-written to compile, use the 0.4.15 version of the compiler.
Here's my updated DAO code that should compile fine for v0.4.16 of the compiler: https://github.com/MidnightLightning/ethereum-org/blob/6b9f4b281a6efd80d1fb9aa7e1b2f912123d89b1/views/content/dao.md
Sohail Munir Khan
@ccdatatraits
@MidnightLightning This is awesome. I have now forked your forked repo. :)
Dipankar Biswas
@dbiswas
What is the programming language? Is there any C# .Net library?
Ayushya Chitransh
@AyushyaChitransh
@MidnightLightning can you give me a hint where should I start with parity. I know about blockchain and have few days ago used geth to setup POA
Currently I am trying POA tutorials on parity wiki
Luca Venturella
@lucav

Hello to all...
i think that there is a problem with the "create your own crypto-currency" tutorial here
https://www.ethereum.org/token#full-coin-code

I try to explain what i think.
The contract tokenRecipient is an abstract contract right? (if i'm wrong explain that please)
So there are two questions:
1) why the tokenRecipient contract is not inherited from another contract in the tutorial?
2) why in the function approveAndCall inside the "token" contract there is this line of code "tokenRecipient spender = tokenRecipient(_spender);" ?
I mean, if tokenRecipient is an abstract contract should not be used like that.

Brooks Boyd
@MidnightLightning
@AyushyaChitransh Parity is a node client for Ethereum, which does the same job as Geth. I installed mine as a Docker container since that keeps it really compartmentalized, and then start the server using the chain --dev flag to starting private development mode, and navigate to the web UI to push contracts and interact with them in development mode. Have you tried that and gotten stuck at some point in that process?
Brooks Boyd
@MidnightLightning
@lucav When a contract is defined in Solidity like the tokenRecipient one in that contract, it acts kind of like what an "interface" would be in other languages.
phalexo
@phalexo
I have geth running in 1 docker container and I have truffle in another container that talks to geth via the 8545 port. It's not clear on what you are stuck from your descriuption, @MidnightLightning
Brooks Boyd
@MidnightLightning
Thanks @phalexo, but I'm not stuck, I was answering @AyushyaChitransh who was asking about Parity setup.
@lucav The line tokenRecipient spender = tokenRecipient(_spender); means "take the _spender variable (which is an address value that the transaction sender input) and cast it to a tokenRecipient contract class (meaning, assume that whatever destination address the user is wanting me to use, assume that it meets the interface defined as tokenRecipient)" That make sense?
So, for that sample token, if you just want to give another contract some allowance from your stash, you use approve. If the other contract you're giving an allowance to is another smart contract, and it has implemented a receiveApproval function (to let it do some logic immediately after receiving some tokens), use the approveAndCall function to trigger that all in the same transaction call.
Luca Venturella
@lucav

@MidnightLightning

When a contract is defined in Solidity like the tokenRecipient one in that contract, it acts kind of like what an "interface" would be in other languages.

Ok, but i'm confusing...so in that tutorial, should be corrected from

contract tokenRecipient { function receiveApproval(address from, uint256 value, address token, bytes extraData); }

to

interface tokenRecipient { function receiveApproval(address from, uint256 value, address token, bytes extraData); }

right ???

thanks for your help
Luca Venturella
@lucav
also another question, so to get a full working tutorial (i'm trying to deploy to the ropsten test network using truffle), i have not to deploy that interface/contract tokenRecipient , i need to deploy only the other contracts right?
(i'm using that documentation as reference http://solidity.readthedocs.io/en/v0.4.15/contracts.html#interfaces )
Brooks Boyd
@MidnightLightning
No, "interface" is not a keyword in Solidity; you leave it as "contract", it just behaves like an interface due to how it's used.
To use, you deploy that whole Solidity script. It has definitions for several contract types, but when deploying only one becomes the main logic for the deployed address. All the other contract definitions in the script are supplemental/reference for the main contact
Oh actually, looking at that documentation, they did add in the "interface" keyword, my bad!
Luca Venturella
@lucav

Oh actually, looking at that documentation, they did add in the "interface" keyword, my bad!

Right!

Brooks Boyd
@MidnightLightning
In that token contract, you don't need to change it to the "interface" keyword, but it wouldn't hurt anything if you did.
Luca Venturella
@lucav
Also because truffle compile get an error........
Luca Venturella
@lucav

@MidnightLightning
Anyway, with contract keyword it works.

But for complete understanding the tutorial, i need to know this:
Should i deploy only the MyAdvancedToken contract (using truffle)?
Should i call the deployer link also or i don't to link?

This is my migration code:

var owned = artifacts.require("Owned");
var Token = artifacts.require("Token");
var TestCoin = artifacts.require("TestCoin");

module.exports = function(deployer) {
  deployer.deploy(owned);
  deployer.deploy(Token,1000000,'TestCoin',0,'TEC');

  deployer.link(Token, TestCoin);


  deployer.link(owned, TestCoin);
  deployer.deploy(TestCoin);
};

Thank you very much for help me!

Brooks Boyd
@MidnightLightning
I haven't used the Truffle infrastructure much at all, but you should only need to deploy the one MyAdvancedToken contract for basic functionality. If you want to test the approveAndCall functionality, you'd need to deploy a second contract that implements that one receiveApproval method.
Luca Venturella
@lucav
ok understood. thanks
Ayushya Chitransh
@AyushyaChitransh
@MidnightLightning I agree, using docker would be a better choice. I didn't think of it, so I've set it up in my system. I am exploring more cli options to configure it since I need to get this working on server
vishwas96
@vishwas96
Hey I need to get one thing straight. Please someone help me . I am confused with this stuff. I want to create a commercial coin on ethereum network. There are 3 pages of tutorial on ethereum.org . I successfully implemented the first one. Now, what do I need to do? how and where to put it on so that people can trade ?
phalexo
@phalexo
@vishwas96 Did you think it costs nothing to deploy? You have to mine or buy ether to deploy. No free lunch.