Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Jun 05 2016 10:31
    @alexvandesande banned @adamskee
  • Mar 16 2016 01:12
    @alexvandesande banned @scbosse
ETH 2.0 main chain will have same transaction speed as ETH
improvements are only on side chains
How can I create a token?
@nczhu nice job, I will check it out over the weekend and leave some feedback. looks super nice at first glance. If you build a GUI for it it could be on the same pedistle as cryptozombies and ethernaut perhaps :)
Nico Vergauwen

I would change the naming convention to

<number>test<type>.sol , so eg. 1_test_assert.sol
Easier to type because no capitals and the tests will apear in order in the filesystem.

In Koans.sol I would replace the hardcoded value with the underflow just for simplicity (and perhaps demonstrating under/overflows)
uint256 max = uint256(0-1);

For your function getStorageSize() there is no fix, this is intended behaviour as unset values are initiated as 0. As far as I'm aware you can not 'hack' around this. The only 'fix' I can think of is checking the next value in storage and terminate the loop once the current and nextVal is unset , this is is probabilistic slightly better @nczhu

Nico Vergauwen
Also shared it on my Linkedin :)

pragma solidity ^0.4.16;

interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }

contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;

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

// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);

// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);

 * Constrctor function
 * Initializes contract with initial supply tokens to the creator of the contract
function TokenERC20(
    uint256 initialSupply,
    string tokenName,
    string tokenSymbol
) public {
    totalSupply = initialSupply * 10 ** uint256(decimals);  // Update total supply with the decimal amount
    balanceOf[msg.sender] = totalSupply;                // Give the creator all initial tokens
    name = tokenName;                                   // Set the name for display purposes
    symbol = tokenSymbol;                               // Set the symbol for display purposes

 * Internal transfer, only can be called by this contract
function _transfer(address _from, address _to, uint _value) internal {
    // Prevent transfer to 0x0 address. Use burn() instead
    require(_to != 0x0);
    // Check if the sender has enough
    require(balanceOf[_from] >= _value);
    // Check for overflows
    require(balanceOf[_to] + _value > balanceOf[_to]);
    // Save this for an assertion in the future
    uint previousBalances = balanceOf[_from] + balanceOf[_to];
    // Subtract from the sender
    balanceOf[_from] -= _value;
    // Add the same to the recipient
    balanceOf[_to] += _value;
    Transfer(_from, _to, _value);
    // Asserts are used to use static analysis to find bugs in your code. They should never fail
    assert(balanceOf[_from] + balanceOf[_to] == previousBalances);

 * Transfer tokens
 * Send `_value` tokens to `_to` from your account
 * @param _to The address of the recipient
 * @param _value the amount to send
function transfer(address _to, uint256 _value) public {
    _transfer(msg.sender, _to, _value);

 * Transfer tokens from other address
 * Send `_value` tokens to `_to` on behalf of `_from`
 * @param _from The address of the sender
 * @param _to The address of the recipient
 * @param _value the amount to send
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
    require(_value <= allowance[_from][msg.sender]);     // Check allowance
    allowance[_from][msg.sender] -= _value;
    _transfer(_from, _to, _value);
    return true;

 * Set allowance for other address
 * Allows `_spender` to spend no more than `_value` tokens on your behalf
 * @param _spender The address authorized to spend
 * @param _value the max amount they can spend
function approve(address _spender, uint256 _value) public
    returns (bool success) {
    allowance[msg.sender][_spender] = _value;
    return true;

 * Set allowance for other address and notify
 * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
 * @param _spender The address authorized to spend
 * @param _value the max amount they can spend
 * @param _extraData some extra information to send to the approved contract
Diego Hernandez Arriola
I want to create own token on ethereum.
any one help me please
Cesar Schneider
hi there! where is the best place to start learning how to create an ICO.
how can i create a new token/coin
Nico Vergauwen
I deliberately left the crowdsale part off for the safety of the ethereum community. Enough worthless ICO's have been done already ;)
I dont know how this chat works but Im doing research and wonder if someone in here who knows about how to create an own currency are up for discussion? I have a project where I want to create a currency and I wonder about how the best way is to do it? Anyone interested about collaboration? Or anyone has interesting experience?
By the way. Some of you know how to design a contract that ensures that someone have done something into the walls of his home?
anybody knows how to integrate metamask accounts to facebook
any ico with ecommerce business use case
Hi if somebody need help with smart contracts you can wright me on https://t.me/bolpol
Consalting and development.
Hi, I'd like to create my own Blockchain Congress that Executes the proposal automatically after x minutes instead of executing it manually. Does anyone know how to get around this? Thank you very much!
@vanaelsg You need external account to start transaction. If you want to execute automaticcally, then you need daemon process who will do it for you.
How can I run this token tutorial ? what should I download ?
hi anyone know about the meaning of "interface" in the third line"interface Token {"
Hi Does anyone know about the meaning of "interface" in the third line"interface Token { " ?
Nick Mudge
I am looking for a writer who would like to write a tutorial for ERC1538, transparent contracts: ethereum/EIPs#1538
@mudgen I can help
Shawn Kelly
hi we Would Like To Start a Blockchain, inploying Couple Idea That is Never used Before in rypto
Crypto ש
These Would Have Appeal to Regular Eth, And Then i Could Just Fork The byprod
Frist And foremost, Dualized Account Address On Every Client, So One A Year You Can Transfer Balances To Secondary Account And Then Flush The Blockchain Shrinking Netwrok Breadth, Then Those Fund Go To The prim Account After Flush, Storing Old Blocks in Another Off net db Any takes
Hello ! I am trying to create a crowd-sale but Etherscan say the contract sent a token to my address but I receive nothing
hello am completely new in here i would like to learn about Blockchain, gethy, solidity so is there is anyone able to assist i will be glad
Tell me if it suits your need.
Navneet Boghani
Hello when i transfer token using web 3 JS, at that time transaction id and error is not showing and token also not transfer
whats problem for that
Bhavesh Anand

Hi everyone.

Hope you are doing well. I am Bhavesh. Works on Python. I was Summer intern in Google Summer of Code 2018.
I am new to block chain.
I was given a task in Hackathon on smart contracts. Task has been completed available at https://github.com/bhaveshAn/infura-web3-py.
I have been asked to optimize the solution by using web3.eth.getCode can you help me with that.

Asadullah Khalid
Hi guys has any one ever used the kovan test network?
How is it better than rinkeby or ropsten test network ?
Navneet Boghani
Hi guys, how to transfer ecr20 token using web3 js?
Hello, I am getting 0x after compiling smart contract using truffle
Is anybody having any idea
Hi I need people to work alongside me for a project. Plz pm if interested. only serious candidates
Hi All
Will bytecode be 0x for inteface contract?

Hello...I'm using the straight code copied and pasted from Ethereum to do an online democracy...getting this error..Could not compile source code.

Different number of components on the left hand side (2) than on the right hand side (1).
(bool success, ) = p.recipient.call.value(p.amount)(transactionBytecode);