ERC-20
Overview
Max Total Supply
11,928 CUBIR
Holders
44
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 0 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
CubegoIron
Compiler Version
v0.4.25+commit.59dbf8f1
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-11-22 */ pragma solidity ^0.4.24; /** * @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 c) { if (a == 0) { return 0; } 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 a / b; } /** * @dev Subtracts 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 c) { c = a + b; assert(c >= a); return c; } } contract BasicAccessControl { address public owner; // address[] public moderators; uint16 public totalModerators = 0; mapping (address => bool) public moderators; bool public isMaintaining = false; constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } modifier onlyModerators() { require(msg.sender == owner || moderators[msg.sender] == true); _; } modifier isActive { require(!isMaintaining); _; } function ChangeOwner(address _newOwner) onlyOwner public { if (_newOwner != address(0)) { owner = _newOwner; } } function AddModerator(address _newModerator) onlyOwner public { if (moderators[_newModerator] == false) { moderators[_newModerator] = true; totalModerators += 1; } } function RemoveModerator(address _oldModerator) onlyOwner public { if (moderators[_oldModerator] == true) { moderators[_oldModerator] = false; totalModerators -= 1; } } function UpdateMaintaining(bool _isMaintaining) onlyOwner public { isMaintaining = _isMaintaining; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract CubegoCoreInterface { function getMaterialSupply(uint _mId) constant external returns(uint); function getMyMaterialById(address _owner, uint _mId) constant external returns(uint); function transferMaterial(address _sender, address _receiver, uint _mId, uint _amount) external; } contract CubegoIron is IERC20, BasicAccessControl { using SafeMath for uint; string public constant name = "CubegoIron"; string public constant symbol = "CUBIR"; uint public constant decimals = 0; mapping (address => mapping (address => uint256)) private _allowed; uint public mId = 8; CubegoCoreInterface public cubegoCore; function setConfig(address _cubegoCoreAddress, uint _mId) onlyModerators external { cubegoCore = CubegoCoreInterface(_cubegoCoreAddress); mId = _mId; } function emitTransferEvent(address from, address to, uint tokens) onlyModerators external { emit Transfer(from, to, tokens); } function totalSupply() public view returns (uint256) { return cubegoCore.getMaterialSupply(mId); } function balanceOf(address owner) public view returns (uint256) { return cubegoCore.getMyMaterialById(owner, mId); } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } function transfer(address to, uint256 value) public returns (bool) { cubegoCore.transferMaterial(msg.sender, to, mId, value); return true; } function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); cubegoCore.transferMaterial(from, to, mId, value); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].add(addedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = (_allowed[msg.sender][spender].sub(subtractedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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":"","type":"address"}],"name":"moderators","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","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":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cubegoCore","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_isMaintaining","type":"bool"}],"name":"UpdateMaintaining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalModerators","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newModerator","type":"address"}],"name":"AddModerator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"mId","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"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":"spender","type":"address"},{"name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"tokens","type":"uint256"}],"name":"emitTransferEvent","outputs":[],"payable":false,"stateMutability":"nonpayable","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":false,"inputs":[{"name":"_oldModerator","type":"address"}],"name":"RemoveModerator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_cubegoCoreAddress","type":"address"},{"name":"_mId","type":"uint256"}],"name":"setConfig","outputs":[],"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"},{"constant":true,"inputs":[],"name":"isMaintaining","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"ChangeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"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"},{"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"}]
Contract Creation Code
6080604052600080546002805460ff191690556008600455600160b060020a03191633179055610d18806100346000396000f3006080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610137578063095ea7b3146101c157806314d0f1ba146101f957806318160ddd1461021a57806323b872dd14610241578063313ce5671461026b578063373339a41461028057806339509351146102b157806348ef5aa8146102d55780634efb023e146102f15780636c81fd6d1461031d57806370a082311461033e578063800da2371461035f5780638da5cb5b1461037457806395d89b4114610389578063a457c2d71461039e578063a6d49dca146103c2578063a9059cbb146103ec578063b85d627514610410578063c6195d3614610431578063dd62ed3e14610455578063ee4e44161461047c578063f285329214610491575b600080fd5b34801561014357600080fd5b5061014c6104b2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018657818101518382015260200161016e565b50505050905090810190601f1680156101b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cd57600080fd5b506101e5600160a060020a03600435166024356104e9565b604080519115158252519081900360200190f35b34801561020557600080fd5b506101e5600160a060020a0360043516610567565b34801561022657600080fd5b5061022f61057c565b60408051918252519081900360200190f35b34801561024d57600080fd5b506101e5600160a060020a0360043581169060243516604435610616565b34801561027757600080fd5b5061022f61070a565b34801561028c57600080fd5b5061029561070f565b60408051600160a060020a039092168252519081900360200190f35b3480156102bd57600080fd5b506101e5600160a060020a036004351660243561071e565b3480156102e157600080fd5b506102ef60043515156107ce565b005b3480156102fd57600080fd5b506103066107f8565b6040805161ffff9092168252519081900360200190f35b34801561032957600080fd5b506102ef600160a060020a036004351661081a565b34801561034a57600080fd5b5061022f600160a060020a03600435166108c0565b34801561036b57600080fd5b5061022f61096a565b34801561038057600080fd5b50610295610970565b34801561039557600080fd5b5061014c61097f565b3480156103aa57600080fd5b506101e5600160a060020a03600435166024356109b6565b3480156103ce57600080fd5b506102ef600160a060020a0360043581169060243516604435610a01565b3480156103f857600080fd5b506101e5600160a060020a0360043516602435610a8a565b34801561041c57600080fd5b506102ef600160a060020a0360043516610b2e565b34801561043d57600080fd5b506102ef600160a060020a0360043516602435610bd4565b34801561046157600080fd5b5061022f600160a060020a0360043581169060243516610c40565b34801561048857600080fd5b506101e5610c6b565b34801561049d57600080fd5b506102ef600160a060020a0360043516610c74565b60408051808201909152600a81527f43756265676f49726f6e00000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561050057600080fd5b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60016020526000908152604090205460ff1681565b60055460048054604080517f10dac0820000000000000000000000000000000000000000000000000000000081529283019190915251600092600160a060020a0316916310dac08291602480830192602092919082900301818787803b1580156105e557600080fd5b505af11580156105f9573d6000803e3d6000fd5b505050506040513d602081101561060f57600080fd5b5051905090565b600160a060020a038316600090815260036020908152604080832033845290915281205461064a908363ffffffff610cc716565b600160a060020a038086166000818152600360209081526040808320338452909152808220949094556005546004805486517ff45f2ee00000000000000000000000000000000000000000000000000000000081529182019490945288851660248201526044810193909352606483018790529351939092169263f45f2ee09260848084019391929182900301818387803b1580156106e857600080fd5b505af11580156106fc573d6000803e3d6000fd5b506001979650505050505050565b600081565b600554600160a060020a031681565b6000600160a060020a038316151561073557600080fd5b336000908152600360209081526040808320600160a060020a0387168452909152902054610769908363ffffffff610cd916565b336000818152600360209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600054600160a060020a031633146107e557600080fd5b6002805460ff1916911515919091179055565b60005474010000000000000000000000000000000000000000900461ffff1681565b600054600160a060020a0316331461083157600080fd5b600160a060020a03811660009081526001602052604090205460ff1615156108bd57600160a060020a03811660009081526001602081905260408220805460ff191682179055815461ffff7401000000000000000000000000000000000000000080830482169093011690910275ffff0000000000000000000000000000000000000000199091161790555b50565b60055460048054604080517f90be156c000000000000000000000000000000000000000000000000000000008152600160a060020a038681169482019490945260248101929092525160009392909216916390be156c9160448082019260209290919082900301818787803b15801561093857600080fd5b505af115801561094c573d6000803e3d6000fd5b505050506040513d602081101561096257600080fd5b505192915050565b60045481565b600054600160a060020a031681565b60408051808201909152600581527f4355424952000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156109cd57600080fd5b336000908152600360209081526040808320600160a060020a0387168452909152902054610769908363ffffffff610cc716565b600054600160a060020a0316331480610a2f57503360009081526001602081905260409091205460ff161515145b1515610a3a57600080fd5b81600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60055460048054604080517ff45f2ee00000000000000000000000000000000000000000000000000000000081523393810193909352600160a060020a03868116602485015260448401929092526064830185905251600093919091169163f45f2ee0916084808301928692919082900301818387803b158015610b0d57600080fd5b505af1158015610b21573d6000803e3d6000fd5b5060019695505050505050565b600054600160a060020a03163314610b4557600080fd5b600160a060020a03811660009081526001602081905260409091205460ff16151514156108bd57600160a060020a03166000908152600160205260408120805460ff19169055805475ffff0000000000000000000000000000000000000000198116740100000000000000000000000000000000000000009182900461ffff9081166000190116909102179055565b600054600160a060020a0316331480610c0257503360009081526001602081905260409091205460ff161515145b1515610c0d57600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039390931692909217909155600455565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60025460ff1681565b600054600160a060020a03163314610c8b57600080fd5b600160a060020a038116156108bd5760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600082821115610cd357fe5b50900390565b81810182811015610ce657fe5b929150505600a165627a7a7230582018f1b66febbaaf6ba7a8cf44bfa6a9522da816fb637ad9a190261a217af3e71e0029
Deployed Bytecode
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610137578063095ea7b3146101c157806314d0f1ba146101f957806318160ddd1461021a57806323b872dd14610241578063313ce5671461026b578063373339a41461028057806339509351146102b157806348ef5aa8146102d55780634efb023e146102f15780636c81fd6d1461031d57806370a082311461033e578063800da2371461035f5780638da5cb5b1461037457806395d89b4114610389578063a457c2d71461039e578063a6d49dca146103c2578063a9059cbb146103ec578063b85d627514610410578063c6195d3614610431578063dd62ed3e14610455578063ee4e44161461047c578063f285329214610491575b600080fd5b34801561014357600080fd5b5061014c6104b2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018657818101518382015260200161016e565b50505050905090810190601f1680156101b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cd57600080fd5b506101e5600160a060020a03600435166024356104e9565b604080519115158252519081900360200190f35b34801561020557600080fd5b506101e5600160a060020a0360043516610567565b34801561022657600080fd5b5061022f61057c565b60408051918252519081900360200190f35b34801561024d57600080fd5b506101e5600160a060020a0360043581169060243516604435610616565b34801561027757600080fd5b5061022f61070a565b34801561028c57600080fd5b5061029561070f565b60408051600160a060020a039092168252519081900360200190f35b3480156102bd57600080fd5b506101e5600160a060020a036004351660243561071e565b3480156102e157600080fd5b506102ef60043515156107ce565b005b3480156102fd57600080fd5b506103066107f8565b6040805161ffff9092168252519081900360200190f35b34801561032957600080fd5b506102ef600160a060020a036004351661081a565b34801561034a57600080fd5b5061022f600160a060020a03600435166108c0565b34801561036b57600080fd5b5061022f61096a565b34801561038057600080fd5b50610295610970565b34801561039557600080fd5b5061014c61097f565b3480156103aa57600080fd5b506101e5600160a060020a03600435166024356109b6565b3480156103ce57600080fd5b506102ef600160a060020a0360043581169060243516604435610a01565b3480156103f857600080fd5b506101e5600160a060020a0360043516602435610a8a565b34801561041c57600080fd5b506102ef600160a060020a0360043516610b2e565b34801561043d57600080fd5b506102ef600160a060020a0360043516602435610bd4565b34801561046157600080fd5b5061022f600160a060020a0360043581169060243516610c40565b34801561048857600080fd5b506101e5610c6b565b34801561049d57600080fd5b506102ef600160a060020a0360043516610c74565b60408051808201909152600a81527f43756265676f49726f6e00000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561050057600080fd5b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60016020526000908152604090205460ff1681565b60055460048054604080517f10dac0820000000000000000000000000000000000000000000000000000000081529283019190915251600092600160a060020a0316916310dac08291602480830192602092919082900301818787803b1580156105e557600080fd5b505af11580156105f9573d6000803e3d6000fd5b505050506040513d602081101561060f57600080fd5b5051905090565b600160a060020a038316600090815260036020908152604080832033845290915281205461064a908363ffffffff610cc716565b600160a060020a038086166000818152600360209081526040808320338452909152808220949094556005546004805486517ff45f2ee00000000000000000000000000000000000000000000000000000000081529182019490945288851660248201526044810193909352606483018790529351939092169263f45f2ee09260848084019391929182900301818387803b1580156106e857600080fd5b505af11580156106fc573d6000803e3d6000fd5b506001979650505050505050565b600081565b600554600160a060020a031681565b6000600160a060020a038316151561073557600080fd5b336000908152600360209081526040808320600160a060020a0387168452909152902054610769908363ffffffff610cd916565b336000818152600360209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600054600160a060020a031633146107e557600080fd5b6002805460ff1916911515919091179055565b60005474010000000000000000000000000000000000000000900461ffff1681565b600054600160a060020a0316331461083157600080fd5b600160a060020a03811660009081526001602052604090205460ff1615156108bd57600160a060020a03811660009081526001602081905260408220805460ff191682179055815461ffff7401000000000000000000000000000000000000000080830482169093011690910275ffff0000000000000000000000000000000000000000199091161790555b50565b60055460048054604080517f90be156c000000000000000000000000000000000000000000000000000000008152600160a060020a038681169482019490945260248101929092525160009392909216916390be156c9160448082019260209290919082900301818787803b15801561093857600080fd5b505af115801561094c573d6000803e3d6000fd5b505050506040513d602081101561096257600080fd5b505192915050565b60045481565b600054600160a060020a031681565b60408051808201909152600581527f4355424952000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156109cd57600080fd5b336000908152600360209081526040808320600160a060020a0387168452909152902054610769908363ffffffff610cc716565b600054600160a060020a0316331480610a2f57503360009081526001602081905260409091205460ff161515145b1515610a3a57600080fd5b81600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60055460048054604080517ff45f2ee00000000000000000000000000000000000000000000000000000000081523393810193909352600160a060020a03868116602485015260448401929092526064830185905251600093919091169163f45f2ee0916084808301928692919082900301818387803b158015610b0d57600080fd5b505af1158015610b21573d6000803e3d6000fd5b5060019695505050505050565b600054600160a060020a03163314610b4557600080fd5b600160a060020a03811660009081526001602081905260409091205460ff16151514156108bd57600160a060020a03166000908152600160205260408120805460ff19169055805475ffff0000000000000000000000000000000000000000198116740100000000000000000000000000000000000000009182900461ffff9081166000190116909102179055565b600054600160a060020a0316331480610c0257503360009081526001602081905260409091205460ff161515145b1515610c0d57600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039390931692909217909155600455565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60025460ff1681565b600054600160a060020a03163314610c8b57600080fd5b600160a060020a038116156108bd5760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600082821115610cd357fe5b50900390565b81810182811015610ce657fe5b929150505600a165627a7a7230582018f1b66febbaaf6ba7a8cf44bfa6a9522da816fb637ad9a190261a217af3e71e0029
Swarm Source
bzzr://18f1b66febbaaf6ba7a8cf44bfa6a9522da816fb637ad9a190261a217af3e71e
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.