<

Blockchain Fun!


Jonathan Boswell

In Money We Trust


Taking the Bits and Making a Coin


Let's Mine!



Coins

Total: 0
Mined: 0
Value: 0
Market: 0

Block

#: 1
Size: 0
Target: 0
Reward: 0 coins

Miner

Attempt: 0
Attempts: 0
Outcome: n/a
Stats: n/a

Wallet

Coins: 0
Value: 0

Top Wallets

Ethereum Smart Contracts


  pragma solidity ^0.4.20; // best with 0.4.21

  contract Token {
      // The keyword "public" makes those variables
      // readable from outside.
      address public minter;
      mapping (address => uint) public balances;

      // This is the constructor whose code is
      // run only when the contract is created.
      function Token() public {
          minter = msg.sender;
      }

      function mint(address receiver, uint amount) public {
          if (msg.sender != minter) return;
          balances[receiver] += amount;
      }

      function send(address receiver, uint amount) public {
          if (balances[msg.sender] < amount) return;
          balances[msg.sender] -= amount;
          balances[receiver] += amount;
      }
  }