SHARE
TWEET

Untitled

a guest Apr 21st, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import "./StandardToken.sol";
  2.  
  3. pragma solidity >=0.4.0 <0.6.0;
  4.  
  5. contract OmegaCoinToken is StandardToken {
  6.  
  7.   uint8 public constant decimals = 18;
  8.   address public owner;
  9.  
  10.   modifier isOwner() {
  11.     require(msg.sender == owner);
  12.     _;
  13.   }
  14.  
  15.   function setMinter(address _minterAddress, uint256 _value) public isOwner {
  16.     require(_minterAddress != address(0));
  17.     minters[_minterAddress] = _value;
  18.   }
  19.  
  20.   function minterLeft(address _minterAddress) view public returns (uint256 rest) {
  21.       return minters[_minterAddress];
  22.   }
  23.  
  24.   function dematerialize(uint256 _value) public returns (bool success) {
  25.       if (minters[msg.sender] >= _value && _value > 0) {
  26.           balances[msg.sender] += _value;
  27.           minters[msg.sender] -= _value;
  28.           totalSupply += _value;
  29.           emit Transfer(address(0), msg.sender, _value);
  30.           return true;
  31.       } else {
  32.           return false;
  33.       }
  34.   }
  35.  
  36.   function materialize(uint256 _value) public returns (bool success) {
  37.     if (minters[msg.sender] >= _value && balances[msg.sender] >= _value && _value > 0) {
  38.       balances[msg.sender] -= _value;
  39.       totalSupply -= _value;
  40.       emit Transfer(msg.sender, address(0), _value);
  41.       return true;
  42.     } else {
  43.       return false;
  44.     }
  45.   }
  46.  
  47.   mapping (address => uint256) minters;
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top