Address Contract Verified
Address
0xC4f6E93AEDdc11dc22268488465bAbcAF09399aC
Balance
0 ETH
Nonce
1
Code Size
6693 bytes
Creator
0x61Aa706B...2a2b at tx 0x34f00a9d...d2a8d6
Indexed Transactions
0
Contract Bytecode
6693 bytes
0x60806040526004361061017f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610184578063095ea7b31461020e57806318160ddd1461024657806323b872dd1461026d5780632a11ced0146102975780632fa7b684146102cb578063313ce567146102ec5780633f4ba83a1461030157806346f249061461031857806353d74fdf146103395780635c975abb1461034e57806360536172146103635780636618846314610378578063700730f41461039c57806370a08231146103c3578063768916e7146103e457806378e2ffd21461040d5780638456cb59146104255780638da5cb5b1461043a57806395d89b411461044f578063a9059cbb14610464578063ac3dcf8714610488578063b414d4b6146104a9578063b5ed298a146104ca578063b6cf146c146104eb578063d73dd62314610503578063d76fd2e714610527578063dd62ed3e1461054d578063e724529c14610574578063e9ed9b641461059a575b600080fd5b34801561019057600080fd5b506101996105c0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d35781810151838201526020016101bb565b50505050905090810190601f1680156102005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021a57600080fd5b50610232600160a060020a03600435166024356105f7565b604080519115158252519081900360200190f35b34801561025257600080fd5b5061025b61065d565b60408051918252519081900360200190f35b34801561027957600080fd5b50610232600160a060020a0360043581169060243516604435610663565b3480156102a357600080fd5b506102af600435610708565b60408051600160a060020a039092168252519081900360200190f35b3480156102d757600080fd5b5061025b600160a060020a0360043516610723565b3480156102f857600080fd5b5061025b610735565b34801561030d57600080fd5b5061031661073a565b005b34801561032457600080fd5b50610232600160a060020a0360043516610836565b34801561034557600080fd5b5061025b61084b565b34801561035a57600080fd5b50610232610850565b34801561036f57600080fd5b50610316610860565b34801561038457600080fd5b50610232600160a060020a03600435166024356108d9565b3480156103a857600080fd5b50610232600435600160a060020a0360243516604435610936565b3480156103cf57600080fd5b5061025b600160a060020a03600435166109e6565b3480156103f057600080fd5b50610232600160a060020a03600435166024356044351515610a01565b34801561041957600080fd5b5061025b600435610ca3565b34801561043157600080fd5b50610316610cb5565b34801561044657600080fd5b506102af610da4565b34801561045b57600080fd5b50610199610db3565b34801561047057600080fd5b50610232600160a060020a0360043516602435610dea565b34801561049457600080fd5b50610232600160a060020a0360043516610e8d565b3480156104b557600080fd5b50610232600160a060020a0360043516610ea2565b3480156104d657600080fd5b50610316600160a060020a0360043516610eb7565b3480156104f757600080fd5b50610232600435610f36565b34801561050f57600080fd5b50610232600160a060020a0360043516602435610fb5565b34801561053357600080fd5b50610316600160a060020a03600435166024351515611012565b34801561055957600080fd5b5061025b600160a060020a03600435811690602435166110b2565b34801561058057600080fd5b50610316600160a060020a036004351660243515156110dd565b3480156105a657600080fd5b50610316600160a060020a03600435166024351515611206565b60408051808201909152600981527f686920446f6c6c61720000000000000000000000000000000000000000000000602082015281565b60045460009060a060020a900460ff161561064a576040805160e560020a62461bcd02815260206004820152600e60248201526000805160206119ba833981519152604482015290519081900360640190fd5b61065483836112a3565b90505b92915050565b60015481565b33600090815260066020526040812054849060ff1615801561069e5750600160a060020a03811660009081526006602052604090205460ff16155b15156106f4576040805160e560020a62461bcd02815260206004820152600e60248201527f6163636f756e742066726f7a656e000000000000000000000000000000000000604482015290519081900360640190fd5b6106ff858585611345565b95945050505050565b600860205260009081526040902054600160a060020a031681565b600b6020526000908152604090205481565b601281565b600354600160a060020a0316331461078a576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206119da833981519152604482015290519081900360640190fd5b60045460a060020a900460ff1615156107ed576040805160e560020a62461bcd02815260206004820152600a60248201527f6e6f742070617573656400000000000000000000000000000000000000000000604482015290519081900360640190fd5b6004805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60056020526000908152604090205460ff1681565b600681565b60045460a060020a900460ff1681565b600454600160a060020a031633146108c2576040805160e560020a62461bcd02815260206004820152601660248201527f6e6f74207468652070726f706f736564206f776e657200000000000000000000604482015290519081900360640190fd5b6004546108d790600160a060020a03166113a3565b565b60045460009060a060020a900460ff161561092c576040805160e560020a62461bcd02815260206004820152600e60248201526000805160206119ba833981519152604482015290519081900360640190fd5b610654838361146c565b600354600090600160a060020a03163314610989576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206119da833981519152604482015290519081900360640190fd5b600584111561099a575060006109df565b506000838152600860209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387161790556009909152902081905560015b9392505050565b600160a060020a031660009081526020819052604090205490565b33600090815260056020526040812054819081908190819060ff161515610a72576040805160e560020a62461bcd02815260206004820152601960248201527f4e6f6e652d617070726f766572206e6f7420616c6c6f77656400000000000000604482015290519081900360640190fd5b851515610a9b57600160a060020a0388166000908152600b602052604081205560019450610c98565b60008711610af3576040805160e560020a62461bcd02815260206004820152601760248201527f7a65726f20616d6f756e74206e6f7420616c6c6f776564000000000000000000604482015290519081900360640190fd5b600160a060020a0388166000908152600b6020526040902054871115610b88576040805160e560020a62461bcd028152602060048201526024808201527f4f7665722d617070726f7665206d696e7420616d6f756e74206e6f7420616c6c60448201527f6f77656400000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b869350600091505b6005821015610c1057600082815260086020908152604080832054600990925290912054600160a060020a039091169350610be69061271090610bda908a9063ffffffff61155c16565b9063ffffffff61158816565b9050610bf8848263ffffffff61159d16565b9350610c0483826115b2565b50600190910190610b90565b600560005260086020527f91238f30f286c9a1c6e901c4eda3b214c381c846e3dbe48df95c21488e8e1fdb54600160a060020a03169250610c5183856115b2565b50600160a060020a0388166000908152600b602052604090208054889003908190551515610c9357600160a060020a0388166000908152600b60205260408120555b600194505b505050509392505050565b60096020526000908152604090205481565b600354600160a060020a03163314610d05576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206119da833981519152604482015290519081900360640190fd5b60045460a060020a900460ff1615610d55576040805160e560020a62461bcd02815260206004820152600e60248201526000805160206119ba833981519152604482015290519081900360640190fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600281527f4849000000000000000000000000000000000000000000000000000000000000602082015281565b33600090815260066020526040812054839060ff16158015610e255750600160a060020a03811660009081526006602052604090205460ff16155b1515610e7b576040805160e560020a62461bcd02815260206004820152600e60248201527f6163636f756e742066726f7a656e000000000000000000000000000000000000604482015290519081900360640190fd5b610e85848461168e565b949350505050565b600a6020526000908152604090205460ff1681565b60066020526000908152604090205460ff1681565b600354600160a060020a03163314610f07576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206119da833981519152604482015290519081900360640190fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000908152600a602052604081205460ff161515610f9f576040805160e560020a62461bcd02815260206004820152601860248201527f4e6f6e2d70726f706f736572206e6f7420616c6c6f7765640000000000000000604482015290519081900360640190fd5b50336000908152600b6020526040902055600190565b60045460009060a060020a900460ff1615611008576040805160e560020a62461bcd02815260206004820152600e60248201526000805160206119ba833981519152604482015290519081900360640190fd5b61065483836116eb565b600354600160a060020a03163314611062576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206119da833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600560205260409020805460ff19168215159081179091556110ae57600160a060020a0382166000908152600560205260409020805460ff191690555b5050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b3360009081526005602052604090205460ff161515611146576040805160e560020a62461bcd02815260206004820152601960248201527f6c61636b20617070726f76657273207065726d697373696f6e00000000000000604482015290519081900360640190fd5b600160a060020a03821615156111a6576040805160e560020a62461bcd02815260206004820152600b60248201527f6e6f7420746f2073656c66000000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038216600081815260066020908152604091829020805460ff1916851515908117909155825190815291517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a25050565b600354600160a060020a03163314611256576040805160e560020a62461bcd02815260206004820152600f60248201526000805160206119da833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600a60205260409020805460ff19168215159081179091556110ae5750600160a060020a03166000908152600a60205260409020805460ff19169055565b60008115806112d35750336000908152600260209081526040808320600160a060020a0387168452909152902054155b15156112de57600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60045460009060a060020a900460ff1615611398576040805160e560020a62461bcd02815260206004820152600e60248201526000805160206119ba833981519152604482015290519081900360640190fd5b610e85848484611784565b600160a060020a0381161515611403576040805160e560020a62461bcd02815260206004820152601860248201527f7a65726f2061646472657373206e6f7420616c6c6f7765640000000000000000604482015290519081900360640190fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156114c157336000908152600260209081526040808320600160a060020a03881684529091528120556114f6565b6114d1818463ffffffff61159d16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600082151561156d57506000610657565b5081810281838281151561157d57fe5b041461065757600080fd5b6000818381151561159557fe5b049392505050565b6000828211156115ac57600080fd5b50900390565b6001546000906115c8908363ffffffff6118fb16565b600155600160a060020a0383166000908152602081905260409020546115f4908363ffffffff6118fb16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b60045460009060a060020a900460ff16156116e1576040805160e560020a62461bcd02815260206004820152600e60248201526000805160206119ba833981519152604482015290519081900360640190fd5b610654838361190b565b336000908152600260209081526040808320600160a060020a038616845290915281205461171f908363ffffffff6118fb16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6000600160a060020a038316151561179b57600080fd5b600160a060020a0384166000908152602081905260409020548211156117c057600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156117f057600080fd5b600160a060020a038416600090815260208190526040902054611819908363ffffffff61159d16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461184e908363ffffffff6118fb16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054611890908363ffffffff61159d16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b8181018281101561065757600080fd5b3360009081526020819052604081205461192b908363ffffffff61159d16565b3360009081526020819052604080822092909255600160a060020a0385168152205461195d908363ffffffff6118fb16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001929150505600616c7265616479207061757365640000000000000000000000000000000000006c61636b207065726d697373696f6e0000000000000000000000000000000000a165627a7a72305820ce12adaf0d090edb251750fa6ae72572054f4a0324261e70aff60efca9ca4bd40029
Verified Source Code Full Match
Compiler: v0.4.26+commit.4563c3fc
EVM: byzantium
Optimization: Yes (200 runs)
SafeMath.sol 55 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.4.26;
/**
* @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) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
require(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) {
require(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;
require(c >= a);
return c;
}
}
hiDollar.sol 500 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.4.26;
import './SafeMath.sol';
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable
{
address public owner;
address private proposedOwner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner, "lack permission");
_;
}
/**
* @dev propose a new owner by an existing owner
* @param _newOwner The address proposed to transfer ownership to.
*/
function proposeOwner(address _newOwner) public onlyOwner {
proposedOwner = _newOwner;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
*/
function takeOwnership() public {
require(proposedOwner == msg.sender, "not the proposed owner");
_transferOwnership(proposedOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0), "zero address not allowed");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable
{
event Pause();
event Unpause();
bool public paused; //default as false
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused, "already paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused, "not paused");
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpauseunpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic
{
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
);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic
{
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 public totalSupply;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken
{
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = (allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) {
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable
{
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint256 _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
/**
* @title Frozenable Token
* @dev Illegal address that can be frozened.
*/
contract FrozenableToken is Ownable
{
mapping (address => bool) public Approvers;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address indexed to, bool frozen);
modifier whenNotFrozen(address _who) {
require(!frozenAccount[msg.sender] && !frozenAccount[_who], "account frozen");
_;
}
function setApprover(address _wallet, bool _approve) public onlyOwner {
Approvers[_wallet] = _approve;
if (!_approve)
delete Approvers[_wallet];
}
function freezeAccount(address _to, bool _freeze) public {
require(Approvers[msg.sender], "lack approvers permission");
require(_to != address(0), "not to self");
frozenAccount[_to] = _freeze;
emit FrozenFunds(_to, _freeze);
}
}
/**
*------------------Mintable token----------------------------
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
/**
* @dev Mint method
* @param _to newly minted tokens will be sent to this address
* @param _amount amount to mint
* @return A boolean that indicates if the operation was successful.
*/
function _mint(address _to, uint256 _amount) internal returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
}
/**
* @title hiDollar
* @author hi.com
*/
contract hiDollar is PausableToken, FrozenableToken, MintableToken
{
using SafeMath for uint256;
string public constant name = "hi Dollar";
string public constant symbol = "HI";
uint256 public constant decimals = 18;
uint public constant totalHolders = 6; // total number is fixed, wont change in future
// but holders address can be updated thru setMintSplitHolder method
// uint256 INITIAL_SUPPLY = 10 *(10 ** 5) * (10 ** uint256(decimals));
uint256 private INITIAL_SUPPLY = 0;
mapping (uint => address) public holders;
mapping (uint => uint256) public MintSplitHolderRatios; //index -> ratio boosted by 10000
mapping (address => bool) public Proposers;
mapping (address => uint256) public Proposals; //address -> mintAmount
/**
* @dev Initializes the total release
*/
constructor() public {
holders[0] = 0x3AeEFC8dDf3f0787c216b60ea732163455B5163b; //HI_LID
holders[1] = 0x142Fc12540Dc0FA4e24fB7BedB220397A9e77bF5; //HI_EG
holders[2] = 0xb1E5f7E027C4ecd9b52C0C285bb628351CF0F5c6; //HI_NLTI
holders[3] = 0x300Ae38eC675756Ad53bf8c579A0aEC9E09de1D7; //HI_CR
holders[4] = 0x592f9A9c2F16D27Db43c0Df28e53D0D6184db1C4; //HI_FR
holders[5] = 0xFa318277eC9633709d5cE641DD8ca80BB9Cc733D; //HI_FT
MintSplitHolderRatios[0] = 2720; //27.2%
MintSplitHolderRatios[1] = 1820; //18.2%
MintSplitHolderRatios[2] = 1820; //18.2%
MintSplitHolderRatios[3] = 1360; //13.6%
MintSplitHolderRatios[4] = 1360; //13.6%
MintSplitHolderRatios[5] = 920; //9.2%, remaining
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public whenNotFrozen(_to) returns (bool) {
return super.transfer(_to, _value);
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public whenNotFrozen(_from) returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function setProposer(address _wallet, bool _on) public onlyOwner {
Proposers[_wallet] = _on;
if (!_on)
delete Proposers[_wallet];
}
/**
* to update an split holder ratio at the index
* index ranges from 0..totalHolders -1
*/
function setMintSplitHolder(uint256 index, address _wallet, uint256 _ratio) public onlyOwner returns (bool) {
if (index > totalHolders - 1)
return false;
holders[ index ] = _wallet;
MintSplitHolderRatios[ index ] = _ratio;
return true;
}
/**
* @dev propose to mint
* @param _amount amount to mint
* @return mint propose ID
*/
function proposeMint(uint256 _amount) public returns(bool) {
require(Proposers[msg.sender], "Non-proposer not allowed");
Proposals[msg.sender] = _amount; //mint once for a propoer at a time otherwise would be overwritten
return true;
}
function approveMint(address _proposer, uint256 _amount, bool _approve) public returns(bool) {
require( Approvers[msg.sender], "None-approver not allowed" );
if (!_approve) {
delete Proposals[_proposer];
return true;
}
require( _amount > 0, "zero amount not allowed" );
require( Proposals[_proposer] >= _amount, "Over-approve mint amount not allowed" );
uint256 remaining = _amount;
address _to;
for (uint256 i = 0; i < totalHolders - 1; i++) {
_to = holders[i];
uint256 _amt = _amount.mul(MintSplitHolderRatios[i]).div(10000);
remaining = remaining.sub(_amt);
_mint(_to, _amt);
}
_to = holders[totalHolders - 1];
_mint(_to, remaining); //for the last holder in the list
Proposals[_proposer] -= _amount;
if (Proposals[_proposer] == 0)
delete Proposals[_proposer];
return true;
}
}
Read Contract
Approvers 0x46f24906 → bool
MintSplitHolderRatios 0x78e2ffd2 → uint256
Proposals 0x2fa7b684 → uint256
Proposers 0xac3dcf87 → bool
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint256
frozenAccount 0xb414d4b6 → bool
holders 0x2a11ced0 → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
symbol 0x95d89b41 → string
totalHolders 0x53d74fdf → uint256
totalSupply 0x18160ddd → uint256
Write Contract 15 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address _spender
uint256 _value
returns: bool
approveMint 0x768916e7
address _proposer
uint256 _amount
bool _approve
returns: bool
decreaseApproval 0x66188463
address _spender
uint256 _subtractedValue
returns: bool
freezeAccount 0xe724529c
address _to
bool _freeze
increaseApproval 0xd73dd623
address _spender
uint256 _addedValue
returns: bool
pause 0x8456cb59
No parameters
proposeMint 0xb6cf146c
uint256 _amount
returns: bool
proposeOwner 0xb5ed298a
address _newOwner
setApprover 0xd76fd2e7
address _wallet
bool _approve
setMintSplitHolder 0x700730f4
uint256 index
address _wallet
uint256 _ratio
returns: bool
setProposer 0xe9ed9b64
address _wallet
bool _on
takeOwnership 0x60536172
No parameters
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
unpause 0x3f4ba83a
No parameters
Token Balances (2)
View Transfers →Recent Transactions
No transactions found for this address