These are chat archives for ethereum/tutorials

22nd
Apr 2018
therusasian
@therusasian
Apr 22 2018 04:06
I am on"understanding the code" lesson ethereum.org. contract giving error Function, variable, struct or modifier declaration expected. I am just copying the code into mist? whats up

pragma solidity ^0.4.18;

   contract MyToken {
    mapping (address => uint256) public balanceOf;

function MyToken() {
    balanceOf[msg.sender] = 21000000;
}

function MyToken(uint256 initialSupply) public {
    balanceOf[msg.sender] = initialSupply;

}

function transfer(address _to, uint256 _value) {
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;

}
string public name;
string public symbol;
uint8 public decimals;

/* Initializes contract with initial supply tokens to the creator of the contract */
function MyToken(uint256 initialSupply, string tokenName, string tokenSymbol, uint8 decimalUnits) {
    balanceOf[msg.sender] = initialSupply;              
    name = tokenName;       TOKEN                           
    symbol = tokenSymbol;     TK                          
    decimals = decimalUnits;  18;                       
Arnav Vohra
@arnavvohra
Apr 22 2018 11:05
What Happened Last Week In Ethereum?
https://www.youtube.com/watch?v=kPh59mZZXSA