Address Contract Verified
Address
0xCbfef8fdd706cde6F208460f2Bf39Aa9c785F05D
Balance
0 ETH
Nonce
1
Code Size
4897 bytes
Creator
0x17D04113...7761 at tx 0x29dfa029...a6c420
Indexed Transactions
0 (1 on-chain, 0.8% indexed)
Contract Bytecode
4897 bytes
0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063715018a6116100b8578063a9059cbb1161007c578063a9059cbb146103a8578063c6a276c2146103d4578063d3ce7905146103fa578063dd62ed3e14610420578063f2fde38b1461044e578063fe575a871461047457610142565b8063715018a6146103405780638da5cb5b146103485780638f32d59b1461036c57806395d89b4114610374578063a457c2d71461037c57610142565b806323b872dd1161010a57806323b872dd1461026c578063243f2473146102a2578063313ce567146102aa57806339509351146102c85780635e612bab146102f457806370a082311461031a57610142565b806306fdde0314610147578063095ea7b3146101c457806316d2e6501461020457806318160ddd1461022a578063188efc1614610244575b600080fd5b61014f61049a565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610189578181015183820152602001610171565b50505050905090810190601f1680156101b65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101f0600480360360408110156101da57600080fd5b506001600160a01b038135169060200135610528565b604080519115158252519081900360200190f35b6101f06004803603602081101561021a57600080fd5b50356001600160a01b0316610545565b61023261055e565b60408051918252519081900360200190f35b61026a6004803603602081101561025a57600080fd5b50356001600160a01b0316610564565b005b6101f06004803603606081101561028257600080fd5b506001600160a01b038135811691602081013590911690604001356105bb565b61026a610617565b6102b2610629565b6040805160ff9092168252519081900360200190f35b6101f0600480360360408110156102de57600080fd5b506001600160a01b038135169060200135610632565b61026a6004803603602081101561030a57600080fd5b50356001600160a01b031661068b565b6102326004803603602081101561033057600080fd5b50356001600160a01b03166106db565b61026a6106f6565b610350610787565b604080516001600160a01b039092168252519081900360200190f35b6101f0610796565b61014f6107ba565b6101f06004803603604081101561039257600080fd5b506001600160a01b038135169060200135610815565b6101f0600480360360408110156103be57600080fd5b506001600160a01b038135169060200135610883565b61026a600480360360208110156103ea57600080fd5b50356001600160a01b03166108dd565b61026a6004803603602081101561041057600080fd5b50356001600160a01b031661092c565b6102326004803603604081101561043657600080fd5b506001600160a01b038135811691602001351661097c565b61026a6004803603602081101561046457600080fd5b50356001600160a01b03166109a7565b6101f06004803603602081101561048a57600080fd5b50356001600160a01b03166109f7565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105205780601f106104f557610100808354040283529160200191610520565b820191906000526020600020905b81548152906001019060200180831161050357829003601f168201915b505050505081565b600061053c610535610a0a565b8484610a0e565b50600192915050565b600061055860048363ffffffff610afa16565b92915050565b60035490565b61057461056f610a0a565b610545565b6105af5760405162461bcd60e51b815260040180806020018281038252604081526020018061118d6040913960400191505060405180910390fd5b6105b881610b61565b50565b6000836105c7816109f7565b156106035760405162461bcd60e51b81526004018080602001828103825260278152602001806111cd6027913960400191505060405180910390fd5b61060e858585610ba9565b95945050505050565b610627610622610a0a565b610c31565b565b60085460ff1681565b600061053c61063f610a0a565b846106868560026000610650610a0a565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610c7916565b610a0e565b610693610796565b6106d2576040805162461bcd60e51b8152602060048201819052602482015260008051602061123d833981519152604482015290519081900360640190fd5b6105b881610c31565b6001600160a01b031660009081526001602052604090205490565b6106fe610796565b61073d576040805162461bcd60e51b8152602060048201819052602482015260008051602061123d833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600080546001600160a01b03166107ab610a0a565b6001600160a01b031614905090565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105205780601f106104f557610100808354040283529160200191610520565b600061053c610822610a0a565b84610686856040518060600160405280602581526020016112c8602591396002600061084c610a0a565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610cda16565b60003361088f816109f7565b156108cb5760405162461bcd60e51b81526004018080602001828103825260278152602001806111cd6027913960400191505060405180910390fd5b6108d58484610d71565b949350505050565b6108e861056f610a0a565b6109235760405162461bcd60e51b815260040180806020018281038252604081526020018061118d6040913960400191505060405180910390fd5b6105b881610d85565b610934610796565b610973576040805162461bcd60e51b8152602060048201819052602482015260008051602061123d833981519152604482015290519081900360640190fd5b6105b881610dcd565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6109af610796565b6109ee576040805162461bcd60e51b8152602060048201819052602482015260008051602061123d833981519152604482015290519081900360640190fd5b6105b881610e15565b600061055860058363ffffffff610afa16565b3390565b6001600160a01b038316610a535760405162461bcd60e51b81526004018080602001828103825260248152602001806112a46024913960400191505060405180910390fd5b6001600160a01b038216610a985760405162461bcd60e51b81526004018080602001828103825260228152602001806111456022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60006001600160a01b038216610b415760405162461bcd60e51b815260040180806020018281038252602281526020018061125d6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b610b7260058263ffffffff610eb516565b6040516001600160a01b038216907fdbe320accb74107e8da655fa6a1e2b454c3102a3985d4201aba99308881a410a90600090a250565b6000610bb6848484610f36565b610c2784610bc2610a0a565b61068685604051806060016040528060288152602001611215602891396001600160a01b038a16600090815260026020526040812090610c00610a0a565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610cda16565b5060019392505050565b610c4260048263ffffffff61109416565b6040516001600160a01b038216907fba73eacdfe215f630abb6a8a78e5be613e50918b52e691bba35d46c06e20d6c890600090a250565b600082820183811015610cd3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60008184841115610d695760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d2e578181015183820152602001610d16565b50505050905090810190601f168015610d5b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600061053c610d7e610a0a565b8484610f36565b610d9660058263ffffffff61109416565b6040516001600160a01b038216907ff38e60871ec534937251cd91cad807e15f55f1f6815128faecc256e71994b49790600090a250565b610dde60048263ffffffff610eb516565b6040516001600160a01b038216907fa6124c7f565d239231ddc9de42e684db7443c994c658117542be9c50f561943890600090a250565b6001600160a01b038116610e5a5760405162461bcd60e51b815260040180806020018281038252602681526020018061111f6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610ebf8282610afa565b15610f11576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6001600160a01b038316610f7b5760405162461bcd60e51b815260040180806020018281038252602581526020018061127f6025913960400191505060405180910390fd5b6001600160a01b038216610fc05760405162461bcd60e51b81526004018080602001828103825260238152602001806110fc6023913960400191505060405180910390fd5b61100381604051806060016040528060268152602001611167602691396001600160a01b038616600090815260016020526040902054919063ffffffff610cda16565b6001600160a01b038085166000908152600160205260408082209390935590841681522054611038908263ffffffff610c7916565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b61109e8282610afa565b6110d95760405162461bcd60e51b81526004018080602001828103825260218152602001806111f46021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365426c61636b6c69737441646d696e526f6c653a2063616c6c657220646f6573206e6f7420686176652074686520426c61636b6c69737441646d696e20726f6c65426c61636b6c6973746564526f6c653a206163636f756e7420697320426c61636b6c6973746564526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820fd7ed34b4180c28c79217a0f78e4d846b3d44366045de20f115d27f12d74604464736f6c63430005100032
Verified Source Code Full Match
Compiler: v0.5.16+commit.9c3226ce
EVM: istanbul
Optimization: Yes (200 runs)
Kine.sol 59 lines
pragma solidity ^0.5.16;
import "./ERC20.sol";
import "./BlackListRole.sol";
import "./Ownable.sol";
/**
* @title KineUSD
* @notice Kine is the platform token of Kine system.
* @author Kine
*/
contract Kine is Ownable, ERC20, BlackListRole {
/// @notice Kine token name
string public name;
/// @notice Kine token symbol
string public symbol;
/// @notice Kine token decimals
uint8 public decimals;
constructor (string memory name_, string memory symbol_, uint8 decimals_, uint totalSupply) public {
name = name_;
symbol = symbol_;
decimals = decimals_;
_mint(msg.sender, totalSupply);
}
/**
* @notice Transfer caller's Kine to target address
* @param to Transfer target address
* @param value The amount of Kine to transfer
* @return True if transfer succeed, false if failed
*/
function transfer(address to, uint value) public onlyNotBlacklisted(msg.sender) returns (bool) {
return super.transfer(to, value);
}
/**
* @notice Transfer source address's Kine to target address
* @param from Source address
* @param to Target address
* @param value The amount of Kine to transfer
* @return True if transfer succeed, false if failed
*/
function transferFrom(address from, address to, uint value) public onlyNotBlacklisted(from) returns (bool) {
return super.transferFrom(from, to, value);
}
/// @notice Add new account as blacklist admin member
/// @dev Only owner can add new blacklist admin member
function addBlacklistAdmin(address account) public onlyOwner {
_addBlacklistAdmin(account);
}
/// @notice Remove account from blacklist admin members
/// @dev Besides owner can remove admins, the blacklist admin can also renounce itself
function removeBlacklistAdmin(address account) public onlyOwner {
_removeBlacklistAdmin(account);
}
}
ERC20.sol 230 lines
pragma solidity ^0.5.0;
import "./Context.sol";
import "./IERC20.sol";
import "./KineSafeMath.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20Mintable}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20 {
using KineSafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
Roles.sol 36 lines
pragma solidity ^0.5.0;
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev Give an account access to this role.
*/
function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
/**
* @dev Remove an account's access to this role.
*/
function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
/**
* @dev Check if an account has this role.
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
}
}
IERC20.sol 76 lines
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: 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
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
Context.sol 27 lines
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
Ownable.sol 77 lines
pragma solidity ^0.5.0;
import "./Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _owner;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
KineSafeMath.sol 204 lines
pragma solidity ^0.5.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
/**
* Original work from OpenZeppelin: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/math/SafeMath.sol
* changes we made:
* 1. add two methods that take errorMessage as input parameter
*/
library KineSafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
* added by Kine
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
* added by Kine
*/
function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
BlackListRole.sol 54 lines
pragma solidity ^0.5.16;
import "./BlacklistAdminRole.sol";
import "./Context.sol";
import "./Roles.sol";
/**
* @title BlackListRole
*/
contract BlackListRole is BlacklistAdminRole {
using Roles for Roles.Role;
/// @notice Emitted when blacklist admin add account into blacklist
event BlacklistedAdded(address indexed account);
/// @notice Emitted when blacklist admin remove account into blacklist
event BlacklistedRemoved(address indexed account);
/// @dev Blacklist is maintained by blacklist admins
Roles.Role private _blacklisteds;
/// @notice Prevent blacklisted account
modifier onlyNotBlacklisted(address account) {
require(!isBlacklisted(account), "BlacklistedRole: account is Blacklisted");
_;
}
/**
* @notice Check if given account is in blacklist
* @return True if account is in blacklist, and false if not in blacklist
*/
function isBlacklisted(address account) public view returns (bool) {
return _blacklisteds.has(account);
}
/// @notice Add account into blacklist, only blacklist admin can do this
function addBlacklisted(address account) public onlyBlacklistAdmin {
_addBlacklisted(account);
}
/// @notice Remove account into blacklist, only blacklist admin can do this
function removeBlacklisted(address account) public onlyBlacklistAdmin {
_removeBlacklisted(account);
}
function _addBlacklisted(address account) internal {
_blacklisteds.add(account);
emit BlacklistedAdded(account);
}
function _removeBlacklisted(address account) internal {
_blacklisteds.remove(account);
emit BlacklistedRemoved(account);
}
}
BlacklistAdminRole.sol 49 lines
pragma solidity ^0.5.16;
import "./Context.sol";
import "./Roles.sol";
/**
* @title BlacklistAdminRole
*/
contract BlacklistAdminRole is Context {
using Roles for Roles.Role;
/// @notice Emitted when new black list admin is added by existing admin
event BlacklistAdminAdded(address indexed account);
/// @notice Emitted when black list admin is removed by existing admin
event BlacklistAdminRemoved(address indexed account);
/// @dev Blacklist admins are responsible to maintain admin members
Roles.Role private _blacklistAdmins;
constructor () internal {
_addBlacklistAdmin(_msgSender());
}
/// @notice Prevent non blacklist admin user from managing admin members
modifier onlyBlacklistAdmin() {
require(isBlacklistAdmin(_msgSender()), "BlacklistAdminRole: caller does not have the BlacklistAdmin role");
_;
}
/// @notice Check if an account is blacklist admin member
function isBlacklistAdmin(address account) public view returns (bool) {
return _blacklistAdmins.has(account);
}
/// @notice Let caller to remove itself from blacklist admin members
function renounceBlacklistAdmin() public {
_removeBlacklistAdmin(_msgSender());
}
function _addBlacklistAdmin(address account) internal {
_blacklistAdmins.add(account);
emit BlacklistAdminAdded(account);
}
function _removeBlacklistAdmin(address account) internal {
_blacklistAdmins.remove(account);
emit BlacklistAdminRemoved(account);
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
isBlacklistAdmin 0x16d2e650 → bool
isBlacklisted 0xfe575a87 → bool
isOwner 0x8f32d59b → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
addBlacklistAdmin 0xd3ce7905
address account
addBlacklisted 0x188efc16
address account
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
removeBlacklistAdmin 0x5e612bab
address account
removeBlacklisted 0xc6a276c2
address account
renounceBlacklistAdmin 0x243f2473
No parameters
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Token Balances (2)
View Transfers →Recent Transactions
This address has 1 on-chain transactions, but only 0.8% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →