ETH Price: $3,159.77 (-3.65%)

Token

Embiggen (MBGN)
 

Overview

Max Total Supply

1,949,706,478.611339548 MBGN

Holders

793

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
54.1540779961068681 MBGN

Value
$0.00
0x759654c6ebf4504d8f006f1474f4442bd966943a
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

A proof-of-concept token that pays interest-in-kind to token holders.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
EmbiggenToken

Compiler Version
v0.4.20+commit.3155dd80

Optimization Enabled:
Yes with 0 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-03-14
*/

pragma solidity ^0.4.18;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  /**
  * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}



/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  function balanceOf(address who) public view returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}


/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
  function allowance(address owner, address spender) public view returns (uint256);
  function transferFrom(address from, address to, uint256 value) public returns (bool);
  function approve(address spender, uint256 value) public returns (bool);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}


contract EmbiggenToken is ERC20 {
  using SafeMath for uint256;

  uint constant MAX_UINT = 2**256 - 1;
  string public name;
  string public symbol;
  uint8 public decimals;

  uint initialSupply;
  uint initializedTime;
  uint hourRate;

  struct UserBalance {
    uint latestBalance;
    uint lastCalculated;
  }

  mapping(address => UserBalance) balances;
  mapping(address => mapping(address => uint)) allowed;

  // annualRate: percent * 10^18
  function EmbiggenToken(uint _initialSupply, uint annualRate, string _name, string _symbol, uint8 _decimals) {
    initialSupply = _initialSupply;
    initializedTime = (block.timestamp / 3600) * 3600;
    hourRate = annualRate / (365 * 24);
    require(hourRate <= 223872113856833); // This ensures that (earnedInterset * baseInterest) won't overflow a uint for any plausible time period
    balances[msg.sender] = UserBalance({
      latestBalance: _initialSupply,
      lastCalculated: (block.timestamp / 3600) * 3600
    });
    name = _name;
    symbol = _symbol;
    decimals = _decimals;
  }

  function getInterest(uint value, uint lastCalculated) public view returns (uint) {
    if(value == 0) {
      // We were going to multiply by 0 at the end, so no point wasting gas on
      // the other calculations.
      return 0;
    }
    uint exp = (block.timestamp - lastCalculated) / 3600;
    uint x = 1000000000000000000;
    uint base = 1000000000000000000 + hourRate;
    while(exp != 0) {
      if(exp & 1 != 0){
        x = (x * base) / 1000000000000000000;
      }
      exp = exp / 2;
      base = (base * base) / 1000000000000000000;
    }
    return value.mul(x - 1000000000000000000) / 1000000000000000000;
  }

  function totalSupply() public view returns (uint) {
    return initialSupply.add(getInterest(initialSupply, initializedTime));
  }

  function balanceOf(address _owner) public view returns (uint256 balance) {
    return balances[_owner].latestBalance.add(getInterest(balances[_owner].latestBalance, balances[_owner].lastCalculated));
  }

  function incBalance(address _owner, uint amount) private {
    balances[_owner] = UserBalance({
      latestBalance: balanceOf(_owner).add(amount),
      lastCalculated: (block.timestamp / 3600) * 3600 // Round down to the last hour
    });
  }

  function decBalance(address _owner, uint amount) private {
    uint priorBalance = balanceOf(_owner);
    require(priorBalance >= amount);
    balances[_owner] = UserBalance({
      latestBalance: priorBalance.sub(amount),
      lastCalculated: (block.timestamp / 3600) * 3600 // Round down to the last hour
    });
  }

  function transfer(address _to, uint _value) public returns (bool)  {
    require(_to != address(0));
    decBalance(msg.sender, _value);
    incBalance(_to, _value);
    Transfer(msg.sender, _to, _value);

    return true;
  }

  function approve(address _spender, uint256 _value) public returns (bool) {
    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);
    return true;
  }

  function allowance(address _owner, address _spender) public view returns (uint256) {
    return allowed[_owner][_spender];
  }

  function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));
    require(_value <= allowed[_from][msg.sender]);

    decBalance(_from, _value);
    incBalance(_to, _value);

    if(allowed[_from][msg.sender] < MAX_UINT) {
      allowed[_from][msg.sender] -= _value;
    }
    Transfer(_from, _to, _value);
    return true;
  }

}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"value","type":"uint256"},{"name":"lastCalculated","type":"uint256"}],"name":"getInterest","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_initialSupply","type":"uint256"},{"name":"annualRate","type":"uint256"},{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint8"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]

6060604052341561000f57600080fd5b6040516109a63803806109a683398101604052808051919060200180519190602001805182019190602001805182019190602001805160038790559150610e1090504204610e10026004556122388404600581905565cb9c49d2514190111561007757600080fd5b6040805190810160405285815260208101610e104204610e1002905233600160a060020a031660009081526006602052604090208151815560208201516001909101555060008380516100ce929160200190610101565b5060018280516100e2929160200190610101565b506002805460ff191660ff929092169190911790555061019c92505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061014257805160ff191683800117855561016f565b8280016001018555821561016f579182015b8281111561016f578251825591602001919060010190610154565b5061017b92915061017f565b5090565b61019991905b8082111561017b5760008155600101610185565b90565b6107fb806101ab6000396000f30060606040526004361061008a5763ffffffff60e060020a60003504166306fdde03811461008f578063095ea7b31461011957806318160ddd1461014f57806323b872dd14610174578063313ce5671461019c57806370a08231146101c5578063728af7ec146101e457806395d89b41146101fd578063a9059cbb14610210578063dd62ed3e14610232575b600080fd5b341561009a57600080fd5b6100a2610257565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100de5780820151838201526020016100c6565b50505050905090810190601f16801561010b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561012457600080fd5b61013b600160a060020a03600435166024356102f5565b604051901515815260200160405180910390f35b341561015a57600080fd5b610162610361565b60405190815260200160405180910390f35b341561017f57600080fd5b61013b600160a060020a0360043581169060243516604435610388565b34156101a757600080fd5b6101af610484565b60405160ff909116815260200160405180910390f35b34156101d057600080fd5b610162600160a060020a036004351661048d565b34156101ef57600080fd5b6101626004356024356104e5565b341561020857600080fd5b6100a2610587565b341561021b57600080fd5b61013b600160a060020a03600435166024356105f2565b341561023d57600080fd5b610162600160a060020a036004358116906024351661065b565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102ed5780601f106102c2576101008083540402835291602001916102ed565b820191906000526020600020905b8154815290600101906020018083116102d057829003601f168201915b505050505081565b600160a060020a03338116600081815260076020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60006103836103746003546004546104e5565b6003549063ffffffff61068616565b905090565b6000600160a060020a038316151561039f57600080fd5b600160a060020a03808516600090815260076020908152604080832033909416835292905220548211156103d257600080fd5b6103dc84836106a0565b6103e68383610712565b600160a060020a038085166000908152600760209081526040808320339094168352929052205460001990101561044557600160a060020a03808516600090815260076020908152604080832033909416835292905220805483900390555b82600160a060020a031684600160a060020a03166000805160206107b08339815191528460405190815260200160405180910390a35060019392505050565b60025460ff1681565b600160a060020a038116600090815260066020526040812080546001909101546104df916104ba916104e5565b600160a060020a0384166000908152600660205260409020549063ffffffff61068616565b92915050565b60008080808515156104fa576000935061057e565b5050600554610e1042859003049150670de0b6b3a76400009081015b821561054d57600183161561053557670de0b6b3a76400008282020491505b600290920491670de0b6b3a764000090800204610516565b670de0b6b3a764000061057187670de0b6b3a763ffff19850163ffffffff61077216565b81151561057a57fe5b0493505b50505092915050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102ed5780601f106102c2576101008083540402835291602001916102ed565b6000600160a060020a038316151561060957600080fd5b61061333836106a0565b61061d8383610712565b82600160a060020a031633600160a060020a03166000805160206107b08339815191528460405190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b60008282018381101561069557fe5b8091505b5092915050565b60006106ab8361048d565b9050818110156106ba57600080fd5b60408051908101604052806106d5838563ffffffff61079d16565b8152602001610e104204610e10029052600160a060020a038416600090815260066020526040902081518155602082015160019091015550505050565b60408051908101604052806107368361072a8661048d565b9063ffffffff61068616565b8152602001610e104204610e10029052600160a060020a0383166000908152600660205260409020815181556020820151600190910155505050565b6000808315156107855760009150610699565b5082820282848281151561079557fe5b041461069557fe5b6000828211156107a957fe5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058203d6efa7b5f4b6c77100abd66207608e11d8f41a365fe863bc98270d84ecc29ee00290000000000000000000000000000000000000000033b2e3c9fd0803ce8000000000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000008456d62696767656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044d42474e00000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60606040526004361061008a5763ffffffff60e060020a60003504166306fdde03811461008f578063095ea7b31461011957806318160ddd1461014f57806323b872dd14610174578063313ce5671461019c57806370a08231146101c5578063728af7ec146101e457806395d89b41146101fd578063a9059cbb14610210578063dd62ed3e14610232575b600080fd5b341561009a57600080fd5b6100a2610257565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100de5780820151838201526020016100c6565b50505050905090810190601f16801561010b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561012457600080fd5b61013b600160a060020a03600435166024356102f5565b604051901515815260200160405180910390f35b341561015a57600080fd5b610162610361565b60405190815260200160405180910390f35b341561017f57600080fd5b61013b600160a060020a0360043581169060243516604435610388565b34156101a757600080fd5b6101af610484565b60405160ff909116815260200160405180910390f35b34156101d057600080fd5b610162600160a060020a036004351661048d565b34156101ef57600080fd5b6101626004356024356104e5565b341561020857600080fd5b6100a2610587565b341561021b57600080fd5b61013b600160a060020a03600435166024356105f2565b341561023d57600080fd5b610162600160a060020a036004358116906024351661065b565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102ed5780601f106102c2576101008083540402835291602001916102ed565b820191906000526020600020905b8154815290600101906020018083116102d057829003601f168201915b505050505081565b600160a060020a03338116600081815260076020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60006103836103746003546004546104e5565b6003549063ffffffff61068616565b905090565b6000600160a060020a038316151561039f57600080fd5b600160a060020a03808516600090815260076020908152604080832033909416835292905220548211156103d257600080fd5b6103dc84836106a0565b6103e68383610712565b600160a060020a038085166000908152600760209081526040808320339094168352929052205460001990101561044557600160a060020a03808516600090815260076020908152604080832033909416835292905220805483900390555b82600160a060020a031684600160a060020a03166000805160206107b08339815191528460405190815260200160405180910390a35060019392505050565b60025460ff1681565b600160a060020a038116600090815260066020526040812080546001909101546104df916104ba916104e5565b600160a060020a0384166000908152600660205260409020549063ffffffff61068616565b92915050565b60008080808515156104fa576000935061057e565b5050600554610e1042859003049150670de0b6b3a76400009081015b821561054d57600183161561053557670de0b6b3a76400008282020491505b600290920491670de0b6b3a764000090800204610516565b670de0b6b3a764000061057187670de0b6b3a763ffff19850163ffffffff61077216565b81151561057a57fe5b0493505b50505092915050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102ed5780601f106102c2576101008083540402835291602001916102ed565b6000600160a060020a038316151561060957600080fd5b61061333836106a0565b61061d8383610712565b82600160a060020a031633600160a060020a03166000805160206107b08339815191528460405190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b60008282018381101561069557fe5b8091505b5092915050565b60006106ab8361048d565b9050818110156106ba57600080fd5b60408051908101604052806106d5838563ffffffff61079d16565b8152602001610e104204610e10029052600160a060020a038416600090815260066020526040902081518155602082015160019091015550505050565b60408051908101604052806107368361072a8661048d565b9063ffffffff61068616565b8152602001610e104204610e10029052600160a060020a0383166000908152600660205260409020815181556020820151600190910155505050565b6000808315156107855760009150610699565b5082820282848281151561079557fe5b041461069557fe5b6000828211156107a957fe5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058203d6efa7b5f4b6c77100abd66207608e11d8f41a365fe863bc98270d84ecc29ee0029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000008456d62696767656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044d42474e00000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _initialSupply (uint256): 1000000000000000000000000000
Arg [1] : annualRate (uint256): 100000000000000000
Arg [2] : _name (string): Embiggen
Arg [3] : _symbol (string): MBGN
Arg [4] : _decimals (uint8): 18

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000
Arg [1] : 000000000000000000000000000000000000000000000000016345785d8a0000
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [6] : 456d62696767656e000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [8] : 4d42474e00000000000000000000000000000000000000000000000000000000


Swarm Source

bzzr://3d6efa7b5f4b6c77100abd66207608e11d8f41a365fe863bc98270d84ecc29ee
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.