Bitcoin Forum
June 21, 2024, 08:52:20 PM *
News: Voting for pizza day contest
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Alternate cryptocurrencies / Altcoin Discussion / Help me create a eth token (for educational purposes only) on: October 05, 2017, 02:28:29 AM
hi
i've been trying to create my own ehterum token (just for educational purposes) but still cant get it
what i am doeing wrong? share you the code, it just do not compile Sad

I dont need it to be an "ICO" token, i just want to have it in my wallet and be able to send it to other wallets


pragma solidity ^0.4.7;


contract SafeMath {
 function safeMul(uint a, uint b) internal returns (uint) {
        uint c = a * b;
        assert(a ==0 || c / a ==b);
        return c;
    } 
    function safeDiv(uint a, uint b) internal returns (uint) {
        assert(b > 0);
        uint c = a / b;
        assert(a == b * c + a % b);
        return c;
    }
    function safeSub(uint a, uint b) internal returns (uint) {
        assert(b <= a);
        return a - b;
    }
    function safeAdd(uint a, uint b) internal returns (uint) {
        uint c = a +b;
        assert (c >= a);
        return c;
    }
   
    function max64(uint64 a, uint64 b) internal constant returns (uint64) {
        return a >= b ? a : b;
    }
    function min64(uint64 a, uint64 b) internal constant returns (uint64){
        return a < b ? a : b;
    }
    function max256(uint256 a, uint256 b) internal constant returns (uint256) {
        return a >= b ? a : b;
    }
   
    function min256(uint256 a, uint256 b) internal constant returns (uint256) {
        return a < b ? a : b;
    }
}
   
 contract ERC20Basic {
    uint public totalSupply;
    function balanceOf(address who) constant return (uint);
    function transfer(address to, uint value);
    event tranfer(adress indexed from, adress indexed to, uint value);
}

contract ERC20 is ERC20Basic {
    function allowance(address owner, address spender) constant returns (uint);
   
    function tranferFrom(address from, address to, uint value);
    function approve(adreess spender, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
}

contract BasicToken is ERC20Basic, SafeMath {
    mapping(address => uint) balances;
   
    modifier onlyPayloadSize(uint size) {
        assert(msg.data.lenght >= size + 4);
        _;
    }
    function transfer(address _to, uint _value) onlyPayloadSize(2*32) {
        balances[msg.sender] = safeSub(balances[msg.sender], _value);
        balances[_to] = safeAdd(balances[_to], _value);
        Transfer(msg.sender, _to, _value);
    }
    function balanceOf(address _owner) constant returns (uint balance) {
        return balances[_owner];
    }
}

contract StandardToken is BasicToken, ERC20 {
   
    mapping (address => mapping (address => uint)) allowed;
   
    function transferFrom(address _from, address _to, uint _value){
      var _allowance = allowed[_from][msg.sender];
        balances[_to] = safeAdd(balances[_to], _value);
        balances[_from] = safeSub(balances[_from], _value);
        allowed[_from][msg.sender] = safeSub(_allowance, _value);
        Transfer(_from, _to, _value); 
    }
   
    function approve(address _spender, uint _value) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
    }
   
   function allowance(address _owner, address _spender) constant returns (uint remaining) {
       return allowed[_owner][_spender];
   }
   
}

contract SimpleToken is StandardToken {
   
    string public name = "justatoken";
    string public symbol = "tkn";
    uint public decimals = 3;
    uint public INITIAL_SUPPLY = 100000;
   
    function SimpleToken() {
        totalSUpply = INITIAL_SUPPLY;
        balances[msg.sender] = INITIAL_SUPPLY;
    }
}

thanks
2  Alternate cryptocurrencies / Bounties (Altcoins) / Re: [BOUNTY] COINDEX Cryptocurrencies market indexes - 10M CNDX on: September 27, 2017, 03:17:16 PM
Joined twitter campaign
3  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] [ICO]COINDEX – CNDX30 Top30 Cryptocurrencies and Cryptoassets market INDEX on: September 27, 2017, 02:50:23 PM
Very interesting and promising project,as you said in the WP, it will enable the creation of new crypto financial products. looking forward for the ICO
4  Alternate cryptocurrencies / Bounties (Altcoins) / Re: [BOUNTY] Manager for COINDEX - Crytocurrencies and digital assets Index on: September 15, 2017, 07:35:30 AM
Do i need a bitcointalk rank? or can i apply even if i am a newbie? This project looks very interesting.
5  Other / Meta / How do i insert a picture? on: September 15, 2017, 12:36:11 AM
Hi guys.

i am a btctalk newbie, cant i post pictures? because ive tried but just can find the way, is it because of my rank (brand new)?

thanks
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!