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
piyush9sharma
@piyush9sharma

pragma solidity 0.4.8;

contract MyToken { event Transfer(address indexed from, address indexed to, uint256 value);
/ This creates an array with all balances /
mapping (address => uint256) public balanceOf;
/ Initializes contract with initial supply tokens to the creator of the contract /
function MyToken(uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol) {
balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
decimals = decimalUnits; // Amount of decimals for display purposes
}
/ Send coins /
function transfer(address _to, uint256 _value) {
/ Check if sender has balance and for overflows /
if (balanceOf[msg.sender] < _value || balanceOf[_to] + _value < balanceOf[_to])
throw;

/* Add and subtract new balances */
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;

}

}

Pedro Esperança
@esperancaJS
I'm trying to figure out the cost of deploying and maintaining a coin, anyone know where I can find such resources ?
madra.net
@madranet
@piyush9sharma If you're using the example code on https://www.ethereum.org/token, it's broken. Try the following [don't forget to change "yourtokenname" in 2 places to whatever you're calling your own coin]:
pragma solidity 0.4.8;

contract yourtokenname {
    /* some init vars */
    string public name;
    string public symbol;
    uint8 public decimals;

    /* This creates an array with all balances */
    mapping (address => uint256) public balanceOf;

    event Transfer(address indexed from, address indexed to, uint256 value);

    /* Initialises contract with initial supply tokens to the creator of the contract */
function yourtokenname (uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol) {
    balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens
    name = tokenName;                                   // Set the name for display purposes
    symbol = tokenSymbol;                               // Set the symbol for display purposes
    decimals = decimalUnits;                            // Amount of decimals for display purposes
}

    /* Send coins */
    function transfer(address _to, uint256 _value) {
        if (balanceOf[msg.sender] < _value) throw;           // Check if the sender has enough
        if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
        balanceOf[msg.sender] -= _value;                     // Subtract from the sender
        balanceOf[_to] += _value;                            // Add the same to the recipient
    }
}
MohamedXYZ
@MohamedXYZ
can i have some testnet ether thx; 0x9cF77b1175F8b162691758F32560cF439B2a6e95
'hi'
hsngs14
@hsngs14
any one can help me to install Solidity?
zawszeinlove
@zawszeinlove
Hey guys , i want to make a token in MIST WALLET , but i can't .... When i make a token with source code ( https://www.ethereum.org/token ) , MIST said " There is no data in contract address " please help m
me
D. Stuart Freeman
@stuartf
I tried issuing a token on test-net with @madranet 's code pasted above (with yourtokenname replaced) but I get 0 out of 12 confirmations and then a message saying the contract couldn't be created
zawszeinlove
@zawszeinlove
Hey guys, i solved my issue !!! Finally, I can make token !! ( 1 week....) But, i have a problem.... because, When i send my token to other contract , Number of my token is not decrease.....
Guillermo García Rojas C.
@SoloBSD
Cool, unlimited tokens!
bogdan
@aemet93
hello, guys. I have deployed contract using mist but no confirmations received from last 6 hours. I looked at the etherscan and it said "contract created". I'm using last version of mist. Any ideas where should I look?
zawszeinlove
@zawszeinlove
@SoloBSD Please help me .... transfer of user to user is normal , but number of administer's token is not decrease...
I'll open ico ...
xlcrr
@xlcrr
I'm lost - can a contract or a token be updated after its launched?
also, does it cost the contract holder eth for token holders to trade between themselves? Does the contract holder issue a tax?
xlcrr
@xlcrr
" for the moment fees can only be paid in ether and therefore all users of your tokens need it." p so the token holders need ether? Distributed from when I init the token or do they need to associate the token with their eth wallet and then pay eth to trade the token?
CEOX1X
@etherceo1x1
hi
i want to write 1st contract here but i m looking for help
if anybody can help here will be much obliged
xlcrr
@xlcrr
im in the same boat, maybe we can work together?
i am trying to create a token to vote on a custom dao
novumhouse
@novumhouse
I hava a simple question. I have 2 000 000 (30blocks left to download. If i close the program i will download
it from the beginning?
braigetori
@braigetori
it started from the beginning for me
xlcrr
@xlcrr
it never starts again for me
but I am saving it externally and specifying my path every time
braigetori
@braigetori
ahhh
xlcrr
@xlcrr
How to save externally:
/:cd Volumes/Seagate-Backup-Plus-Drive/Ethereum/
Ethereum:geth --datadir /Volumes/Seagate-Backup-Plus-Drive/Ethereum/ --fast --cache=1024
braigetori
@braigetori
thanks.
simple question: in the automatic functions for buying and selling (the example token code), where is the 'this' address defined?
balanceOf[this] += amount
xlcrr
@xlcrr
good question. I have this Q too.
the contract can hold both ether and custom token - and datastorage too right
braigetori
@braigetori
yes. Data in the state variables.
xlcrr
@xlcrr
when you send eth to create the contract, does some of this eth get saved in the contract wallet as 'this'
?
braigetori
@braigetori
well, the code seems to imply that msg.sender buys, and 'this' sells. so 'this' is some address somewhere that has eth or tokens in it... must be
xlcrr
@xlcrr
var usersBalance = balanceOf[msg.sender];
var contractEthBalance = this; // ??
the buying and selling analogy did not read well for me
braigetori
@braigetori
i think 'this' is an address mapped to a balance somewhere
xlcrr
@xlcrr
it must be the contract eth storage ?
braigetori
@braigetori
must be
xlcrr
@xlcrr
can contracts be edited after deploy?
braigetori
@braigetori
good question. if not, then it would be hard to grow an organization while improving the code
novumhouse
@novumhouse
@xlcrr could you explane more how to save it? I know nothing about ethereum or other like bitcoin;/
it saves it automatically for me. It shoud save for your too in --datadir folder
on os x ~/Users/User/Library/Ethereum/geth/chaindata
check the size of that folder