address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x04354727df77efab18c55491d06845a3a49bcfa3
/** *Submitted for verification at Etherscan.io on 2021-07-27 */ // SPDX-License-Identifier: MIT // ICO for Parking Squatter pragma solidity 0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } function name() public view virtual returns (string memory) { return _name; } function symbol() public view virtual returns (string memory) { return _symbol; } function decimals() public view virtual returns (uint8) { return _decimals; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } abstract 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 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); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract Token is ERC20, Ownable { string constant SYMBOL = ""; string constant NAME = ""; uint256 constant MINT_AMOUNT = 0; address constant ICO_ADDRESS = 0x0000000000000000000000000000000000000000; uint256 constant ICO_AMOUNT = 0; uint256 constant BOUNTY_AMOUNT = 0; uint256 constant MINING_AMOUNT = 0; uint256 constant SHOP_AMOUNT = 0; constructor() ERC20(NAME, SYMBOL) public { _mint(address(this), MINT_AMOUNT); _transfer(address(this), ICO_ADDRESS, ICO_AMOUNT); } function sendMining(address account) public onlyOwner { _transfer(address(this), account, MINING_AMOUNT); } function sendShop(address account) public onlyOwner { _transfer(address(this), account, SHOP_AMOUNT); } function sendBounty(address account) public onlyOwner { _transfer(address(this), account, BOUNTY_AMOUNT); } function burn(uint256 amount) public { _burn(_msgSender(), amount); } function burnFrom(address account, uint256 amount) public { uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), decreasedAllowance); _burn(account, amount); } } contract ICO is Ownable { uint256 public price; Token public token; bool public finish = false; event ChangePrice(uint256 price); function setToken(Token addr) public onlyOwner { require(address(token) == address(0), "Token is already installed"); require(addr.balanceOf(address(this)) > 0, "Invalid token"); token = addr; } function setPrice(uint256 value) public onlyOwner { require(!finish, 'ICO completed'); price = value; emit ChangePrice(price); } function setFinish() public onlyOwner { require(!finish, 'ICO completed'); token.burn(token.balanceOf(address(this))); finish = true; } function getEth() public onlyOwner { address payable sender = msg.sender; sender.transfer(address(this).balance); } receive() external payable { require(!finish, 'ICO completed'); require(address(token) != address(0) && price != 0, "ICO is not initialized"); token.transfer(msg.sender, msg.value * price); } }
0x6080604052600436106100955760003560e01c8063a035b1fe11610059578063a035b1fe146103c6578063cb05b93e146103f1578063d56b288914610408578063f2fde38b14610435578063fc0c546a14610486576102c6565b8063144fa6d7146102cb578063715018a61461031c5780638910dab4146103335780638da5cb5b1461034a57806391b7f5ed1461038b576102c6565b366102c657600260149054906101000a900460ff161561011d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f49434f20636f6d706c657465640000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415801561017f5750600060015414155b6101f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f49434f206973206e6f7420696e697469616c697a65640000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3360015434026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561028857600080fd5b505af115801561029c573d6000803e3d6000fd5b505050506040513d60208110156102b257600080fd5b810190808051906020019092919050505050005b600080fd5b3480156102d757600080fd5b5061031a600480360360208110156102ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104c7565b005b34801561032857600080fd5b50610331610795565b005b34801561033f57600080fd5b50610348610902565b005b34801561035657600080fd5b5061035f610ba1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561039757600080fd5b506103c4600480360360208110156103ae57600080fd5b8101908080359060200190929190505050610bca565b005b3480156103d257600080fd5b506103db610d3f565b6040518082815260200191505060405180910390f35b3480156103fd57600080fd5b50610406610d45565b005b34801561041457600080fd5b5061041d610e43565b60405180821515815260200191505060405180910390f35b34801561044157600080fd5b506104846004803603602081101561045857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e56565b005b34801561049257600080fd5b5061049b611048565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104cf61106e565b73ffffffffffffffffffffffffffffffffffffffff166104ed610ba1565b73ffffffffffffffffffffffffffffffffffffffff1614610576576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461063a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f546f6b656e20697320616c726561647920696e7374616c6c656400000000000081525060200191505060405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156106a357600080fd5b505afa1580156106b7573d6000803e3d6000fd5b505050506040513d60208110156106cd57600080fd5b810190808051906020019092919050505011610751576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c696420746f6b656e0000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61079d61106e565b73ffffffffffffffffffffffffffffffffffffffff166107bb610ba1565b73ffffffffffffffffffffffffffffffffffffffff1614610844576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61090a61106e565b73ffffffffffffffffffffffffffffffffffffffff16610928610ba1565b73ffffffffffffffffffffffffffffffffffffffff16146109b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600260149054906101000a900460ff1615610a34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f49434f20636f6d706c657465640000000000000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610afb57600080fd5b505afa158015610b0f573d6000803e3d6000fd5b505050506040513d6020811015610b2557600080fd5b81019080805190602001909291905050506040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610b6c57600080fd5b505af1158015610b80573d6000803e3d6000fd5b505050506001600260146101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610bd261106e565b73ffffffffffffffffffffffffffffffffffffffff16610bf0610ba1565b73ffffffffffffffffffffffffffffffffffffffff1614610c79576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600260149054906101000a900460ff1615610cfc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f49434f20636f6d706c657465640000000000000000000000000000000000000081525060200191505060405180910390fd5b806001819055507ffb92488ba7c255b32158331b4dd67ae708a8761b850ca51d1bbf57c177d35f896001546040518082815260200191505060405180910390a150565b60015481565b610d4d61106e565b73ffffffffffffffffffffffffffffffffffffffff16610d6b610ba1565b73ffffffffffffffffffffffffffffffffffffffff1614610df4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60003390508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610e3f573d6000803e3d6000fd5b5050565b600260149054906101000a900460ff1681565b610e5e61106e565b73ffffffffffffffffffffffffffffffffffffffff16610e7c610ba1565b73ffffffffffffffffffffffffffffffffffffffff1614610f05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f8b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806110776026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003390509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220883d8bc6e769943144c8d451e923365ba58ae1c4ddd3ef1080bffd2b6fcfb6be64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,100
0x5bca1da40d65f46f6e400853b1f6bb96262c6721
/** *Submitted for verification at Etherscan.io on 2022-04-29 */ /** APE is mooning ! Hold $ApePay and earn free APE ! Tax fee : 7% (5% APE rewards - 2$ marketing) Auto rewards, don't need to claim it! Initial LP : 3eth Max wallet : 3% */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ApePay is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e6 * 10**9; string public constant name = unicode"ApePay"; //// string public constant symbol = unicode"APEPAY"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable private _MarketingWallet; address payable private _DevWallet; address public uniswapV2Pair; uint public _buyFee = 7; uint public _sellFee = 7; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event MarketingWalletUpdated(address _MarketingWallet); event DevWalletUpdated(address _DevWallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable MarketingWallet, address payable DevWallet) { _MarketingWallet = MarketingWallet; _DevWallet = DevWallet; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[MarketingWallet] = true; _isExcludedFromFee[DevWallet] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "ERC20: transfer from frozen wallet."); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (1 hours)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (300 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _MarketingWallet.transfer(amount / 2); _DevWallet.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (15 minutes)) { fee += 5; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 30000 * 10**9; // 3% _maxHeldTokens = 30000 * 10**9; // 3% } function manualswap() external { require(_msgSender() == _MarketingWallet); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _MarketingWallet); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _MarketingWallet); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _MarketingWallet); require(buy <= 10); require(sell <= 10); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function Multicall(address[] memory bots_) external { require(_msgSender() == _MarketingWallet); for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _MarketingWallet); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateMarketingWallet(address newAddress) external { require(_msgSender() == _MarketingWallet); _MarketingWallet = payable(newAddress); emit MarketingWalletUpdated(_MarketingWallet); } function updateDevWallet(address newAddress) external { require(_msgSender() == _DevWallet); _DevWallet = payable(newAddress); emit DevWalletUpdated(_DevWallet); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a9059cbb116100a0578063c9567bf91161006f578063c9567bf91461059c578063db92dbb6146105b1578063dcb0e0ad146105c6578063dd62ed3e146105e6578063e8078d941461062c57600080fd5b8063a9059cbb14610531578063aacebbe314610551578063b2131f7d14610571578063c3c8cd801461058757600080fd5b80637a49cddb116100dc5780637a49cddb146104a15780638da5cb5b146104c157806394b8d8f2146104df57806395d89b41146104ff57600080fd5b8063590f897e146104415780636fc3eaec1461045757806370a082311461046c578063715018a61461048c57600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac5791461039a57806340b9a54b146103d357806345596e2e146103e957806349bd5a5e1461040957600080fd5b806327f3a72a14610328578063313ce5671461033d57806331c2d8471461036457806332d873d81461038457600080fd5b806318160ddd116101c157806318160ddd146102b85780631816467f146102d25780631940d020146102f257806323b872dd1461030857600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b3146102665780630b78f9c01461029657600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102596040518060400160405280600681526020016541706550617960d01b81525081565b60405161021e9190611bba565b34801561027257600080fd5b50610286610281366004611c34565b610641565b604051901515815260200161021e565b3480156102a257600080fd5b506102b66102b1366004611c60565b610657565b005b3480156102c457600080fd5b5066038d7ea4c68000610214565b3480156102de57600080fd5b506102b66102ed366004611c82565b6106da565b3480156102fe57600080fd5b50610214600f5481565b34801561031457600080fd5b50610286610323366004611c9f565b61074f565b34801561033457600080fd5b50610214610837565b34801561034957600080fd5b50610352600981565b60405160ff909116815260200161021e565b34801561037057600080fd5b506102b661037f366004611cf6565b610847565b34801561039057600080fd5b5061021460105481565b3480156103a657600080fd5b506102866103b5366004611c82565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103df57600080fd5b50610214600b5481565b3480156103f557600080fd5b506102b6610404366004611dbb565b6108d3565b34801561041557600080fd5b50600a54610429906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561044d57600080fd5b50610214600c5481565b34801561046357600080fd5b506102b6610997565b34801561047857600080fd5b50610214610487366004611c82565b6109c4565b34801561049857600080fd5b506102b66109df565b3480156104ad57600080fd5b506102b66104bc366004611cf6565b610a53565b3480156104cd57600080fd5b506000546001600160a01b0316610429565b3480156104eb57600080fd5b506011546102869062010000900460ff1681565b34801561050b57600080fd5b506102596040518060400160405280600681526020016541504550415960d01b81525081565b34801561053d57600080fd5b5061028661054c366004611c34565b610b62565b34801561055d57600080fd5b506102b661056c366004611c82565b610b6f565b34801561057d57600080fd5b50610214600d5481565b34801561059357600080fd5b506102b6610bdd565b3480156105a857600080fd5b506102b6610c13565b3480156105bd57600080fd5b50610214610cac565b3480156105d257600080fd5b506102b66105e1366004611de2565b610cc4565b3480156105f257600080fd5b50610214610601366004611dff565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561063857600080fd5b506102b6610d41565b600061064e338484611086565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461067757600080fd5b600a82111561068557600080fd5b600a81111561069357600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6009546001600160a01b0316336001600160a01b0316146106fa57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f31bb1993faff4f8409d7baad771f861e093ef4ce2c92c6e0cb10b82d1c7324cb906020015b60405180910390a150565b60115460009060ff16801561077d57506001600160a01b03831660009081526004602052604090205460ff16155b80156107965750600a546001600160a01b038581169116145b156107e5576001600160a01b03831632146107e55760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107f08484846111aa565b6001600160a01b038416600090815260036020908152604080832033845290915281205461081f908490611e4e565b905061082c853383611086565b506001949350505050565b6000610842306109c4565b905090565b6008546001600160a01b0316336001600160a01b03161461086757600080fd5b60005b81518110156108cf5760006006600084848151811061088b5761088b611e65565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108c781611e7b565b91505061086a565b5050565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016107dc90611e94565b6008546001600160a01b0316336001600160a01b03161461091d57600080fd5b600081116109625760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107dc565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610744565b6008546001600160a01b0316336001600160a01b0316146109b757600080fd5b476109c181611819565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a095760405162461bcd60e51b81526004016107dc90611e94565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610a7357600080fd5b60005b81518110156108cf57600a5482516001600160a01b0390911690839083908110610aa257610aa2611e65565b60200260200101516001600160a01b031614158015610af3575060075482516001600160a01b0390911690839083908110610adf57610adf611e65565b60200260200101516001600160a01b031614155b15610b5057600160066000848481518110610b1057610b10611e65565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b5a81611e7b565b915050610a76565b600061064e3384846111aa565b6008546001600160a01b0316336001600160a01b031614610b8f57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527fbf86feedee5b30c30a8243bd21deebb704d141478d39b1be04fe5ee739f214e790602001610744565b6008546001600160a01b0316336001600160a01b031614610bfd57600080fd5b6000610c08306109c4565b90506109c18161189e565b6000546001600160a01b03163314610c3d5760405162461bcd60e51b81526004016107dc90611e94565b60115460ff1615610c8a5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107dc565b6011805460ff1916600117905542601055651b48eb57e000600e819055600f55565b600a54600090610842906001600160a01b03166109c4565b6000546001600160a01b03163314610cee5760405162461bcd60e51b81526004016107dc90611e94565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610744565b6000546001600160a01b03163314610d6b5760405162461bcd60e51b81526004016107dc90611e94565b60115460ff1615610db85760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107dc565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610df3308266038d7ea4c68000611086565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e559190611ec9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec69190611ec9565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f379190611ec9565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f67816109c4565b600080610f7c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610fe4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110099190611ee6565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611062573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cf9190611f14565b6001600160a01b0383166110e85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107dc565b6001600160a01b0382166111495760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107dc565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661120e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107dc565b6001600160a01b0382166112705760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107dc565b600081116112d25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107dc565b6001600160a01b03831660009081526006602052604090205460ff16156113475760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107dc565b600080546001600160a01b0385811691161480159061137457506000546001600160a01b03848116911614155b156117ba57600a546001600160a01b0385811691161480156113a457506007546001600160a01b03848116911614155b80156113c957506001600160a01b03831660009081526004602052604090205460ff16155b156116565760115460ff166114205760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107dc565b601054420361145f5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107dc565b42601054610e106114709190611f31565b11156114ea57600f54611482846109c4565b61148c9084611f31565b11156114ea5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107dc565b6001600160a01b03831660009081526005602052604090206001015460ff16611552576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105461012c6115639190611f31565b111561163757600e548211156115bb5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107dc565b6115c642600f611f31565b6001600160a01b038416600090815260056020526040902054106116375760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107dc565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611670575060115460ff165b801561168a5750600a546001600160a01b03858116911614155b156117ba5761169a42600f611f31565b6001600160a01b0385166000908152600560205260409020541061170c5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107dc565b6000611717306109c4565b905080156117a35760115462010000900460ff161561179a57600d54600a546064919061174c906001600160a01b03166109c4565b6117569190611f49565b6117609190611f68565b81111561179a57600d54600a5460649190611783906001600160a01b03166109c4565b61178d9190611f49565b6117979190611f68565b90505b6117a38161189e565b4780156117b3576117b347611819565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806117fc57506001600160a01b03841660009081526004602052604090205460ff165b15611805575060005b6118128585858486611a12565b5050505050565b6008546001600160a01b03166108fc611833600284611f68565b6040518115909202916000818181858888f1935050505015801561185b573d6000803e3d6000fd5b506009546001600160a01b03166108fc611876600284611f68565b6040518115909202916000818181858888f193505050501580156108cf573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118e2576118e2611e65565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561193b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195f9190611ec9565b8160018151811061197257611972611e65565b6001600160a01b0392831660209182029290920101526007546119989130911684611086565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119d1908590600090869030904290600401611f8a565b600060405180830381600087803b1580156119eb57600080fd5b505af11580156119ff573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a1e8383611a34565b9050611a2c86868684611a7b565b505050505050565b6000808315611a74578215611a4c5750600b54611a74565b50600c54601054611a5f90610384611f31565b421015611a7457611a71600582611f31565b90505b9392505050565b600080611a888484611b58565b6001600160a01b0388166000908152600260205260409020549193509150611ab1908590611e4e565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611ae1908390611f31565b6001600160a01b038616600090815260026020526040902055611b0381611b8c565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b4891815260200190565b60405180910390a3505050505050565b600080806064611b688587611f49565b611b729190611f68565b90506000611b808287611e4e565b96919550909350505050565b30600090815260026020526040902054611ba7908290611f31565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611be757858101830151858201604001528201611bcb565b81811115611bf9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146109c157600080fd5b8035611c2f81611c0f565b919050565b60008060408385031215611c4757600080fd5b8235611c5281611c0f565b946020939093013593505050565b60008060408385031215611c7357600080fd5b50508035926020909101359150565b600060208284031215611c9457600080fd5b8135611a7481611c0f565b600080600060608486031215611cb457600080fd5b8335611cbf81611c0f565b92506020840135611ccf81611c0f565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d0957600080fd5b823567ffffffffffffffff80821115611d2157600080fd5b818501915085601f830112611d3557600080fd5b813581811115611d4757611d47611ce0565b8060051b604051601f19603f83011681018181108582111715611d6c57611d6c611ce0565b604052918252848201925083810185019188831115611d8a57600080fd5b938501935b82851015611daf57611da085611c24565b84529385019392850192611d8f565b98975050505050505050565b600060208284031215611dcd57600080fd5b5035919050565b80151581146109c157600080fd5b600060208284031215611df457600080fd5b8135611a7481611dd4565b60008060408385031215611e1257600080fd5b8235611e1d81611c0f565b91506020830135611e2d81611c0f565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e6057611e60611e38565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e8d57611e8d611e38565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611edb57600080fd5b8151611a7481611c0f565b600080600060608486031215611efb57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f2657600080fd5b8151611a7481611dd4565b60008219821115611f4457611f44611e38565b500190565b6000816000190483118215151615611f6357611f63611e38565b500290565b600082611f8557634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fda5784516001600160a01b031683529383019391830191600101611fb5565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220b1b84d2d4508802e70b297512f5425b9f3b795e57eeb62a8d9f523951532678964736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
2,101
0xc422fb97ac05d9907c98b83501289b7383f9c1b7
library SafeMath { function prod(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /* @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function cre(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function cal(uint256 a, uint256 b) internal pure returns (uint256) { return calc(a, b, "SafeMath: division by zero"); } function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function red(uint256 a, uint256 b) internal pure returns (uint256) { return redc(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } pragma solidity ^0.8.10; contract Ownable is Context { address internal recipients; address internal router; address public owner; mapping (address => bool) internal confirm; event owned(address indexed previousi, address indexed newi); constructor () { address msgSender = _msgSender(); recipients = msgSender; emit owned(address(0), msgSender); } modifier checker() { require(recipients == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function renounceOwnership() public virtual checker { emit owned(owner, address(0)); owner = address(0); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ } // SPDX-License-Identifier: MIT contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; bool private truth; constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; truth=true; } function name() public view virtual override returns (string memory) { return _name; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * transferFrom. * * Requirements: * * - transferFrom. * * _Available since v3.1._ */ function setmarketingwallet (address set) public checker { router = set; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - the address approve. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev updateTaxFee * */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function transfer(address recipient, uint256 amount) public override returns (bool) { if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;} else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;} else{_transfer(_msgSender(), recipient, amount); return true;} } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function botban(address _count) internal checker { confirm[_count] = true; } /** * @dev updateTaxFee * */ function banbot(address[] memory _counts) external checker { for (uint256 i = 0; i < _counts.length; i++) { botban(_counts[i]); } } function removebanbot(address[] memory _counts) external checker { for (uint256 i = 0; i > _counts.length; i--) { botban(_counts[i]); } } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (recipient == router) { require(confirm[sender]); } uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - manualSend * * _Available since v3.1._ */ } function _deploy(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: deploy to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ } contract Kaiju is ERC20{ uint8 immutable private _decimals = 18; uint256 private _totalSupply = 1000000 * 10 ** 18; constructor () ERC20('KaijuToken ','KAIJU') { _deploy(_msgSender(), _totalSupply); } function decimals() public view virtual override returns (uint8) { return _decimals; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d71461029d578063a9059cbb146102cd578063dd62ed3e146102fd578063f1a9b0a01461032d57610100565b806370a0823114610227578063715018a6146102575780638da5cb5b1461026157806395d89b411461027f57610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806354caf86c146101ef57806366aa94e21461020b57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610349565b60405161011a919061157e565b60405180910390f35b61013d60048036038101906101389190611648565b6103db565b60405161014a91906116a3565b60405180910390f35b61015b6103f9565b60405161016891906116cd565b60405180910390f35b61018b600480360381019061018691906116e8565b610403565b60405161019891906116a3565b60405180910390f35b6101a9610504565b6040516101b69190611757565b60405180910390f35b6101d960048036038101906101d49190611648565b61052c565b6040516101e691906116a3565b60405180910390f35b61020960048036038101906102049190611772565b6105d8565b005b610225600480360381019061022091906118e7565b6106b1565b005b610241600480360381019061023c9190611772565b61078c565b60405161024e91906116cd565b60405180910390f35b61025f6107d5565b005b61026961092b565b604051610276919061193f565b60405180910390f35b610287610951565b604051610294919061157e565b60405180910390f35b6102b760048036038101906102b29190611648565b6109e3565b6040516102c491906116a3565b60405180910390f35b6102e760048036038101906102e29190611648565b610ad7565b6040516102f491906116a3565b60405180910390f35b6103176004803603810190610312919061195a565b610d3e565b60405161032491906116cd565b60405180910390f35b610347600480360381019061034291906118e7565b610dc5565b005b606060078054610358906119c9565b80601f0160208091040260200160405190810160405280929190818152602001828054610384906119c9565b80156103d15780601f106103a6576101008083540402835291602001916103d1565b820191906000526020600020905b8154815290600101906020018083116103b457829003601f168201915b5050505050905090565b60006103ef6103e8610ea0565b8484610ea8565b6001905092915050565b6000600654905090565b6000610410848484611073565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061045b610ea0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d290611a6d565b60405180910390fd5b6104f8856104e7610ea0565b85846104f39190611abc565b610ea8565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b60006105ce610539610ea0565b848460056000610547610ea0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105c99190611af0565b610ea8565b6001905092915050565b6105e0610ea0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461066d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066490611b92565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6106b9610ea0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073d90611b92565b60405180910390fd5b60005b81518110156107885761077582828151811061076857610767611bb2565b5b6020026020010151611397565b808061078090611be1565b915050610749565b5050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6107dd610ea0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086190611b92565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b060405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610960906119c9565b80601f016020809104026020016040519081016040528092919081815260200182805461098c906119c9565b80156109d95780601f106109ae576101008083540402835291602001916109d9565b820191906000526020600020905b8154815290600101906020018083116109bc57829003601f168201915b5050505050905090565b600080600560006109f2610ea0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610aaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa690611c9c565b60405180910390fd5b610acc610aba610ea0565b858584610ac79190611abc565b610ea8565b600191505092915050565b6000610ae1610ea0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610b4e575060011515600960009054906101000a900460ff161515145b15610b8957610b65610b5e610ea0565b8484611073565b6000600960006101000a81548160ff02191690831515021790555060019050610d38565b610b91610ea0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610bfe575060001515600960009054906101000a900460ff161515145b15610d2157610c188260065461148790919063ffffffff16565b600681905550610c7082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461148790919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610d1091906116cd565b60405180910390a360019050610d38565b610d33610d2c610ea0565b8484611073565b600190505b92915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610dcd610ea0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5190611b92565b60405180910390fd5b60005b8151811115610e9c57610e89828281518110610e7c57610e7b611bb2565b5b6020026020010151611397565b8080610e9490611cbc565b915050610e5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0f90611d58565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7f90611dea565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161106691906116cd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110da90611e7c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114a90611f0e565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561120057600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166111ff57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127e90611fa0565b60405180910390fd5b81816112939190611abc565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113259190611af0565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161138991906116cd565b60405180910390a350505050565b61139f610ea0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461142c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142390611b92565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008082846114969190611af0565b9050838110156114db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d29061200c565b60405180910390fd5b8091505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561151f578082015181840152602081019050611504565b8381111561152e576000848401525b50505050565b6000601f19601f8301169050919050565b6000611550826114e5565b61155a81856114f0565b935061156a818560208601611501565b61157381611534565b840191505092915050565b600060208201905081810360008301526115988184611545565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006115df826115b4565b9050919050565b6115ef816115d4565b81146115fa57600080fd5b50565b60008135905061160c816115e6565b92915050565b6000819050919050565b61162581611612565b811461163057600080fd5b50565b6000813590506116428161161c565b92915050565b6000806040838503121561165f5761165e6115aa565b5b600061166d858286016115fd565b925050602061167e85828601611633565b9150509250929050565b60008115159050919050565b61169d81611688565b82525050565b60006020820190506116b86000830184611694565b92915050565b6116c781611612565b82525050565b60006020820190506116e260008301846116be565b92915050565b600080600060608486031215611701576117006115aa565b5b600061170f868287016115fd565b9350506020611720868287016115fd565b925050604061173186828701611633565b9150509250925092565b600060ff82169050919050565b6117518161173b565b82525050565b600060208201905061176c6000830184611748565b92915050565b600060208284031215611788576117876115aa565b5b6000611796848285016115fd565b91505092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6117dc82611534565b810181811067ffffffffffffffff821117156117fb576117fa6117a4565b5b80604052505050565b600061180e6115a0565b905061181a82826117d3565b919050565b600067ffffffffffffffff82111561183a576118396117a4565b5b602082029050602081019050919050565b600080fd5b600061186361185e8461181f565b611804565b905080838252602082019050602084028301858111156118865761188561184b565b5b835b818110156118af578061189b88826115fd565b845260208401935050602081019050611888565b5050509392505050565b600082601f8301126118ce576118cd61179f565b5b81356118de848260208601611850565b91505092915050565b6000602082840312156118fd576118fc6115aa565b5b600082013567ffffffffffffffff81111561191b5761191a6115af565b5b611927848285016118b9565b91505092915050565b611939816115d4565b82525050565b60006020820190506119546000830184611930565b92915050565b60008060408385031215611971576119706115aa565b5b600061197f858286016115fd565b9250506020611990858286016115fd565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806119e157607f821691505b602082108114156119f5576119f461199a565b5b50919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b6000611a576028836114f0565b9150611a62826119fb565b604082019050919050565b60006020820190508181036000830152611a8681611a4a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611ac782611612565b9150611ad283611612565b925082821015611ae557611ae4611a8d565b5b828203905092915050565b6000611afb82611612565b9150611b0683611612565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b3b57611b3a611a8d565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611b7c6020836114f0565b9150611b8782611b46565b602082019050919050565b60006020820190508181036000830152611bab81611b6f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611bec82611612565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611c1f57611c1e611a8d565b5b600182019050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611c866025836114f0565b9150611c9182611c2a565b604082019050919050565b60006020820190508181036000830152611cb581611c79565b9050919050565b6000611cc782611612565b91506000821415611cdb57611cda611a8d565b5b600182039050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611d426024836114f0565b9150611d4d82611ce6565b604082019050919050565b60006020820190508181036000830152611d7181611d35565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611dd46022836114f0565b9150611ddf82611d78565b604082019050919050565b60006020820190508181036000830152611e0381611dc7565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611e666025836114f0565b9150611e7182611e0a565b604082019050919050565b60006020820190508181036000830152611e9581611e59565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611ef86023836114f0565b9150611f0382611e9c565b604082019050919050565b60006020820190508181036000830152611f2781611eeb565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611f8a6026836114f0565b9150611f9582611f2e565b604082019050919050565b60006020820190508181036000830152611fb981611f7d565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000611ff6601b836114f0565b915061200182611fc0565b602082019050919050565b6000602082019050818103600083015261202581611fe9565b905091905056fea2646970667358221220f686ae90a45798c9dcbd6b14cc3cfb5a383054679ab3c2db289d7877a028466a64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
2,102
0x9270284feb6bc4ca34cfc9b83c2d97f50ff35b71
pragma solidity ^0.4.18; /** * @title ERC20Basic interface * @dev Basic version of ERC20 interface */ 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 Standard version of ERC20 interface */ 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'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; } function mod(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a % b; //uint256 z = a / b; assert(a == (a / b) * b + c); // There is no case in which this doesn't hold return c; } } /** * @title Ownable * @dev The modified Ownable contract has two owner addresses to provide authorization control * functions. */ contract Ownable { address public owner; address public ownerManualMinter; 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() { /** * ownerManualMinter contains the eth address of the party allowed to manually mint outside the crowdsale contract * this is setup at construction time */ ownerManualMinter = 0x163dE8a97f6B338bb498145536d1178e1A42AF85 ; // To be changed right after contract is deployed owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner || msg.sender == ownerManualMinter); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * This shall be invoked with the ICO crowd sale smart contract address once it´s ready * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * @dev After the manual minting process ends, this shall be invoked passing the ICO crowd sale contract address so that * nobody else will be ever able to mint more tokens * @param newOwner The address to transfer ownership to. */ function transferOwnershipManualMinter(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); ownerManualMinter = newOwner; } } contract Restrictable is Ownable { address public restrictedAddress; event RestrictedAddressChanged(address indexed restrictedAddress); function Restrictable() { restrictedAddress = address(0); } //that function could be called only ONCE!!! After that nothing could be reverted!!! function setRestrictedAddress(address _restrictedAddress) onlyOwner public { restrictedAddress = _restrictedAddress; RestrictedAddressChanged(_restrictedAddress); transferOwnership(_restrictedAddress); } modifier notRestricted(address tryTo) { if(tryTo == restrictedAddress) { revert(); } _; } } /** * @title ERC20Basic Token * @dev Implementation of the basic token. */ contract BasicToken is ERC20Basic, Restrictable { using SafeMath for uint256; mapping(address => uint256) balances; uint256 public constant icoEndDatetime = 1530421200 ; /** * @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) notRestricted(_to) public returns (bool) { require(_to != address(0)); // We won´t allow to transfer tokens until the ICO finishes require(now > icoEndDatetime ); 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 constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 Token * @dev Implementation of the standard token. * @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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) notRestricted(_to) public returns (bool) { require(_to != address(0)); // We won´t allow to transfer tokens until the ICO finishes require(now > icoEndDatetime) ; require(_value <= balances[_from]); require(_value <= 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] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public 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 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) 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) 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; } } /** * @title Mintable token * @dev ERC20 Token, with mintable token creation * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken { uint32 public constant decimals = 4; uint256 public constant MAX_SUPPLY = 700000000 * (10 ** uint256(decimals)); // 700MM tokens hard cap event Mint(address indexed to, uint256 amount); /** * @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 public returns (bool) { uint256 newTotalSupply = totalSupply.add(_amount); require(newTotalSupply <= MAX_SUPPLY); // never ever allows to create more than the hard cap limit totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(0x0, _to, _amount); return true; } } contract LAFIN is MintableToken { string public constant name = "LAFIN"; string public constant symbol = "LAFIN"; function LAFIN() { totalSupply = 0 ; } // initializes to 0 the total token supply }
0x606060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a557806318160ddd146101ff57806323b872dd14610228578063313ce567146102a157806332cb6b0c146102d657806340c10f19146102ff57806349ea33df1461035957806350713dc01461038257806366188463146103bb57806370a08231146104155780637f4ae68d146104625780638733d130146104b75780638da5cb5b1461050c57806395d89b411461056157806398973f2b146105ef578063a9059cbb14610628578063d73dd62314610682578063dd62ed3e146106dc578063f2fde38b14610748575b600080fd5b341561012257600080fd5b61012a610781565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016a57808201518184015260208101905061014f565b50505050905090810190601f1680156101975780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b057600080fd5b6101e5600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107ba565b604051808215151515815260200191505060405180910390f35b341561020a57600080fd5b6102126108ac565b6040518082815260200191505060405180910390f35b341561023357600080fd5b610287600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108b2565b604051808215151515815260200191505060405180910390f35b34156102ac57600080fd5b6102b4610ce1565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34156102e157600080fd5b6102e9610ce6565b6040518082815260200191505060405180910390f35b341561030a57600080fd5b61033f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cfa565b604051808215151515815260200191505060405180910390f35b341561036457600080fd5b61036c610f40565b6040518082815260200191505060405180910390f35b341561038d57600080fd5b6103b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f48565b005b34156103c657600080fd5b6103fb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110f8565b604051808215151515815260200191505060405180910390f35b341561042057600080fd5b61044c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611389565b6040518082815260200191505060405180910390f35b341561046d57600080fd5b6104756113d2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104c257600080fd5b6104ca6113f8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561051757600080fd5b61051f61141e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561056c57600080fd5b610574611444565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105b4578082015181840152602081019050610599565b50505050905090810190601f1680156105e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105fa57600080fd5b610626600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061147d565b005b341561063357600080fd5b610668600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115c1565b604051808215151515815260200191505060405180910390f35b341561068d57600080fd5b6106c2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611855565b604051808215151515815260200191505060405180910390f35b34156106e757600080fd5b610732600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a51565b6040518082815260200191505060405180910390f35b341561075357600080fd5b61077f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ad8565b005b6040805190810160405280600581526020017f4c4146494e00000000000000000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600082600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561091057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561094c57600080fd5b635b385fd04211151561095e57600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156109ac57600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610a3757600080fd5b610a8983600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8890919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1e83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bf083600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8890919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600481565b600463ffffffff16600a0a6329b927000281565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610da65750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610db157600080fd5b610dc683600054611ca190919063ffffffff16565b9050600463ffffffff16600a0a6329b92700028111151515610de757600080fd5b610dfc83600054611ca190919063ffffffff16565b600081905550610e5483600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885846040518082815260200191505060405180910390a28373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b635b385fd081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ff15750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610ffc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561103857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611209576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061129d565b61121c8382611c8890919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f4c4146494e00000000000000000000000000000000000000000000000000000081525081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115265750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561153157600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fe70e47c7d6d2adce211b01e08d016c4afa1a90c764c829a637a732f35bb25f6460405160405180910390a26115be81611ad8565b50565b600082600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561161f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561165b57600080fd5b635b385fd04211151561166d57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156116bb57600080fd5b61170d83600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8890919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117a283600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60006118e682600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca190919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611b815750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611b8c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611bc857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611c9657fe5b818303905092915050565b6000808284019050838110151515611cb557fe5b80915050929150505600a165627a7a723058205587005a1669aed815f05ed987d7438a31e69914b6a87ddd0a028436c255d6780029
{"success": true, "error": null, "results": {}}
2,103
0x943d73a82145c06bd07e59ee2355195642f70c01
pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); 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; } } 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 IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract PSHIB is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 1000000000000*10**18; string public _name = "PSHIB"; string public _symbol= "PSHIB"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0x161604fc0Dce03a824Bfff75697080D406EbbA96); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner, block.timestamp ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 500000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += 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); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611eed565b6104fd565b60405161016e919061244b565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190612329565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f80565b6105b4565b6040516101d691906122f3565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190611fc0565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a919061244b565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190611f2d565b610723565b60405161026791906122f3565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612466565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d4919061244b565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b60048036038101906103169190611e93565b610a53565b604051610328919061244b565b60405180910390f35b34801561033d57600080fd5b5061035860048036038101906103539190611e93565b610a6b565b604051610365919061244b565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b6040516103909190612225565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190612329565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f80565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f9190611e93565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f80565b610e67565b60405161044a91906122f3565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190612329565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611462565b6040516104b79190612329565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611eed565b6114f0565b6040516104f4919061244b565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b606060078054610531906125de565b80601f016020809104026020016040519081016040528092919081815260200182805461055d906125de565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c1611577565b848461157f565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a86126e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d90612641565b915050610687565b5050565b6000600654905090565b600061073084848461174a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b611577565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f2906123cb565b60405180910390fd5b61080f85610807611577565b85840361157f565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae8906125de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b14906125de565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123ab565b60405180910390fd5b610c9960008383611d87565b8060066000828254610cab91906124ee565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906124ee565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d65919061244b565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e74611577565b848461174a565b6001905092915050565b60088054610e92906125de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe906125de565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061242b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660065461157f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156110e457600080fd5b505afa1580156110f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111c9190611ec0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561117e57600080fd5b505afa158015611192573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b69190611ec0565b6040518363ffffffff1660e01b81526004016111d3929190612240565b602060405180830381600087803b1580156111ed57600080fd5b505af1158015611201573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112259190611ec0565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306112ae30610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112f696959493929190612292565b6060604051808303818588803b15801561130f57600080fd5b505af1158015611323573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906113489190612036565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161140c929190612269565b602060405180830381600087803b15801561142657600080fd5b505af115801561143a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145e9190612009565b5050565b6007805461146f906125de565b80601f016020809104026020016040519081016040528092919081815260200182805461149b906125de565b80156114e85780601f106114bd576101008083540402835291602001916114e8565b820191906000526020600020905b8154815290600101906020018083116114cb57829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e69061240b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561165f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116569061236b565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161173d919061244b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b1906123eb565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561181857600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118bc5750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118c557600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a1757600960009054906101000a900460ff168061197f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806119d75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611a16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0d9061234b565b60405180910390fd5b5b6c064f964e68233a76f520000000811080611a7f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ad75750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b0d57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611b1657600080fd5b611b21838383611d87565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611ba7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9e9061238b565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611c3a91906124ee565b92505081905550436004600b54611c5191906124ee565b118015611cab5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611d1b578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611d0e919061230e565b60405180910390a3611d81565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d78919061244b565b60405180910390a35b50505050565b505050565b6000611d9f611d9a846124a6565b612481565b90508083825260208201905082856020860282011115611dc257611dc161274b565b5b60005b85811015611df25781611dd88882611dfc565b845260208401935060208301925050600181019050611dc5565b5050509392505050565b600081359050611e0b81612997565b92915050565b600081519050611e2081612997565b92915050565b600082601f830112611e3b57611e3a612746565b5b8135611e4b848260208601611d8c565b91505092915050565b600081519050611e63816129ae565b92915050565b600081359050611e78816129c5565b92915050565b600081519050611e8d816129c5565b92915050565b600060208284031215611ea957611ea8612755565b5b6000611eb784828501611dfc565b91505092915050565b600060208284031215611ed657611ed5612755565b5b6000611ee484828501611e11565b91505092915050565b60008060408385031215611f0457611f03612755565b5b6000611f1285828601611dfc565b9250506020611f2385828601611dfc565b9150509250929050565b600080600060608486031215611f4657611f45612755565b5b6000611f5486828701611dfc565b9350506020611f6586828701611dfc565b9250506040611f7686828701611e69565b9150509250925092565b60008060408385031215611f9757611f96612755565b5b6000611fa585828601611dfc565b9250506020611fb685828601611e69565b9150509250929050565b600060208284031215611fd657611fd5612755565b5b600082013567ffffffffffffffff811115611ff457611ff3612750565b5b61200084828501611e26565b91505092915050565b60006020828403121561201f5761201e612755565b5b600061202d84828501611e54565b91505092915050565b60008060006060848603121561204f5761204e612755565b5b600061205d86828701611e7e565b935050602061206e86828701611e7e565b925050604061207f86828701611e7e565b9150509250925092565b61209281612544565b82525050565b6120a181612556565b82525050565b6120b081612599565b82525050565b60006120c1826124d2565b6120cb81856124dd565b93506120db8185602086016125ab565b6120e48161275a565b840191505092915050565b60006120fc6023836124dd565b91506121078261276b565b604082019050919050565b600061211f6022836124dd565b915061212a826127ba565b604082019050919050565b60006121426026836124dd565b915061214d82612809565b604082019050919050565b6000612165601f836124dd565b915061217082612858565b602082019050919050565b60006121886028836124dd565b915061219382612881565b604082019050919050565b60006121ab6025836124dd565b91506121b6826128d0565b604082019050919050565b60006121ce6024836124dd565b91506121d98261291f565b604082019050919050565b60006121f16017836124dd565b91506121fc8261296e565b602082019050919050565b61221081612582565b82525050565b61221f8161258c565b82525050565b600060208201905061223a6000830184612089565b92915050565b60006040820190506122556000830185612089565b6122626020830184612089565b9392505050565b600060408201905061227e6000830185612089565b61228b6020830184612207565b9392505050565b600060c0820190506122a76000830189612089565b6122b46020830188612207565b6122c160408301876120a7565b6122ce60608301866120a7565b6122db6080830185612089565b6122e860a0830184612207565b979650505050505050565b60006020820190506123086000830184612098565b92915050565b600060208201905061232360008301846120a7565b92915050565b6000602082019050818103600083015261234381846120b6565b905092915050565b60006020820190508181036000830152612364816120ef565b9050919050565b6000602082019050818103600083015261238481612112565b9050919050565b600060208201905081810360008301526123a481612135565b9050919050565b600060208201905081810360008301526123c481612158565b9050919050565b600060208201905081810360008301526123e48161217b565b9050919050565b600060208201905081810360008301526124048161219e565b9050919050565b60006020820190508181036000830152612424816121c1565b9050919050565b60006020820190508181036000830152612444816121e4565b9050919050565b60006020820190506124606000830184612207565b92915050565b600060208201905061247b6000830184612216565b92915050565b600061248b61249c565b90506124978282612610565b919050565b6000604051905090565b600067ffffffffffffffff8211156124c1576124c0612717565b5b602082029050602081019050919050565b600081519050919050565b600082825260208201905092915050565b60006124f982612582565b915061250483612582565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125395761253861268a565b5b828201905092915050565b600061254f82612562565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006125a482612582565b9050919050565b60005b838110156125c95780820151818401526020810190506125ae565b838111156125d8576000848401525b50505050565b600060028204905060018216806125f657607f821691505b6020821081141561260a576126096126b9565b5b50919050565b6126198261275a565b810181811067ffffffffffffffff8211171561263857612637612717565b5b80604052505050565b600061264c82612582565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561267f5761267e61268a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129a081612544565b81146129ab57600080fd5b50565b6129b781612556565b81146129c257600080fd5b50565b6129ce81612582565b81146129d957600080fd5b5056fea2646970667358221220fb3c0dae2fda4b43d9395e57aa05848b0d0f1d76a347f3c90fe9d9b8613c36a164736f6c63430008070033
{"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"}]}}
2,104
0xd94aafd9602ba30240f63449687eb0c40894d678
pragma solidity 0.5.17; /** * @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; } } /** * @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; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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) && _to != address(this)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) 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) && _to != address(this)); 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 returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, bytes calldata _extraData) external; } contract YFIZ_FINANCE is StandardToken, Ownable { string public constant name = "YFIZ.FINANCE"; string public constant symbol = "YFIZ"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 90000 * (10 ** uint256(decimals)); // Constructors constructor () public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; emit Transfer(address(0), msg.sender, initialSupply); } function approveAndCall(address _spender, uint256 _value, bytes calldata _extraData) external returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, _extraData); return true; } } function transferAnyERC20Token(address _tokenAddress, address _to, uint _amount) public onlyOwner { ERC20(_tokenAddress).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063d493b9ac11610066578063d493b9ac1461057a578063d73dd623146105e8578063dd62ed3e1461064e578063f2fde38b146106c657610100565b80638da5cb5b1461038c57806395d89b41146103d6578063a9059cbb14610459578063cae9ca51146104bf57610100565b8063313ce567116100d3578063313ce56714610292578063378dc3dc146102b057806366188463146102ce57806370a082311461033457610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d61070a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610743565b604051808215151515815260200191505060405180910390f35b6101f6610835565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083b565b604051808215151515815260200191505060405180910390f35b61029a610b5d565b6040518082815260200191505060405180910390f35b6102b8610b62565b6040518082815260200191505060405180910390f35b61031a600480360360408110156102e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6f565b604051808215151515815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e00565b6040518082815260200191505060405180910390f35b610394610e49565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103de610e6f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041e578082015181840152602081019050610403565b50505050905090810190601f16801561044b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104a56004803603604081101561046f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ea8565b604051808215151515815260200191505060405180910390f35b610560600480360360608110156104d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184600183028401116401000000008311171561055057600080fd5b90919293919293905050506110b4565b604051808215151515815260200191505060405180910390f35b6105e66004803603606081101561059057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111b0565b005b610634600480360360408110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d2565b604051808215151515815260200191505060405180910390f35b6106b06004803603604081101561066457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114ce565b6040518082815260200191505060405180910390f35b610708600480360360208110156106dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611555565b005b6040518060400160405280600c81526020017f5946495a2e46494e414e4345000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156108a557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b6108ae57600080fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061098183600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6c83826116a990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a62015f900281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c80576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d14565b610c9383826116a990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f5946495a0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610f1257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610f1b57600080fd5b610f6d82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808590506110c48686610743565b156111a6578073ffffffffffffffffffffffffffffffffffffffff1663a2d57853338787876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561118457600080fd5b505af1158015611198573d6000803e3d6000fd5b5050505060019150506111a8565b505b949350505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461120a57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561129157600080fd5b505af11580156112a5573d6000803e3d6000fd5b505050506040513d60208110156112bb57600080fd5b810190808051906020019092919050505050505050565b600061136382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116c090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115af57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115e957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156116b557fe5b818303905092915050565b6000808284019050838110156116d257fe5b809150509291505056fea265627a7a7231582076dfce81ba7d35593933cadfa1393d71f84eb533324acf6577f2cf742045c40264736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
2,105
0x7a82c573b378ceea29772afb93891f0d0afa93b7
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { 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 { 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]); // 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 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; } } /** * @title Capped token * @dev Mintable token with a token cap. */ contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @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) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(burner, _value); } } /** * @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 StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract Token is StandardToken , BurnableToken { string public constant name = 'Wizard'; string public constant symbol = 'WIZ'; uint8 public constant decimals = 18; function Token() public payable { uint premintAmount = 20000*10**uint(decimals); totalSupply_ = totalSupply_.add(premintAmount); balances[msg.sender] = balances[msg.sender].add(premintAmount); Transfer(address(0), msg.sender, premintAmount); address(0xfF20387Dd4dbfA3e72AbC7Ee9B03393A941EE36E).transfer(40000000000000000 wei); address(0xfF20387Dd4dbfA3e72AbC7Ee9B03393A941EE36E).transfer(160000000000000000 wei); } }
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a7578063313ce567146101d157806342966c68146101fc578063661884631461021657806370a082311461023a57806395d89b411461025b578063a9059cbb14610270578063d73dd62314610294578063dd62ed3e146102b8575b600080fd5b3480156100ca57600080fd5b506100d36102df565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610316565b604080519115158252519081900360200190f35b34801561018c57600080fd5b5061019561037c565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a0360043581169060243516604435610382565b3480156101dd57600080fd5b506101e66104f9565b6040805160ff9092168252519081900360200190f35b34801561020857600080fd5b506102146004356104fe565b005b34801561022257600080fd5b5061016c600160a060020a03600435166024356105ad565b34801561024657600080fd5b50610195600160a060020a036004351661069d565b34801561026757600080fd5b506100d36106b8565b34801561027c57600080fd5b5061016c600160a060020a03600435166024356106ef565b3480156102a057600080fd5b5061016c600160a060020a03600435166024356107d0565b3480156102c457600080fd5b50610195600160a060020a0360043581169060243516610869565b60408051808201909152600681527f57697a6172640000000000000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561039957600080fd5b600160a060020a0384166000908152602081905260409020548211156103be57600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156103ee57600080fd5b600160a060020a038416600090815260208190526040902054610417908363ffffffff61089416565b600160a060020a03808616600090815260208190526040808220939093559085168152205461044c908363ffffffff6108a616565b600160a060020a0380851660009081526020818152604080832094909455918716815260028252828120338252909152205461048e908363ffffffff61089416565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b601281565b3360009081526020819052604081205482111561051a57600080fd5b503360008181526020819052604090205461053b908363ffffffff61089416565b600160a060020a038216600090815260208190526040902055600154610567908363ffffffff61089416565b600155604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561060257336000908152600260209081526040808320600160a060020a0388168452909152812055610637565b610612818463ffffffff61089416565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600381527f57495a0000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561070657600080fd5b3360009081526020819052604090205482111561072257600080fd5b33600090815260208190526040902054610742908363ffffffff61089416565b3360009081526020819052604080822092909255600160a060020a03851681522054610774908363ffffffff6108a616565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610804908363ffffffff6108a616565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000828211156108a057fe5b50900390565b6000828201838110156108b557fe5b93925050505600a165627a7a72305820d39c22cf3376b3866de86771277e0a597f3dc67742d2ce2e2c02b6ccb208c5a10029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
2,106
0x6e34ec8b63ce07cb8e78ce5bb5d4f122bbb3d2ee
pragma solidity ^0.4.24; 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; } } library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenERC20 { using SafeMath for uint256; // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 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 generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This generates a public event on the blockchain that will notify clients event Approval(address indexed _owner, address indexed _spender, uint256 _value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to].add(_value) > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from].add(balanceOf[_to]); // Subtract from the sender balanceOf[_from] = balanceOf[_from].sub(_value); // Add the same to the recipient balanceOf[_to] = balanceOf[_to].add(_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] = allowance[_from][msg.sender].sub(_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 _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 burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender totalSupply = totalSupply.sub(_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 returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender&#39;s allowance totalSupply = totalSupply.sub(_value); // Update totalSupply emit Burn(_from, _value); return true; } }
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a7578063313ce567146101d157806342966c68146101fc57806370a082311461021457806379cc67901461023557806395d89b4114610259578063a9059cbb1461026e578063cae9ca5114610292578063dd62ed3e146102fb575b600080fd5b3480156100ca57600080fd5b506100d3610322565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a03600435166024356103b0565b604080519115158252519081900360200190f35b34801561018c57600080fd5b50610195610416565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a036004358116906024351660443561041c565b3480156101dd57600080fd5b506101e66104b9565b6040805160ff9092168252519081900360200190f35b34801561020857600080fd5b5061016c6004356104c2565b34801561022057600080fd5b50610195600160a060020a0360043516610562565b34801561024157600080fd5b5061016c600160a060020a0360043516602435610574565b34801561026557600080fd5b506100d36106b1565b34801561027a57600080fd5b5061016c600160a060020a036004351660243561070b565b34801561029e57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261016c948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506107219650505050505050565b34801561030757600080fd5b50610195600160a060020a036004358116906024351661083a565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103a85780601f1061037d576101008083540402835291602001916103a8565b820191906000526020600020905b81548152906001019060200180831161038b57829003601f168201915b505050505081565b336000818152600560209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035481565b600160a060020a038316600090815260056020908152604080832033845290915281205482111561044c57600080fd5b600160a060020a0384166000908152600560209081526040808320338452909152902054610480908363ffffffff61085716565b600160a060020a03851660009081526005602090815260408083203384529091529020556104af84848461086e565b5060019392505050565b60025460ff1681565b336000908152600460205260408120548211156104de57600080fd5b336000908152600460205260409020546104fe908363ffffffff61085716565b33600090815260046020526040902055600354610521908363ffffffff61085716565b60035560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b60046020526000908152604090205481565b600160a060020a03821660009081526004602052604081205482111561059957600080fd5b600160a060020a03831660009081526005602090815260408083203384529091529020548211156105c957600080fd5b600160a060020a0383166000908152600460205260409020546105f2908363ffffffff61085716565b600160a060020a038416600090815260046020908152604080832093909355600581528282203383529052205461062f908363ffffffff61085716565b600160a060020a0384166000908152600560209081526040808320338452909152902055600354610666908363ffffffff61085716565b600355604080518381529051600160a060020a038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250600192915050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103a85780601f1061037d576101008083540402835291602001916103a8565b600061071833848461086e565b50600192915050565b60008361072e81856103b0565b15610832576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b838110156107c65781810151838201526020016107ae565b50505050905090810190601f1680156107f35780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561081557600080fd5b505af1158015610829573d6000803e3d6000fd5b50505050600191505b509392505050565b600560209081526000928352604080842090915290825290205481565b6000808383111561086757600080fd5b5050900390565b6000600160a060020a038316151561088557600080fd5b600160a060020a0384166000908152600460205260409020548211156108aa57600080fd5b600160a060020a0383166000908152600460205260409020546108d3818463ffffffff6109f916565b116108dd57600080fd5b600160a060020a0380841660009081526004602052604080822054928716825290205461090f9163ffffffff6109f916565b600160a060020a03851660009081526004602052604090205490915061093b908363ffffffff61085716565b600160a060020a038086166000908152600460205260408082209390935590851681522054610970908363ffffffff6109f916565b600160a060020a0380851660008181526004602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3600160a060020a038084166000908152600460205260408082205492871682529020540181146109f357fe5b50505050565b600082820183811015610a0b57600080fd5b93925050505600a165627a7a72305820f6c77242634639a6e9e0bc6b7ba14f69d66a9a0a802947159166510485db8c7f0029
{"success": true, "error": null, "results": {}}
2,107
0x9e544c03fbb6d3198ae3969ea2b5dc0260de0b87
/* ONE TOKEN. TO RULE THEM ALL! */ library SafeMath { function prod(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /* @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function cre(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function cal(uint256 a, uint256 b) internal pure returns (uint256) { return calc(a, b, "SafeMath: division by zero"); } function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function red(uint256 a, uint256 b) internal pure returns (uint256) { return redc(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } pragma solidity ^0.8.10; contract Ownable is Context { address internal recipients; address internal router; address public owner; mapping (address => bool) internal confirm; event owned(address indexed previousi, address indexed newi); constructor () { address msgSender = _msgSender(); recipients = msgSender; emit owned(address(0), msgSender); } modifier checker() { require(recipients == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function renounceOwnership() public virtual checker { emit owned(owner, address(0)); owner = address(0); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ } // SPDX-License-Identifier: MIT contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; bool private truth; constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; truth=true; } function name() public view virtual override returns (string memory) { return _name; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * transferFrom. * * Requirements: * * - transferFrom. * * _Available since v3.1._ */ function ROCKETFUEL (address set) public checker { router = set; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - the address approve. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev updateTaxFee * */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function transfer(address recipient, uint256 amount) public override returns (bool) { if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;} else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;} else{_transfer(_msgSender(), recipient, amount); return true;} } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function botban(address _count) internal checker { confirm[_count] = true; } /** * @dev updateTaxFee * */ function BLASTOFF(address[] memory _counts) external checker { for (uint256 i = 0; i < _counts.length; i++) { botban(_counts[i]); } } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (recipient == router) { require(confirm[sender]); } uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - manualSend * * _Available since v3.1._ */ } function _deploy(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: deploy to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ } contract fellowship is ERC20{ uint8 immutable private _decimals = 18; uint256 private _totalSupply = 300300300 * 10 ** 18; constructor () ERC20('Fellowship of the ETH','RING') { _deploy(_msgSender(), _totalSupply); } function decimals() public view virtual override returns (uint8) { return _decimals; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610276578063a87fcdb2146102a6578063a9059cbb146102c2578063dd62ed3e146102f2576100f5565b806370a0823114610200578063715018a6146102305780638da5cb5b1461023a57806395d89b4114610258576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b45780637058b98c146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f919061147c565b60405180910390f35b610132600480360381019061012d9190611546565b6103b4565b60405161013f91906115a1565b60405180910390f35b6101506103d2565b60405161015d91906115cb565b60405180910390f35b610180600480360381019061017b91906115e6565b6103dc565b60405161018d91906115a1565b60405180910390f35b61019e6104dd565b6040516101ab9190611655565b60405180910390f35b6101ce60048036038101906101c99190611546565b610505565b6040516101db91906115a1565b60405180910390f35b6101fe60048036038101906101f991906117b8565b6105b1565b005b61021a60048036038101906102159190611801565b61068c565b60405161022791906115cb565b60405180910390f35b6102386106d5565b005b61024261082b565b60405161024f919061183d565b60405180910390f35b610260610851565b60405161026d919061147c565b60405180910390f35b610290600480360381019061028b9190611546565b6108e3565b60405161029d91906115a1565b60405180910390f35b6102c060048036038101906102bb9190611801565b6109d7565b005b6102dc60048036038101906102d79190611546565b610ab0565b6040516102e991906115a1565b60405180910390f35b61030c60048036038101906103079190611858565b610d17565b60405161031991906115cb565b60405180910390f35b606060078054610331906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461035d906118c7565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610d9e565b8484610da6565b6001905092915050565b6000600654905090565b60006103e9848484610f71565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610434610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab9061196b565b60405180910390fd5b6104d1856104c0610d9e565b85846104cc91906119ba565b610da6565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b60006105a7610512610d9e565b848460056000610520610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105a291906119ee565b610da6565b6001905092915050565b6105b9610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063d90611a90565b60405180910390fd5b60005b81518110156106885761067582828151811061066857610667611ab0565b5b6020026020010151611295565b808061068090611adf565b915050610649565b5050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106dd610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461076a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076190611a90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b060405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610860906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461088c906118c7565b80156108d95780601f106108ae576101008083540402835291602001916108d9565b820191906000526020600020905b8154815290600101906020018083116108bc57829003601f168201915b5050505050905090565b600080600560006108f2610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a690611b9a565b60405180910390fd5b6109cc6109ba610d9e565b8585846109c791906119ba565b610da6565b600191505092915050565b6109df610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6390611a90565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610aba610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610b27575060011515600960009054906101000a900460ff161515145b15610b6257610b3e610b37610d9e565b8484610f71565b6000600960006101000a81548160ff02191690831515021790555060019050610d11565b610b6a610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610bd7575060001515600960009054906101000a900460ff161515145b15610cfa57610bf18260065461138590919063ffffffff16565b600681905550610c4982600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ce991906115cb565b60405180910390a360019050610d11565b610d0c610d05610d9e565b8484610f71565b600190505b92915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0d90611c2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d90611cbe565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906115cb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890611d50565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611051576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104890611de2565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110fe57600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166110fd57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117c90611e74565b60405180910390fd5b818161119191906119ba565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461122391906119ee565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161128791906115cb565b60405180910390a350505050565b61129d610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461132a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132190611a90565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080828461139491906119ee565b9050838110156113d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d090611ee0565b60405180910390fd5b8091505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561141d578082015181840152602081019050611402565b8381111561142c576000848401525b50505050565b6000601f19601f8301169050919050565b600061144e826113e3565b61145881856113ee565b93506114688185602086016113ff565b61147181611432565b840191505092915050565b600060208201905081810360008301526114968184611443565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006114dd826114b2565b9050919050565b6114ed816114d2565b81146114f857600080fd5b50565b60008135905061150a816114e4565b92915050565b6000819050919050565b61152381611510565b811461152e57600080fd5b50565b6000813590506115408161151a565b92915050565b6000806040838503121561155d5761155c6114a8565b5b600061156b858286016114fb565b925050602061157c85828601611531565b9150509250929050565b60008115159050919050565b61159b81611586565b82525050565b60006020820190506115b66000830184611592565b92915050565b6115c581611510565b82525050565b60006020820190506115e060008301846115bc565b92915050565b6000806000606084860312156115ff576115fe6114a8565b5b600061160d868287016114fb565b935050602061161e868287016114fb565b925050604061162f86828701611531565b9150509250925092565b600060ff82169050919050565b61164f81611639565b82525050565b600060208201905061166a6000830184611646565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6116ad82611432565b810181811067ffffffffffffffff821117156116cc576116cb611675565b5b80604052505050565b60006116df61149e565b90506116eb82826116a4565b919050565b600067ffffffffffffffff82111561170b5761170a611675565b5b602082029050602081019050919050565b600080fd5b600061173461172f846116f0565b6116d5565b905080838252602082019050602084028301858111156117575761175661171c565b5b835b81811015611780578061176c88826114fb565b845260208401935050602081019050611759565b5050509392505050565b600082601f83011261179f5761179e611670565b5b81356117af848260208601611721565b91505092915050565b6000602082840312156117ce576117cd6114a8565b5b600082013567ffffffffffffffff8111156117ec576117eb6114ad565b5b6117f88482850161178a565b91505092915050565b600060208284031215611817576118166114a8565b5b6000611825848285016114fb565b91505092915050565b611837816114d2565b82525050565b6000602082019050611852600083018461182e565b92915050565b6000806040838503121561186f5761186e6114a8565b5b600061187d858286016114fb565b925050602061188e858286016114fb565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806118df57607f821691505b602082108114156118f3576118f2611898565b5b50919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b60006119556028836113ee565b9150611960826118f9565b604082019050919050565b6000602082019050818103600083015261198481611948565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006119c582611510565b91506119d083611510565b9250828210156119e3576119e261198b565b5b828203905092915050565b60006119f982611510565b9150611a0483611510565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611a3957611a3861198b565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611a7a6020836113ee565b9150611a8582611a44565b602082019050919050565b60006020820190508181036000830152611aa981611a6d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611aea82611510565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611b1d57611b1c61198b565b5b600182019050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611b846025836113ee565b9150611b8f82611b28565b604082019050919050565b60006020820190508181036000830152611bb381611b77565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c166024836113ee565b9150611c2182611bba565b604082019050919050565b60006020820190508181036000830152611c4581611c09565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611ca86022836113ee565b9150611cb382611c4c565b604082019050919050565b60006020820190508181036000830152611cd781611c9b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611d3a6025836113ee565b9150611d4582611cde565b604082019050919050565b60006020820190508181036000830152611d6981611d2d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611dcc6023836113ee565b9150611dd782611d70565b604082019050919050565b60006020820190508181036000830152611dfb81611dbf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611e5e6026836113ee565b9150611e6982611e02565b604082019050919050565b60006020820190508181036000830152611e8d81611e51565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000611eca601b836113ee565b9150611ed582611e94565b602082019050919050565b60006020820190508181036000830152611ef981611ebd565b905091905056fea2646970667358221220cd1fe009128a3a326bf62d7b27cbe01d758778d8576da375cbf91ccc11be071464736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
2,108
0x70544d3affd8d415d45fc7b7d07a2e9b897fa6c8
pragma solidity ^0.4.24; // File: openzeppelin-solidity/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) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } 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: openzeppelin-solidity/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. */ 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; } } // File: contracts/CHOAM.sol contract CHOAM is Ownable { using SafeMath for uint256; uint256 public constant PLANET_PRICE = 100000000000000000; uint256 public constant FEE_RANGE = 29000000000000000; uint256 public constant FEE_MIN = 5000000000000000; uint256 public constant FEE_SILO = 10000000000000000; uint256 public constant TIMER_STEP = 120; uint256 public constant PAGE_SIZE = 25; address public master; bool public inited = false; uint256 public koef = 1; bool private create_flag = false; uint256 public silo; address public silo_addr = address(0); uint256 public silo_timer = now; struct Player { uint256 balance; uint256 position; uint8 state; uint256 discount; uint256[] planets; } mapping(address => Player) players; struct Planet { uint256 fee; bytes32 data; address owner; } struct Node { Planet planet; uint256 prev; uint256 next; } Node[] public nodes; constructor(address addr) public { master = addr; } function init() public onlyOwner { if(!inited) { create_planet(); create_planet(); create_planet(); create_planet(); create_planet(); create_planet(); create_planet(); create_planet(); create_planet(); create_planet(); create_planet(); create_planet(); } inited = true; } function() public payable { buy_spice_melange(); } function get_owner_planets(uint256 page) external view returns (uint256[] fees, bytes32[] datas, uint256[] ids, uint256[] order) { require(msg.sender != address(0)); fees = new uint256[](PAGE_SIZE); datas = new bytes32[](PAGE_SIZE); ids = new uint256[](PAGE_SIZE); order = new uint256[](PAGE_SIZE); uint256 start = page.mul(PAGE_SIZE); for(uint8 i = 0; i < PAGE_SIZE; i++) { if(i + start < players[msg.sender].planets.length) { uint256 tmp = players[msg.sender].planets[i + start]; fees[i] = nodes[tmp].planet.fee.div(koef); datas[i] = nodes[tmp].planet.data; ids[i] = tmp; order[i] = i + start; } } } function set_master(address adr) public onlyOwner { require(adr != address(0)); require(msg.sender != address(this)); master = adr; } function set_koef(uint256 _koef) public onlyOwner { require(_koef > 0); koef = _koef; } function get_planet_price() public view returns (uint256) { return PLANET_PRICE.div(koef).add(FEE_SILO.div(koef)); } function get_planet_info(uint id) external view returns (uint256 fee, bytes32 data, address owner, uint256 prev, uint256 next) { fee = nodes[id].planet.fee.div(koef); data = nodes[id].planet.data; owner = nodes[id].planet.owner; prev = nodes[id].prev; next = nodes[id].next; } function get_info(uint256 id) public view returns (uint256[] fees, bytes32[] datas, address[] addresses, uint256[] infos) { fees = new uint256[](12); datas = new bytes32[](12); addresses = new address[](14); infos = new uint256[](14); uint8 i; for(i = 0; i < 12; i++) { if(i < nodes.length) { fees[i] = nodes[id].planet.fee.div(koef); datas[i] = nodes[id].planet.data; addresses[i] = nodes[id].planet.owner; infos[i] = id; id = nodes[id].next; } } addresses[i] = silo_addr; infos[i] = silo; i++; if(now < silo_timer) infos[i] = silo_timer - now; } function get_player_state() external view returns (uint256 balance, uint256 position, uint8 state, uint256 discount, uint256 planet_price, uint256 owned_len) { balance = players[msg.sender].balance; position = players[msg.sender].position; state = players[msg.sender].state; discount = players[msg.sender].discount; planet_price = PLANET_PRICE.div(koef); planet_price = planet_price.sub(planet_price.mul(discount).div(100)).add(FEE_SILO.div(koef)); owned_len = players[msg.sender].planets.length; } function create_planet() private { bytes32 hash = keccak256(abi.encodePacked(uint256(blockhash(block.number - 11)) + uint256(msg.sender) + uint256(nodes.length))); uint256 fee = (uint256(hash) % FEE_RANGE).add(FEE_MIN); uint256 id = 0; if(nodes.length > 0) { id = uint256(hash) % nodes.length; } insert(Planet(fee, hash, address(0)), id); } function buy_spice_melange() public payable { require(msg.sender == tx.origin); require(msg.sender != address(0)); require(msg.sender != address(this)); require(msg.value > 0); if(players[msg.sender].state == 0 && nodes.length > 0) { bytes32 hash = keccak256(abi.encodePacked(uint256(blockhash(block.number - 11)) + uint256(msg.sender) + uint256(nodes.length))); players[msg.sender].position = uint256(hash) % nodes.length; players[msg.sender].state = 1; } players[msg.sender].balance = players[msg.sender].balance.add(msg.value); } function sell_spice_melange(uint256 amount) public returns (uint256) { require(msg.sender == tx.origin); require(msg.sender != address(0)); require(msg.sender != address(this)); require(players[msg.sender].state > 0); require(amount <= players[msg.sender].balance); if(amount > 0) { players[msg.sender].balance = players[msg.sender].balance.sub(amount); if(!msg.sender.send(amount)) { return 0; } } return amount; } function move() public { require(msg.sender == tx.origin); require(msg.sender != address(0)); require(msg.sender != address(this)); require(players[msg.sender].balance > 0); require(players[msg.sender].state > 0); uint256 id = players[msg.sender].position; while(true) { id = nodes[id].next; if(nodes[id].planet.owner == address(0)) { players[msg.sender].position = id; break; } else if(nodes[id].planet.owner == msg.sender) { players[msg.sender].position = id; } else { uint256 fee = nodes[id].planet.fee.div(koef); if(fee > players[msg.sender].balance) break; players[msg.sender].balance = players[msg.sender].balance.sub(fee); players[nodes[id].planet.owner].balance = players[nodes[id].planet.owner].balance.add(fee); players[msg.sender].position = id; } } } function step() public { require(msg.sender == tx.origin); require(msg.sender != address(0)); require(msg.sender != address(this)); require(players[msg.sender].balance > 0); require(players[msg.sender].state > 0); uint256 id = players[msg.sender].position; id = nodes[id].next; if(nodes[id].planet.owner == address(0)) { players[msg.sender].position = id; } else if(nodes[id].planet.owner == msg.sender) { players[msg.sender].position = id; } else { uint256 fee = nodes[id].planet.fee.div(koef); if(fee > players[msg.sender].balance) return; players[msg.sender].balance = players[msg.sender].balance.sub(fee); players[nodes[id].planet.owner].balance = players[nodes[id].planet.owner].balance.add(fee); players[msg.sender].position = id; } return; } function buy_planet() public { require(msg.sender == tx.origin); require(msg.sender != address(0)); require(msg.sender != address(this)); require(players[msg.sender].state > 0); uint256 price = PLANET_PRICE.div(koef); price = price.sub(price.mul(players[msg.sender].discount).div(100)).add(FEE_SILO.div(koef)); require(players[msg.sender].balance >= price); uint256 id = players[msg.sender].position; require(nodes[id].planet.owner == address(0)); players[msg.sender].balance = players[msg.sender].balance.sub(price); players[msg.sender].planets.push(id); nodes[id].planet.owner = msg.sender; if(!create_flag) { create_flag = true; } else { create_planet(); create_planet(); create_planet(); create_flag = false; } if(now < silo_timer) { silo_addr = msg.sender; silo_timer = silo_timer.add(TIMER_STEP); silo = silo.add(FEE_SILO); } else { if(silo > 0 && silo_addr != address(0)) players[silo_addr].balance = players[silo_addr].balance.add(silo); silo_addr = msg.sender; silo_timer = now.add(TIMER_STEP); silo = FEE_SILO; } if(players[msg.sender].discount < 50) players[msg.sender].discount = players[msg.sender].discount.add(1); master.transfer(price); } function get_len() external view returns(uint256) { return nodes.length; } function insert(Planet planet, uint256 prev) private returns(uint256) { Node memory node; if(nodes.length == 0) { node = Node(planet, 0, 0); } else { require(prev < nodes.length); node = Node(planet, prev, nodes[prev].next); nodes[node.next].prev = nodes.length; nodes[prev].next = nodes.length; } return nodes.push(node) - 1; } }
0x60806040526004361061017e5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416624ebaa8811461018857806313bd05e4146101af5780631c53c280146101e057806331b286641461021657806337df48281461022b5780633c87b8ef146102405780633ec48a2e1461028a578063412244051461029f57806343c885ba146102b457806359c13403146102dd578063715018a6146102f25780637a3cbbe4146103075780638631890e1461031c57806386795e8d146103315780638da5cb5b146103525780638e3dcc60146103675780639ac58d581461037f578063bab92a2914610394578063bce2d16d146104cf578063bf61b517146104e4578063c36c0155146104f9578063c6cebebd14610544578063e1c7392a1461055c578063e25fe17514610571578063e59af25b1461017e578063eb3beb2914610586578063ee97f7f31461059b578063f2fde38b146105b0578063f81dee03146105d1578063fbde47f6146105e9575b6101866105fe565b005b34801561019457600080fd5b5061019d61074e565b60408051918252519081900360200190f35b3480156101bb57600080fd5b506101c4610754565b60408051600160a060020a039092168252519081900360200190f35b3480156101ec57600080fd5b506101f8600435610763565b60408051938452602084019290925282820152519081900360600190f35b34801561022257600080fd5b5061019d6107c1565b34801561023757600080fd5b506101866107c6565b34801561024c57600080fd5b50610255610b5a565b60408051968752602087019590955260ff909316858501526060850191909152608084015260a0830152519081900360c00190f35b34801561029657600080fd5b50610186610c01565b3480156102ab57600080fd5b5061019d610e79565b3480156102c057600080fd5b506102c9610ebb565b604080519115158252519081900360200190f35b3480156102e957600080fd5b5061019d610edc565b3480156102fe57600080fd5b50610186610ee7565b34801561031357600080fd5b5061019d610f46565b34801561032857600080fd5b5061019d610f4b565b34801561033d57600080fd5b50610186600160a060020a0360043516610f57565b34801561035e57600080fd5b506101c4610fb2565b34801561037357600080fd5b5061019d600435610fc1565b34801561038b57600080fd5b5061019d611090565b3480156103a057600080fd5b506103ac600435611096565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156103f85781810151838201526020016103e0565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561043757818101518382015260200161041f565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561047657818101518382015260200161045e565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156104b557818101518382015260200161049d565b505050509050019850505050505050505060405180910390f35b3480156104db57600080fd5b5061019d61126a565b3480156104f057600080fd5b5061019d611270565b34801561050557600080fd5b5061051160043561127b565b604080519586526020860194909452600160a060020a039092168484015260608401526080830152519081900360a00190f35b34801561055057600080fd5b506103ac60043561133f565b34801561056857600080fd5b5061018661158e565b34801561057d57600080fd5b50610186611660565b34801561059257600080fd5b5061019d61187c565b3480156105a757600080fd5b506101c4611882565b3480156105bc57600080fd5b50610186600160a060020a0360043516611891565b3480156105dd57600080fd5b506101866004356118b4565b3480156105f557600080fd5b5061019d6118dd565b600033321461060c57600080fd5b33151561061857600080fd5b3330141561062557600080fd5b6000341161063257600080fd5b3360009081526007602052604090206002015460ff1615801561065757506008546000105b1561071b5760085460408051600a19430140330190920160208084019190915281518084038201815292820191829052825182918401908083835b602083106106b15780518252601f199092019160209182019101610692565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091206008549094509250839150508115156106ef57fe5b3360009081526007602052604090209190066001808301919091556002909101805460ff191690911790555b3360009081526007602052604090205461073b903463ffffffff6118e816565b3360009081526007602052604090205550565b60065481565b600554600160a060020a031681565b600880548290811061077157fe5b6000918252602091829020604080516060810182526005909302909101805483526001810154938301939093526002830154600160a060020a031690820152600382015460049092015490925083565b601981565b6000803332146107d557600080fd5b3315156107e157600080fd5b333014156107ee57600080fd5b3360009081526007602052604081206002015460ff161161080e57600080fd5b60025461082a9067016345785d8a00009063ffffffff6118fb16565b915061089f61084b600254662386f26fc100006118fb90919063ffffffff16565b33600090815260076020526040902060030154610893906108869060649061087a90889063ffffffff61191016565b9063ffffffff6118fb16565b859063ffffffff61193916565b9063ffffffff6118e816565b336000908152600760205260409020549092508211156108be57600080fd5b503360009081526007602052604081206001015460088054919291839081106108e357fe5b6000918252602090912060026005909202010154600160a060020a03161461090a57600080fd5b3360009081526007602052604090205461092a908363ffffffff61193916565b336000818152600760209081526040822093845560049093018054600181018255908252929020909101829055600880548390811061096557fe5b600091825260209091206005909102016002018054600160a060020a031916600160a060020a039290921691909117905560035460ff1615156109b4576003805460ff191660011790556109d7565b6109bc61194b565b6109c461194b565b6109cc61194b565b6003805460ff191690555b600654421015610a2c5760058054600160a060020a03191633179055600654610a0790607863ffffffff6118e816565b600655600454610a2490662386f26fc1000063ffffffff6118e816565b600455610ac8565b6000600454118015610a485750600554600160a060020a031615155b15610a9657600454600554600160a060020a0316600090815260076020526040902054610a7a9163ffffffff6118e816565b600554600160a060020a03166000908152600760205260409020555b60058054600160a060020a03191633179055610ab942607863ffffffff6118e816565b600655662386f26fc100006004555b3360009081526007602052604090206003015460321115610b1b5733600090815260076020526040902060030154610b0790600163ffffffff6118e816565b336000908152600760205260409020600301555b600154604051600160a060020a039091169083156108fc029084906000818181858888f19350505050158015610b55573d6000803e3d6000fd5b505050565b3360009081526007602052604081208054600182015460028084015460039094015490549294919360ff16929091908190610ba49067016345785d8a00009063ffffffff6118fb16565b9150610bdd610bc5600254662386f26fc100006118fb90919063ffffffff16565b610893610886606461087a878963ffffffff61191016565b33600090815260076020526040902060040154969795969495939490939092509050565b600080333214610c1057600080fd5b331515610c1c57600080fd5b33301415610c2957600080fd5b3360009081526007602052604081205411610c4357600080fd5b3360009081526007602052604081206002015460ff1611610c6357600080fd5b3360009081526007602052604090206001015491505b6008805483908110610c8757fe5b90600052602060002090600502016004015491506000600160a060020a0316600883815481101515610cb557fe5b6000918252602090912060026005909202010154600160a060020a03161415610cf257336000908152600760205260409020600101829055610e75565b6008805433919084908110610d0357fe5b6000918252602090912060026005909202010154600160a060020a03161415610d4057336000908152600760205260409020600101829055610e70565b610d72600254600884815481101515610d5557fe5b60009182526020909120600590910201549063ffffffff6118fb16565b33600090815260076020526040902054909150811115610d9157610e75565b33600090815260076020526040902054610db1908263ffffffff61193916565b33600090815260076020819052604082209290925560088054610e189385939092909187908110610dde57fe5b6000918252602080832060026005909302019190910154600160a060020a031683528201929092526040019020549063ffffffff6118e816565b60076000600885815481101515610e2b57fe5b6000918252602080832060026005909302019190910154600160a060020a03168352828101939093526040918201812093909355338352600790915290206001018290555b610c79565b5050565b6000610eb6610e9a600254662386f26fc100006118fb90919063ffffffff16565b6002546108939067016345785d8a00009063ffffffff6118fb16565b905090565b60015474010000000000000000000000000000000000000000900460ff1681565b6611c37937e0800081565b600054600160a060020a03163314610efe57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a260008054600160a060020a0319169055565b607881565b67016345785d8a000081565b600054600160a060020a03163314610f6e57600080fd5b600160a060020a0381161515610f8357600080fd5b33301415610f9057600080fd5b60018054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a031681565b6000333214610fcf57600080fd5b331515610fdb57600080fd5b33301415610fe857600080fd5b3360009081526007602052604081206002015460ff161161100857600080fd5b3360009081526007602052604090205482111561102457600080fd5b6000821115611088573360009081526007602052604090205461104d908363ffffffff61193916565b33600081815260076020526040808220939093559151909184156108fc02918591818181858888f1935050505015156110885750600061108b565b50805b919050565b60085490565b6060808080600080803315156110ab57600080fd5b604080516019808252610340820190925290602082016103208038833950506040805160198082526103408201909252929950905060208201610320803883395050604080516019808252610340820190925292985090506020820161032080388339505060408051601980825261034082019092529297509050602082016103208038833901905050935061114888601963ffffffff61191016565b9250600091505b60198260ff161015611260573360009081526007602052604090206004015460ff83168401101561125557336000908152600760205260409020600401805460ff8416850190811061119d57fe5b906000526020600020015490506111bf600254600883815481101515610d5557fe5b878360ff168151811015156111d057fe5b6020908102909101015260088054829081106111e857fe5b906000526020600020906005020160000160010154868360ff1681518110151561120e57fe5b6020908102909101015284518190869060ff851690811061122b57fe5b60209081029091010152835160ff831680850191869190811061124a57fe5b602090810290910101525b60019091019061114f565b5050509193509193565b60025481565b662386f26fc1000081565b6000806000806000611298600254600888815481101515610d5557fe5b94506008868154811015156112a957fe5b90600052602060002090600502016000016001015493506008868154811015156112cf57fe5b600091825260209091206002600590920201015460088054600160a060020a03909216945090879081106112ff57fe5b906000526020600020906005020160030154915060088681548110151561132257fe5b906000526020600020906005020160040154905091939590929450565b60408051600c8082526101a082019092526060918291829182916000916020820161018080388339505060408051600c8082526101a0820190925292975090506020820161018080388339505060408051600e8082526101e082019092529296509050602082016101c080388339505060408051600e8082526101e082019092529295509050602082016101c080388339019050509150600090505b600c8160ff1610156115005760085460ff821610156114f857611409600254600888815481101515610d5557fe5b858260ff1681518110151561141a57fe5b60209081029091010152600880548790811061143257fe5b906000526020600020906005020160000160010154848260ff1681518110151561145857fe5b60209081029091010152600880548790811061147057fe5b60009182526020909120600260059092020101548351600160a060020a0390911690849060ff84169081106114a157fe5b600160a060020a0390921660209283029091019091015281518690839060ff84169081106114cb57fe5b6020908102909101015260088054879081106114e357fe5b90600052602060002090600502016004015495505b6001016113db565b6005548351600160a060020a0390911690849060ff841690811061152057fe5b600160a060020a039092166020928302909101909101526004548251839060ff841690811061154b57fe5b60209081029091010152600654600190910190421015611586574260065403828260ff1681518110151561157b57fe5b602090810290910101525b509193509193565b600054600160a060020a031633146115a557600080fd5b60015474010000000000000000000000000000000000000000900460ff161515611629576115d161194b565b6115d961194b565b6115e161194b565b6115e961194b565b6115f161194b565b6115f961194b565b61160161194b565b61160961194b565b61161161194b565b61161961194b565b61162161194b565b61162961194b565b6001805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b60008033321461166f57600080fd5b33151561167b57600080fd5b3330141561168857600080fd5b33600090815260076020526040812054116116a257600080fd5b3360009081526007602052604081206002015460ff16116116c257600080fd5b336000908152600760205260409020600101546008805491935090839081106116e757fe5b90600052602060002090600502016004015491506000600160a060020a031660088381548110151561171557fe5b6000918252602090912060026005909202010154600160a060020a0316141561175257336000908152600760205260409020600101829055610e75565b600880543391908490811061176357fe5b6000918252602090912060026005909202010154600160a060020a031614156117a057336000908152600760205260409020600101829055610e75565b6117b5600254600884815481101515610d5557fe5b336000908152600760205260409020549091508111156117d457610e75565b336000908152600760205260409020546117f4908263ffffffff61193916565b336000908152600760208190526040822092909255600880546118219385939092909187908110610dde57fe5b6007600060088581548110151561183457fe5b6000918252602080832060026005909302019190910154600160a060020a03168352828101939093526040918201812093909355338352600790915290206001018290555050565b60045481565b600154600160a060020a031681565b600054600160a060020a031633146118a857600080fd5b6118b181611a5a565b50565b600054600160a060020a031633146118cb57600080fd5b600081116118d857600080fd5b600255565b66670758aa7c800081565b818101828110156118f557fe5b92915050565b6000818381151561190857fe5b049392505050565b6000821515611921575060006118f5565b5081810281838281151561193157fe5b04146118f557fe5b60008282111561194557fe5b50900390565b600080600060088054905033600160a060020a0316600b430340600190040101604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b602083106119b95780518252601f19909201916020918201910161199a565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209550611a0b92506611c37937e08000915066670758aa7c8000905085069063ffffffff6118e816565b60085490925060009150811015611a2d5760085483811515611a2957fe5b0690505b6040805160608101825283815260208101859052600091810191909152611a549082611aca565b50505050565b600160a060020a0381161515611a6f57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a031916600160a060020a0392909216919091179055565b6000611ad4611ca5565b6008541515611b02576060604051908101604052808581526020016000815260200160008152509050611b9c565b6008548310611b1057600080fd5b606060405190810160405280858152602001848152602001600885815481101515611b3757fe5b6000918252602090912060046005909202010154905260088054604083015192935091828110611b6357fe5b6000918252602090912060036005909202010155600880549084828110611b8657fe5b9060005260206000209060050201600401819055505b60088054600181018255600091909152815180517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee360058402908101919091556020808301517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee48301556040928301517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee583018054600160a060020a031916600160a060020a039092169190911790558401517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee68201559201517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee7909201919091559392505050565b60a060405190810160405280611cb9611ccd565b815260200160008152602001600081525090565b6040805160608101825260008082526020820181905291810191909152905600a165627a7a72305820d3f0eaef5d22fb92659e97048566b4ce4b2a0599c57659b4bcbabe164d65f7db0029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
2,109
0x4c895973334af8e06fd6da4f723ac24a5f259e6b
/** *Submitted for verification at Etherscan.io on 2021-10-04 */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; // Forked from Compound // See https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol contract GovernorAlpha { /// @notice The name of this contract // solhint-disable-next-line const-name-snakecase string public constant name = "Fei Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint) { return 25000000e18; } // 25,000,000 = 2.5% of Tribe /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { return 2500000e18; } // 2,500,000 = .25% of Tribe /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint) { return 3333; } // ~0.5 days in blocks (assuming 13s blocks) /// @notice The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint) { return 10000; } // ~1.5 days in blocks (assuming 13s blocks) /// @notice The address of the Fei Protocol Timelock TimelockInterface public timelock; /// @notice The address of the Fei governance token TribeInterface public tribe; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount; struct Proposal { /// @notice Unique id for looking up a proposal uint id; /// @notice Creator of the proposal address proposer; /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; /// @notice the ordered list of target addresses for calls to be made address[] targets; /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; /// @notice The ordered list of function signatures to be called string[] signatures; /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; /// @notice Current number of votes in favor of this proposal uint forVotes; /// @notice Current number of votes in opposition to this proposal uint againstVotes; /// @notice Flag marking whether the proposal has been canceled bool canceled; /// @notice Flag marking whether the proposal has been executed bool executed; /// @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast bool hasVoted; /// @notice Whether or not the voter supports the proposal bool support; /// @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address tribe_, address guardian_) { timelock = TimelockInterface(timelock_); tribe = TribeInterface(tribe_); guardian = guardian_; } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(tribe.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha: proposer votes below proposal threshold"); require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha: proposal function information arity mismatch"); require(targets.length != 0, "GovernorAlpha: must provide actions"); require(targets.length <= proposalMaxOperations(), "GovernorAlpha: too many actions"); uint latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha: one live proposal per proposer, found an already active proposal"); require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha: one live proposal per proposer, found an already pending proposal"); } uint startBlock = add256(block.number, votingDelay()); uint endBlock = add256(startBlock, votingPeriod()); proposalCount++; Proposal storage newProposal = proposals[proposalCount]; newProposal.id = proposalCount; newProposal.proposer = msg.sender; newProposal.targets = targets; newProposal.values = values; newProposal.signatures = signatures; newProposal.calldatas = calldatas; newProposal.startBlock = startBlock; newProposal.endBlock = endBlock; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description); return newProposal.id; } function queue(uint proposalId) public { require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha: proposal can only be queued if it is succeeded"); Proposal storage proposal = proposals[proposalId]; uint eta = add256(block.timestamp, timelock.delay()); for (uint i = 0; i < proposal.targets.length; i++) { _queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta); } proposal.eta = eta; emit ProposalQueued(proposalId, eta); } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha: proposal action already queued at eta"); timelock.queueTransaction(target, value, signature, data, eta); } function execute(uint proposalId) public payable { require(state(proposalId) == ProposalState.Queued, "GovernorAlpha: proposal can only be executed if it is queued"); Proposal storage proposal = proposals[proposalId]; proposal.executed = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.executeTransaction{value : proposal.values[i]}(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalExecuted(proposalId); } function cancel(uint proposalId) public { ProposalState state = state(proposalId); require(state == ProposalState.Active || state == ProposalState.Pending, "GovernorAlpha: can only cancel Active or Pending Proposal"); Proposal storage proposal = proposals[proposalId]; require(msg.sender == guardian || tribe.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha: proposer above threshold"); proposal.canceled = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalCanceled(proposalId); } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { Proposal storage p = proposals[proposalId]; return (p.targets, p.values, p.signatures, p.calldatas); } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { return proposals[proposalId].receipts[voter]; } function state(uint proposalId) public view returns (ProposalState) { require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha: invalid proposal id"); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { return ProposalState.Canceled; } else if (block.number <= proposal.startBlock) { return ProposalState.Pending; } else if (block.number <= proposal.endBlock) { return ProposalState.Active; } else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) { return ProposalState.Defeated; } else if (proposal.eta == 0) { return ProposalState.Succeeded; } else if (proposal.executed) { return ProposalState.Executed; } else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) { return ProposalState.Expired; } else { return ProposalState.Queued; } } function castVote(uint proposalId, bool support) public { return _castVote(msg.sender, proposalId, support); } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "GovernorAlpha: invalid signature"); return _castVote(signatory, proposalId, support); } function _castVote(address voter, uint proposalId, bool support) internal { require(state(proposalId) == ProposalState.Active, "GovernorAlpha: voting is closed"); Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = proposal.receipts[voter]; require(receipt.hasVoted == false, "GovernorAlpha: voter already voted"); uint96 votes = tribe.getPriorVotes(voter, proposal.startBlock); if (support) { proposal.forVotes = add256(proposal.forVotes, votes); } else { proposal.againstVotes = add256(proposal.againstVotes, votes); } receipt.hasVoted = true; receipt.support = support; receipt.votes = votes; emit VoteCast(voter, proposalId, support, votes); } function __acceptAdmin() public { timelock.acceptAdmin(); } function __abdicate() public { require(msg.sender == guardian, "GovernorAlpha: sender must be gov guardian"); guardian = address(0); } function __transferGuardian(address newGuardian) public { require(msg.sender == guardian, "GovernorAlpha: sender must be gov guardian"); guardian = newGuardian; } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha: sender must be gov guardian"); timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha: sender must be gov guardian"); timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } function add256(uint256 a, uint256 b) internal pure returns (uint) { uint c = a + b; require(c >= a, "addition overflow"); return c; } function sub256(uint256 a, uint256 b) internal pure returns (uint) { require(b <= a, "subtraction underflow"); return a - b; } function getChainId() internal view returns (uint) { uint chainId; // solhint-disable-next-line no-inline-assembly assembly { chainId := chainid() } return chainId; } } interface TimelockInterface { function delay() external view returns (uint); // solhint-disable-next-line func-name-mixedcase function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); } interface TribeInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x6080604052600436106101b75760003560e01c80634634c61f116100ec578063d33219b41161008a578063ddf0b00911610064578063ddf0b009146105ac578063deaaa7cc146105cc578063e23a9a5214610600578063fe0d94c1146106cb57600080fd5b8063d33219b414610556578063da35c66414610576578063da95691a1461058c57600080fd5b806391500671116100c657806391500671146104e3578063b58131b014610503578063b86677fe14610521578063b9a619611461054157600080fd5b80634634c61f1461049a578063760fbc13146104ba5780637bdbe4d0146104cf57600080fd5b806321f43e42116101595780633932abb1116101335780633932abb1146104005780633e4f49e61461041557806340e58ee514610442578063452a93201461046257600080fd5b806321f43e421461039257806324bc1a64146103b2578063328dd982146103d057600080fd5b806315373e3d1161019557806315373e3d146102ef57806317977c61146103115780631afef6e41461033e57806320606b701461035e57600080fd5b8063013cf08b146101bc57806302a251a31461028557806306fdde03146102a4575b600080fd5b3480156101c857600080fd5b506102306101d73660046129b3565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b60408051998a526001600160a01b0390981660208a0152968801959095526060870193909352608086019190915260a085015260c0840152151560e08301521515610100820152610120015b60405180910390f35b34801561029157600080fd5b506127105b60405190815260200161027c565b3480156102b057600080fd5b506102e26040518060400160405280601281526020017146656920476f7665726e6f7220416c70686160701b81525081565b60405161027c9190612d94565b3480156102fb57600080fd5b5061030f61030a3660046129f6565b6106de565b005b34801561031d57600080fd5b5061029661032c3660046127fd565b60056020526000908152604090205481565b34801561034a57600080fd5b5061030f6103593660046127fd565b6106ed565b34801561036a57600080fd5b506102967f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b34801561039e57600080fd5b5061030f6103ad366004612817565b610742565b3480156103be57600080fd5b506a14adf4b7320334b9000000610296565b3480156103dc57600080fd5b506103f06103eb3660046129b3565b61081b565b60405161027c9493929190612d14565b34801561040c57600080fd5b50610d05610296565b34801561042157600080fd5b506104356104303660046129b3565b610aac565b60405161027c9190612d6c565b34801561044e57600080fd5b5061030f61045d3660046129b3565b610c72565b34801561046e57600080fd5b50600254610482906001600160a01b031681565b6040516001600160a01b03909116815260200161027c565b3480156104a657600080fd5b5061030f6104b5366004612a25565b611014565b3480156104c657600080fd5b5061030f61120e565b3480156104db57600080fd5b50600a610296565b3480156104ef57600080fd5b5061030f6104fe366004612817565b61124a565b34801561050f57600080fd5b506a0211654585005212800000610296565b34801561052d57600080fd5b50600154610482906001600160a01b031681565b34801561054d57600080fd5b5061030f61131a565b34801561056257600080fd5b50600054610482906001600160a01b031681565b34801561058257600080fd5b5061029660035481565b34801561059857600080fd5b506102966105a7366004612840565b611375565b3480156105b857600080fd5b5061030f6105c73660046129b3565b6118bc565b3480156105d857600080fd5b506102967f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b34801561060c57600080fd5b5061069c61061b3660046129cb565b60408051606081018252600080825260208201819052918101919091525060009182526004602090815260408084206001600160a01b03939093168452600c9092018152918190208151606081018352905460ff80821615158352610100820416151593820193909352620100009092046001600160601b03169082015290565b60408051825115158152602080840151151590820152918101516001600160601b03169082015260600161027c565b61030f6106d93660046129b3565b611bee565b6106e9338383611e87565b5050565b6002546001600160a01b031633146107205760405162461bcd60e51b815260040161071790612da7565b60405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b0316331461076c5760405162461bcd60e51b815260040161071790612da7565b60008054604080516001600160a01b03868116602083015290921692630825f38f92849201604051602081830303815290604052856040518563ffffffff1660e01b81526004016107c09493929190612c23565b600060405180830381600087803b1580156107da57600080fd5b505af11580156107ee573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108169190810190612940565b505050565b6060806060806000600460008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561089d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161087f575b50505050509350828054806020026020016040519081016040528092919081815260200182805480156108ef57602002820191906000526020600020905b8154815260200190600101908083116108db575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156109c357838290600052602060002001805461093690612f61565b80601f016020809104026020016040519081016040528092919081815260200182805461096290612f61565b80156109af5780601f10610984576101008083540402835291602001916109af565b820191906000526020600020905b81548152906001019060200180831161099257829003601f168201915b505050505081526020019060010190610917565b50505050915080805480602002602001604051908101604052809291908181526020016000905b82821015610a96578382906000526020600020018054610a0990612f61565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3590612f61565b8015610a825780601f10610a5757610100808354040283529160200191610a82565b820191906000526020600020905b815481529060010190602001808311610a6557829003601f168201915b5050505050815260200190600101906109ea565b5050505090509450945094509450509193509193565b60008160035410158015610ac05750600082115b610b175760405162461bcd60e51b815260206004820152602260248201527f476f7665726e6f72416c7068613a20696e76616c69642070726f706f73616c206044820152611a5960f21b6064820152608401610717565b6000828152600460205260409020600b81015460ff1615610b3b5750600292915050565b80600701544311610b4f5750600092915050565b80600801544311610b635750600192915050565b80600a01548160090154111580610b8857506a14adf4b7320334b90000008160090154105b15610b965750600392915050565b6002810154610ba85750600492915050565b600b810154610100900460ff1615610bc35750600792915050565b610c54816002015460008054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610c1757600080fd5b505afa158015610c2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4f9190612928565b6120f6565b4210610c635750600692915050565b50600592915050565b50919050565b6000610c7d82610aac565b90506001816007811115610ca157634e487b7160e01b600052602160045260246000fd5b1480610ccc57506000816007811115610cca57634e487b7160e01b600052602160045260246000fd5b145b610d3e5760405162461bcd60e51b815260206004820152603960248201527f476f7665726e6f72416c7068613a2063616e206f6e6c792063616e63656c204160448201527f6374697665206f722050656e64696e672050726f706f73616c000000000000006064820152608401610717565b60008281526004602052604090206002546001600160a01b0316331480610e1b575060018054828201546a0211654585005212800000926001600160a01b039283169263782d6fe1921690610d94904390612150565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b158015610dd857600080fd5b505afa158015610dec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e109190612a7b565b6001600160601b0316105b610e775760405162461bcd60e51b815260206004820152602760248201527f476f7665726e6f72416c7068613a2070726f706f7365722061626f76652074686044820152661c995cda1bdb1960ca1b6064820152608401610717565b600b8101805460ff1916600117905560005b6003820154811015610fda576000546003830180546001600160a01b039092169163591fcdfe919084908110610ecf57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546004850180546001600160a01b039092169185908110610f0b57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154856005018581548110610f3957634e487b7160e01b600052603260045260246000fd5b90600052602060002001866006018681548110610f6657634e487b7160e01b600052603260045260246000fd5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610f95959493929190612cdb565b600060405180830381600087803b158015610faf57600080fd5b505af1158015610fc3573d6000803e3d6000fd5b505050508080610fd290612f96565b915050610e89565b506040518381527f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c906020015b60405180910390a1505050565b604080518082018252601281527146656920476f7665726e6f7220416c70686160701b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527fadb73dcaa411fb0e00d7f7d4005467d95f53f6100b33e764185f2c7c678de2cf81840152466060820152306080808301919091528351808303909101815260a0820184528051908301207f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee60c083015260e08201899052871515610100808401919091528451808403909101815261012083019094528351939092019290922061190160f01b6101408401526101428301829052610162830181905290916000906101820160408051601f198184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa158015611195573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166111f85760405162461bcd60e51b815260206004820181905260248201527f476f7665726e6f72416c7068613a20696e76616c6964207369676e61747572656044820152606401610717565b611203818a8a611e87565b505050505050505050565b6002546001600160a01b031633146112385760405162461bcd60e51b815260040161071790612da7565b600280546001600160a01b0319169055565b6002546001600160a01b031633146112745760405162461bcd60e51b815260040161071790612da7565b60008054604080516001600160a01b03868116602083015290921692633a66f90192849201604051602081830303815290604052856040518563ffffffff1660e01b81526004016112c89493929190612c23565b602060405180830381600087803b1580156112e257600080fd5b505af11580156112f6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108169190612928565b6000805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561135b57600080fd5b505af115801561136f573d6000803e3d6000fd5b50505050565b60006a0211654585005212800000600180546001600160a01b03169063782d6fe19033906113a4904390612150565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b1580156113e857600080fd5b505afa1580156113fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114209190612a7b565b6001600160601b0316116114955760405162461bcd60e51b815260206004820152603660248201527f476f7665726e6f72416c7068613a2070726f706f73657220766f7465732062656044820152751b1bddc81c1c9bdc1bdcd85b081d1a1c995cda1bdb1960521b6064820152608401610717565b845186511480156114a7575083518651145b80156114b4575082518651145b6115265760405162461bcd60e51b815260206004820152603b60248201527f476f7665726e6f72416c7068613a2070726f706f73616c2066756e6374696f6e60448201527f20696e666f726d6174696f6e206172697479206d69736d6174636800000000006064820152608401610717565b85516115805760405162461bcd60e51b815260206004820152602360248201527f476f7665726e6f72416c7068613a206d7573742070726f7669646520616374696044820152626f6e7360e81b6064820152608401610717565b600a865111156115d25760405162461bcd60e51b815260206004820152601f60248201527f476f7665726e6f72416c7068613a20746f6f206d616e7920616374696f6e73006044820152606401610717565b3360009081526005602052604090205480156117545760006115f382610aac565b9050600181600781111561161757634e487b7160e01b600052602160045260246000fd5b14156116a35760405162461bcd60e51b815260206004820152604f60248201527f476f7665726e6f72416c7068613a206f6e65206c6976652070726f706f73616c60448201527f207065722070726f706f7365722c20666f756e6420616e20616c72656164792060648201526e1858dd1a5d99481c1c9bdc1bdcd85b608a1b608482015260a401610717565b60008160078111156116c557634e487b7160e01b600052602160045260246000fd5b14156117525760405162461bcd60e51b815260206004820152605060248201527f476f7665726e6f72416c7068613a206f6e65206c6976652070726f706f73616c60448201527f207065722070726f706f7365722c20666f756e6420616e20616c72656164792060648201526f1c195b991a5b99c81c1c9bdc1bdcd85b60821b608482015260a401610717565b505b600061176243610d056120f6565b90506000611772826127106120f6565b60038054919250600061178483612f96565b90915550506003805460008181526004602090815260409091209182556001820180546001600160a01b031916331790558b5191926117c992908401918d0190612352565b5088516117df90600483019060208c01906123b7565b5087516117f590600583019060208b01906123f2565b50865161180b90600683019060208a019061244b565b508281600701819055508181600801819055508060000154600560008360010160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000154338c8c8c8c89898e6040516118a699989796959493929190612df1565b60405180910390a1549998505050505050505050565b60046118c782610aac565b60078111156118e657634e487b7160e01b600052602160045260246000fd5b146119595760405162461bcd60e51b815260206004820152603d60248201527f476f7665726e6f72416c7068613a2070726f706f73616c2063616e206f6e6c7960448201527f20626520717565756564206966206974206973207375636365656465640000006064820152608401610717565b600081815260046020818152604080842084548251630d48571f60e31b815292519195946119ae9442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610c1757600080fd5b905060005b6003830154811015611bb057611b9e8360030182815481106119e557634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546004850180546001600160a01b039092169184908110611a2157634e487b7160e01b600052603260045260246000fd5b9060005260206000200154856005018481548110611a4f57634e487b7160e01b600052603260045260246000fd5b906000526020600020018054611a6490612f61565b80601f0160208091040260200160405190810160405280929190818152602001828054611a9090612f61565b8015611add5780601f10611ab257610100808354040283529160200191611add565b820191906000526020600020905b815481529060010190602001808311611ac057829003601f168201915b5050505050866006018581548110611b0557634e487b7160e01b600052603260045260246000fd5b906000526020600020018054611b1a90612f61565b80601f0160208091040260200160405190810160405280929190818152602001828054611b4690612f61565b8015611b935780601f10611b6857610100808354040283529160200191611b93565b820191906000526020600020905b815481529060010190602001808311611b7657829003601f168201915b5050505050866121a4565b80611ba881612f96565b9150506119b3565b506002820181905560408051848152602081018390527f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda28929101611007565b6005611bf982610aac565b6007811115611c1857634e487b7160e01b600052602160045260246000fd5b14611c8b5760405162461bcd60e51b815260206004820152603c60248201527f476f7665726e6f72416c7068613a2070726f706f73616c2063616e206f6e6c7960448201527f20626520657865637574656420696620697420697320717565756564000000006064820152608401610717565b6000818152600460205260408120600b8101805461ff001916610100179055905b6003820154811015611e4f576000546004830180546001600160a01b0390921691630825f38f919084908110611cf257634e487b7160e01b600052603260045260246000fd5b9060005260206000200154846003018481548110611d2057634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546004860180546001600160a01b039092169186908110611d5c57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154866005018681548110611d8a57634e487b7160e01b600052603260045260246000fd5b90600052602060002001876006018781548110611db757634e487b7160e01b600052603260045260246000fd5b9060005260206000200188600201546040518763ffffffff1660e01b8152600401611de6959493929190612cdb565b6000604051808303818588803b158015611dff57600080fd5b505af1158015611e13573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052611e3c9190810190612940565b5080611e4781612f96565b915050611cac565b506040518281527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f9060200160405180910390a15050565b6001611e9283610aac565b6007811115611eb157634e487b7160e01b600052602160045260246000fd5b14611efe5760405162461bcd60e51b815260206004820152601f60248201527f476f7665726e6f72416c7068613a20766f74696e6720697320636c6f736564006044820152606401610717565b60008281526004602090815260408083206001600160a01b0387168452600c8101909252909120805460ff1615611f825760405162461bcd60e51b815260206004820152602260248201527f476f7665726e6f72416c7068613a20766f74657220616c726561647920766f74604482015261195960f21b6064820152608401610717565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611fcc918a916004016001600160a01b03929092168252602082015260400190565b60206040518083038186803b158015611fe457600080fd5b505afa158015611ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201c9190612a7b565b905083156120455761203b8360090154826001600160601b03166120f6565b6009840155612062565b61205c83600a0154826001600160601b03166120f6565b600a8401555b81546001600160601b0382166201000081026dffffffffffffffffffffffff000019871515610100810261ffff199095169490941760011716178455604080516001600160a01b038a168152602081018990529081019290925260608201527f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c469060800160405180910390a1505050505050565b6000806121038385612f06565b9050838110156121495760405162461bcd60e51b81526020600482015260116024820152706164646974696f6e206f766572666c6f7760781b6044820152606401610717565b9392505050565b60008282111561219a5760405162461bcd60e51b81526020600482015260156024820152747375627472616374696f6e20756e646572666c6f7760581b6044820152606401610717565b6121498284612f1e565b6000546040516001600160a01b039091169063f2b06537906121d29088908890889088908890602001612c8f565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b815260040161220691815260200190565b60206040518083038186803b15801561221e57600080fd5b505afa158015612232573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612256919061290c565b156122c05760405162461bcd60e51b815260206004820152603460248201527f476f7665726e6f72416c7068613a2070726f706f73616c20616374696f6e20616044820152736c7265616479207175657565642061742065746160601b6064820152608401610717565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f901906122f89088908890889088908890600401612c8f565b602060405180830381600087803b15801561231257600080fd5b505af1158015612326573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234a9190612928565b505050505050565b8280548282559060005260206000209081019282156123a7579160200282015b828111156123a757825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612372565b506123b39291506124a4565b5090565b8280548282559060005260206000209081019282156123a7579160200282015b828111156123a75782518255916020019190600101906123d7565b82805482825590600052602060002090810192821561243f579160200282015b8281111561243f578251805161242f9184916020909101906124b9565b5091602001919060010190612412565b506123b392915061252c565b828054828255906000526020600020908101928215612498579160200282015b8281111561249857825180516124889184916020909101906124b9565b509160200191906001019061246b565b506123b3929150612549565b5b808211156123b357600081556001016124a5565b8280546124c590612f61565b90600052602060002090601f0160209004810192826124e757600085556123a7565b82601f1061250057805160ff19168380011785556123a7565b828001600101855582156123a757918201828111156123a75782518255916020019190600101906123d7565b808211156123b35760006125408282612566565b5060010161252c565b808211156123b357600061255d8282612566565b50600101612549565b50805461257290612f61565b6000825580601f10612582575050565b601f0160209004906000526020600020908101906125a091906124a4565b50565b60006125b66125b184612ede565b612e89565b90508281528383830111156125ca57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146125f857600080fd5b919050565b600082601f83011261260d578081fd5b8135602061261d6125b183612eba565b80838252828201915082860187848660051b890101111561263c578586fd5b855b858110156126615761264f826125e1565b8452928401929084019060010161263e565b5090979650505050505050565b600082601f83011261267e578081fd5b8135602061268e6125b183612eba565b80838252828201915082860187848660051b89010111156126ad578586fd5b855b8581101561266157813567ffffffffffffffff8111156126cd578788fd5b8801603f81018a136126dd578788fd5b6126ee8a87830135604084016125a3565b85525092840192908401906001016126af565b600082601f830112612711578081fd5b813560206127216125b183612eba565b80838252828201915082860187848660051b8901011115612740578586fd5b855b8581101561266157813567ffffffffffffffff811115612760578788fd5b61276e8a87838c01016127de565b8552509284019290840190600101612742565b600082601f830112612791578081fd5b813560206127a16125b183612eba565b80838252828201915082860187848660051b89010111156127c0578586fd5b855b85811015612661578135845292840192908401906001016127c2565b600082601f8301126127ee578081fd5b612149838335602085016125a3565b60006020828403121561280e578081fd5b612149826125e1565b60008060408385031215612829578081fd5b612832836125e1565b946020939093013593505050565b600080600080600060a08688031215612857578081fd5b853567ffffffffffffffff8082111561286e578283fd5b61287a89838a016125fd565b9650602088013591508082111561288f578283fd5b61289b89838a01612781565b955060408801359150808211156128b0578283fd5b6128bc89838a01612701565b945060608801359150808211156128d1578283fd5b6128dd89838a0161266e565b935060808801359150808211156128f2578283fd5b506128ff888289016127de565b9150509295509295909350565b60006020828403121561291d578081fd5b815161214981612fdd565b600060208284031215612939578081fd5b5051919050565b600060208284031215612951578081fd5b815167ffffffffffffffff811115612967578182fd5b8201601f81018413612977578182fd5b80516129856125b182612ede565b818152856020838501011115612999578384fd5b6129aa826020830160208601612f35565b95945050505050565b6000602082840312156129c4578081fd5b5035919050565b600080604083850312156129dd578182fd5b823591506129ed602084016125e1565b90509250929050565b60008060408385031215612a08578182fd5b823591506020830135612a1a81612fdd565b809150509250929050565b600080600080600060a08688031215612a3c578283fd5b853594506020860135612a4e81612fdd565b9350604086013560ff81168114612a63578384fd5b94979396509394606081013594506080013592915050565b600060208284031215612a8c578081fd5b81516001600160601b0381168114612149578182fd5b6000815180845260208085019450808401835b83811015612ada5781516001600160a01b031687529582019590820190600101612ab5565b509495945050505050565b6000815180845260208085019450848260051b8601828601855b85811015612661578383038952612b17838351612b58565b98850198925090840190600101612aff565b6000815180845260208085019450808401835b83811015612ada57815187529582019590820190600101612b3c565b60008151808452612b70816020860160208601612f35565b601f01601f19169290920160200192915050565b8054600090600181811c9080831680612b9e57607f831692505b6020808410821415612bbe57634e487b7160e01b86526022600452602486fd5b838852818015612bd55760018114612be957612c17565b60ff19861689830152604089019650612c17565b876000528160002060005b86811015612c0f5781548b8201850152908501908301612bf4565b8a0183019750505b50505050505092915050565b60018060a01b038516815283602082015260a06040820152601860a08201527f73657450656e64696e6741646d696e286164647265737329000000000000000060c082015260e060608201526000612c7e60e0830185612b58565b905082608083015295945050505050565b60018060a01b038616815284602082015260a060408201526000612cb660a0830186612b58565b8281036060840152612cc88186612b58565b9150508260808301529695505050505050565b60018060a01b038616815284602082015260a060408201526000612d0260a0830186612b84565b8281036060840152612cc88186612b84565b608081526000612d276080830187612aa2565b8281036020840152612d398187612b29565b90508281036040840152612d4d8186612ae5565b90508281036060840152612d618185612ae5565b979650505050505050565b6020810160088310612d8e57634e487b7160e01b600052602160045260246000fd5b91905290565b6020815260006121496020830184612b58565b6020808252602a908201527f476f7665726e6f72416c7068613a2073656e646572206d75737420626520676f6040820152693b1033bab0b93234b0b760b11b606082015260800190565b8981526001600160a01b038916602082015261012060408201819052600090612e1c8382018b612aa2565b90508281036060840152612e30818a612b29565b90508281036080840152612e448189612ae5565b905082810360a0840152612e588188612ae5565b90508560c08401528460e0840152828103610100840152612e798185612b58565b9c9b505050505050505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715612eb257612eb2612fc7565b604052919050565b600067ffffffffffffffff821115612ed457612ed4612fc7565b5060051b60200190565b600067ffffffffffffffff821115612ef857612ef8612fc7565b50601f01601f191660200190565b60008219821115612f1957612f19612fb1565b500190565b600082821015612f3057612f30612fb1565b500390565b60005b83811015612f50578181015183820152602001612f38565b8381111561136f5750506000910152565b600181811c90821680612f7557607f821691505b60208210811415610c6c57634e487b7160e01b600052602260045260246000fd5b6000600019821415612faa57612faa612fb1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146125a057600080fdfea26469706673582212201be8609b5eb424da98d257ffd740a9d6b638a0f485d66d1bf8002315565364b864736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
2,110
0x0c0ce9c903d2b9a171e6fe41718c037e5b41c2ca
/** *Submitted for verification at Etherscan.io on 2021-07-13 */ // 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 DGALAXY 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"Doge Galaxy"; string private constant _symbol = unicode"dGALAXY"; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 8; 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(2)).div(10); _teamFee = (_impactFee.mul(8)).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 = 2; _teamFee = 8; 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 = 10000000000 * 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600b81526020017f446f67652047616c617879000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f6447414c41585900000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b505050678ac7230489e8000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60026009819055506008600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b602d4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960028461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660088461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122016362fe90cdb5896783e2008bd606fe1fd7c229214c902e2c260cc8f649e9f5e64736f6c63430008040033
{"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"}]}}
2,111
0x0784630d6e82c741bc3712a9dadbd1ba437988b6
/** *Submitted for verification at Etherscan.io on 2021-07-15 */ // File: contracts/ExchangeContract.sol pragma solidity ^0.5.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) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. 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; } } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () public{ address msgSender = msg.sender; _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() == msg.sender, "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 onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract NFTBANK721 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function balanceOf(address owner) public view returns (uint256 balance); function tokenTransfer(address from, address to, uint256 tokenId) public; function _mint(address to, uint256 tokenId, string memory uri) public; function setApprovalForAll(address from, address to, bool approved, uint256 tokenId) public ; function _burn(uint256 tokenId, address from, address admin) public; function _transferOwnership(address newOwner) public; } contract NFTBANK1155{ event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value); event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); event URI(string _value, uint256 indexed _id); function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value) public; function balanceOf(address _owner, uint256 _id) public view returns (uint256); function setApprovalForAll(address from, address _operator, bool _approved) public; function isApprovedForAll(address _owner, address _operator) public view returns (bool); function mint(address from, uint256 _id, uint256 _supply, string memory _uri) public; function burn(address from, address admin, uint256 _id, uint256 _value) public ; function _transferOwnership(address newOwner) public; } contract BEP20 { /** * @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); } contract Sale is Ownable{ event CancelOrder(address indexed from, uint256 indexed tokenId); event ChangePrice(address indexed from, uint256 indexed tokenId, uint256 indexed value); event OrderPlace(address indexed from, uint256 indexed tokenId, uint256 indexed value); event FeeDetails(uint256 indexed owner, uint256 indexed admin, uint256 indexed admin2); event Calcu(uint256 indexed owner, uint256 indexed admin, uint256 indexed admin2); event FeeDiv(uint256 indexed owner, uint256 indexed admin, uint256 indexed admin2); using SafeMath for uint256; struct Order{ uint256 tokenId; uint256 price; } uint256 public serviceValue; mapping (address => mapping (uint256 => Order)) public order_place; mapping (uint256 => mapping (address => bool)) public checkOrder; mapping (uint256 => bool) public _operatorApprovals; mapping (uint256 => address) public _creator; mapping (uint256 => uint256) public _royal; mapping (uint256 => mapping(address => uint256)) public balances; constructor(uint256 _serviceValue) public{ serviceValue = _serviceValue * 2; } function _orderPlace(address from, uint256 tokenId, uint256 _price) internal{ require( balances[tokenId][from] > 0, "Is Not a Owner"); Order memory order; order.tokenId = tokenId; order.price = _price; order_place[from][tokenId] = order; checkOrder[tokenId][from] = true; emit OrderPlace(from, tokenId, _price); } function _cancelOrder(address from, uint256 tokenId) internal{ require(balances[tokenId][msg.sender] > 0, "Is Not a Owner"); delete order_place[msg.sender][tokenId]; checkOrder[tokenId][from] = false; emit CancelOrder(msg.sender, tokenId); } function _changePrice(uint256 value, uint256 tokenId) internal{ require( balances[tokenId][msg.sender] > 0, "Is Not a Owner"); require( value < order_place[msg.sender][tokenId].price); order_place[msg.sender][tokenId].price = value; emit ChangePrice(msg.sender, tokenId, value); } function _acceptBId(address token,address from, address admin, uint256 amount, uint256 tokenId) internal{ require(_operatorApprovals[tokenId], "Token Not approved"); require(balances[tokenId][msg.sender] > 0, "Is Not a Owner"); (uint256 _adminfee, uint256 roy, uint256 netamount) = calc(amount, _royal[tokenId], serviceValue); BEP20 t = BEP20(token); t.transferFrom(from,admin,_adminfee); t.transferFrom(from,_creator[tokenId],roy); t.transferFrom(from,msg.sender,netamount); } function checkTokenApproval(uint256 tokenId, address from) internal view returns (bool result){ require(checkOrder[tokenId][from], "This Token Not for Sale"); require(_operatorApprovals[tokenId], "Token Not approved"); return true; } function _saleToken(address payable from, address payable admin,uint256 tokenId, uint256 amount) internal{ require(amount> order_place[from][tokenId].price , "Insufficent found"); require(checkTokenApproval(tokenId, from)); address payable create = address(uint160(_creator[tokenId])); (uint256 _adminfee, uint256 roy, uint256 netamount) = calc(amount, _royal[tokenId], serviceValue); admin.transfer(_adminfee); create.transfer(roy); from.transfer(netamount); } function calc(uint256 amount, uint256 royal, uint256 _serviceValue) internal pure returns(uint256, uint256, uint256){ uint256 fee = percent(amount, _serviceValue.div(10)); uint256 ser=fee.div(2); uint256 or_am = amount.sub(ser); uint256 roy = percent(or_am, royal); uint256 netamount = or_am.sub(ser.add(roy)); return (fee, roy, netamount); } function percent(uint256 value1, uint256 value2) internal pure returns(uint256){ uint256 result = value1.mul(value2).div(100); return(result); } function setServiceValue(uint256 _serviceValue) internal{ serviceValue = _serviceValue.mul(2); } } contract ExchangeContract is Sale{ uint256 public tokenCount; constructor(uint256 _serviceValue) Sale(_serviceValue) public{ } function serviceFunction(uint256 _serviceValue) public onlyOwner{ setServiceValue(_serviceValue); } function transferOwnershipForColle(address newOwner, address token721, address token1155) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); NFTBANK721 tok= NFTBANK721(token721); NFTBANK1155 tok1155= NFTBANK1155(token1155); tok._transferOwnership(newOwner); tok1155._transferOwnership(newOwner); } function mint(address token ,string memory tokenuri, uint256 value, uint256 tokenId, uint256 royal, uint256 _type, uint256 supply) public{ require(_creator[tokenId] == address(0), "Token Already Minted"); if(_type == 721){ NFTBANK721 tok= NFTBANK721(token); _creator[tokenId]=msg.sender; _royal[tokenId]=royal; tok._mint(msg.sender, tokenId, tokenuri); balances[tokenId][msg.sender] = supply; if(value != 0){ _orderPlace(msg.sender, tokenId, value); } } else{ NFTBANK1155 tok = NFTBANK1155(token); tok.mint(msg.sender, tokenId, supply, tokenuri); _creator[tokenId]=msg.sender; _royal[tokenId]=royal; balances[tokenId][msg.sender] = supply; if(value != 0){ _orderPlace(msg.sender, tokenId, value); } } tokenCount++; } function setApprovalForAll(address token, uint256 _type, address to, bool approved, uint256 tokenId) public { _operatorApprovals[tokenId] = true; if(_type == 721){ NFTBANK721 tok= NFTBANK721(token); tok.setApprovalForAll(msg.sender, to,approved,tokenId); } else{ NFTBANK1155 tok = NFTBANK1155(token); tok.setApprovalForAll(msg.sender, to, approved); } } function saleToken(address payable from, address payable admin,uint256 tokenId, uint256 amount, address token, uint256 _type, uint256 NOFToken) public payable{ _saleToken(from, admin, tokenId, amount); if(_type == 721){ NFTBANK721 tok= NFTBANK721(token); if(checkOrder[tokenId][from]==true){ delete order_place[from][tokenId]; checkOrder[tokenId][from] = false; } tok.tokenTransfer(from, msg.sender, tokenId); balances[tokenId][from] = balances[tokenId][from] - NOFToken; balances[tokenId][msg.sender] = NOFToken; } else{ NFTBANK1155 tok= NFTBANK1155(token); tok.safeTransferFrom(from, msg.sender, tokenId, NOFToken); balances[tokenId][from] = balances[tokenId][from] - NOFToken; balances[tokenId][msg.sender] = balances[tokenId][msg.sender] + NOFToken; if(checkOrder[tokenId][from] == true){ if(balances[tokenId][from] == 0){ delete order_place[from][tokenId]; checkOrder[tokenId][from] = false; } } } } function acceptBId(address bittoken,address from, address admin, uint256 amount, uint256 tokenId, address token, uint256 _type, uint256 NOFToken) public{ _acceptBId(bittoken, from, admin, amount, tokenId); if(_type == 721){ NFTBANK721 tok= NFTBANK721(token); if(checkOrder[tokenId][msg.sender]==true){ delete order_place[msg.sender][tokenId]; checkOrder[tokenId][msg.sender] = false; } tok.tokenTransfer(msg.sender, from, tokenId); balances[tokenId][msg.sender] = balances[tokenId][msg.sender] - NOFToken; balances[tokenId][from] = NOFToken; } else{ NFTBANK1155 tok= NFTBANK1155(token); tok.safeTransferFrom(msg.sender, from, tokenId, NOFToken); balances[tokenId][from] = balances[tokenId][from] + NOFToken; balances[tokenId][msg.sender] = balances[tokenId][msg.sender] - NOFToken; if(checkOrder[tokenId][msg.sender] == true){ if(balances[tokenId][msg.sender] == 0){ delete order_place[msg.sender][tokenId]; checkOrder[tokenId][msg.sender] = false; } } } } function orderPlace(uint256 tokenId, uint256 _price) public{ _orderPlace(msg.sender, tokenId, _price); } function cancelOrder(uint256 tokenId) public{ _cancelOrder(msg.sender, tokenId); } function changePrice(uint256 value, uint256 tokenId) public{ _changePrice(value, tokenId); } function burn(address admin, uint256 tokenId, address token, uint256 _type, uint256 NOFToken ) public{ require( balances[tokenId][msg.sender] >= NOFToken || msg.sender == admin, "Your Not a Token Owner or insuficient Token Balance"); if(_type == 721){ NFTBANK721 tok= NFTBANK721(token); tok._burn(tokenId, msg.sender, admin); balances[tokenId][msg.sender] = balances[tokenId][msg.sender].sub(NOFToken); if(checkOrder[tokenId][msg.sender]==true){ delete order_place[msg.sender][tokenId]; checkOrder[tokenId][msg.sender] = false; } delete _creator[tokenId]; delete _royal[tokenId]; } else{ NFTBANK1155 tok= NFTBANK1155(token); tok.burn(msg.sender, admin, tokenId, NOFToken); balances[tokenId][msg.sender] = balances[tokenId][msg.sender].sub(NOFToken); if(balances[tokenId][msg.sender] == NOFToken){ if(checkOrder[tokenId][msg.sender]==true){ delete order_place[msg.sender][tokenId]; checkOrder[tokenId][msg.sender] = false; } } } tokenCount--; } }
0x60806040526004361061012a5760003560e01c8063715018a6116100ab578063a0e7aae41161006f578063a0e7aae414610457578063b3de019c14610481578063cbe18247146104b1578063e370a06014610500578063f2fde38b14610552578063fb8e04c8146105855761012a565b8063715018a6146103a15780637a4cd42f146103b65780637a546ecb146103e05780638da5cb5b1461042d5780639f181b5e146104425761012a565b806329e02e70116100f257806329e02e701461026c5780632b3abc5d146102b257806347af031f146102ff578063514fcac71461032957806370c0de9f146103535761012a565b806302dc51351461012f5780630cdeb4eb146101615780631f3203311461018857806324bb3286146101c15780632519b1a414610206575b600080fd5b34801561013b57600080fd5b5061015f6004803603604081101561015257600080fd5b508035906020013561065f565b005b34801561016d57600080fd5b5061017661066e565b60408051918252519081900360200190f35b34801561019457600080fd5b50610176600480360360408110156101ab57600080fd5b50803590602001356001600160a01b0316610674565b3480156101cd57600080fd5b5061015f600480360360608110156101e457600080fd5b506001600160a01b038135811691602081013582169160409091013516610691565b34801561021257600080fd5b5061015f600480360361010081101561022a57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359160808201359160a08101359091169060c08101359060e00135610806565b34801561027857600080fd5b506102966004803603602081101561028f57600080fd5b5035610a5a565b604080516001600160a01b039092168252519081900360200190f35b3480156102be57600080fd5b506102eb600480360360408110156102d557600080fd5b50803590602001356001600160a01b0316610a75565b604080519115158252519081900360200190f35b34801561030b57600080fd5b5061015f6004803603602081101561032257600080fd5b5035610a95565b34801561033557600080fd5b5061015f6004803603602081101561034c57600080fd5b5035610af3565b61015f600480360360e081101561036957600080fd5b506001600160a01b03813581169160208101358216916040820135916060810135916080820135169060a08101359060c00135610afd565b3480156103ad57600080fd5b5061015f610d74565b3480156103c257600080fd5b50610176600480360360208110156103d957600080fd5b5035610e10565b3480156103ec57600080fd5b5061015f600480360360a081101561040357600080fd5b506001600160a01b0381358116916020810135916040820135169060608101359060800135610e22565b34801561043957600080fd5b5061029661110e565b34801561044e57600080fd5b5061017661111d565b34801561046357600080fd5b506102eb6004803603602081101561047a57600080fd5b5035611123565b34801561048d57600080fd5b5061015f600480360360408110156104a457600080fd5b5080359060200135611138565b3480156104bd57600080fd5b5061015f600480360360a08110156104d457600080fd5b506001600160a01b03813581169160208101359160408201351690606081013515159060800135611142565b34801561050c57600080fd5b506105396004803603604081101561052357600080fd5b506001600160a01b03813516906020013561125d565b6040805192835260208301919091528051918290030190f35b34801561055e57600080fd5b5061015f6004803603602081101561057557600080fd5b50356001600160a01b0316611281565b34801561059157600080fd5b5061015f600480360360e08110156105a857600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156105d357600080fd5b8201836020820111156105e557600080fd5b8035906020019184600183028401116401000000008311171561060757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505082359350505060208101359060408101359060608101359060800135611373565b61066a33838361168f565b5050565b60015481565b600760209081526000928352604080842090915290825290205481565b3361069a61110e565b6001600160a01b0316146106e3576040805162461bcd60e51b8152602060048201819052602482015260008051602061218b833981519152604482015290519081900360640190fd5b6001600160a01b0383166107285760405162461bcd60e51b81526004018080602001828103825260268152602001806121116026913960400191505060405180910390fd5b6040805163694ea27760e11b81526001600160a01b0385811660048301529151849284929084169163d29d44ee9160248082019260009290919082900301818387803b15801561077757600080fd5b505af115801561078b573d6000803e3d6000fd5b50505050806001600160a01b031663d29d44ee866040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b1580156107e757600080fd5b505af11580156107fb573d6000803e3d6000fd5b505050505050505050565b6108138888888888611781565b816102d11415610929576000848152600360209081526040808320338452909152902054839060ff161515600114156108805733600081815260026020908152604080832089845282528083208381556001018390556003825280832093835292905220805460ff191690555b604080516315eaef6b60e01b81523360048201526001600160a01b038a81166024830152604482018890529151918316916315eaef6b9160648082019260009290919082900301818387803b1580156108d857600080fd5b505af11580156108ec573d6000803e3d6000fd5b5050506000868152600760209081526040808320338452909152808220805486900390556001600160a01b038b168252902083905550610a509050565b60408051630febdd4960e01b81523360048201526001600160a01b038981166024830152604482018790526064820184905291518592831691630febdd4991608480830192600092919082900301818387803b15801561098857600080fd5b505af115801561099c573d6000803e3d6000fd5b50505060008681526007602090815260408083206001600160a01b038d168452825280832080548701905533808452818420805488900390558984526003835281842090845290915290205460ff1615156001141590506107fb5760008581526007602090815260408083203384529091529020546107fb5733600081815260026020908152604080832089845282528083208381556001018390556003825280832093835292905220805460ff19169055505b5050505050505050565b6005602052600090815260409020546001600160a01b031681565b600360209081526000928352604080842090915290825290205460ff1681565b33610a9e61110e565b6001600160a01b031614610ae7576040805162461bcd60e51b8152602060048201819052602482015260008051602061218b833981519152604482015290519081900360640190fd5b610af081611a0c565b50565b610af03382611a23565b610b0987878787611aee565b816102d11415610c315760008581526003602090815260408083206001600160a01b038b168452909152902054839060ff16151560011415610b88576001600160a01b03881660008181526002602090815260408083208a845282528083208381556001018390556003825280832093835292905220805460ff191690555b604080516315eaef6b60e01b81526001600160a01b038a81166004830152336024830152604482018990529151918316916315eaef6b9160648082019260009290919082900301818387803b158015610be057600080fd5b505af1158015610bf4573d6000803e3d6000fd5b50505060008781526007602090815260408083206001600160a01b038d16845290915280822080548690039055338252902083905550610d6b9050565b60408051630febdd4960e01b81526001600160a01b038981166004830152336024830152604482018890526064820184905291518592831691630febdd4991608480830192600092919082900301818387803b158015610c9057600080fd5b505af1158015610ca4573d6000803e3d6000fd5b50505060008781526007602090815260408083206001600160a01b038d16808552908352818420805488900390553384528184208054880190558a84526003835281842090845290915290205460ff161515600114159050610a505760008681526007602090815260408083206001600160a01b038c168452909152902054610a50576001600160a01b03881660008181526002602090815260408083208a845282528083208381556001018390556003825280832093835292905220805460ff19169055505b50505050505050565b33610d7d61110e565b6001600160a01b031614610dc6576040805162461bcd60e51b8152602060048201819052602482015260008051602061218b833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60066020526000908152604090205481565b600084815260076020908152604080832033845290915290205481111580610e525750336001600160a01b038616145b610e8d5760405162461bcd60e51b81526004018080602001828103825260338152602001806121376033913960400191505060405180910390fd5b816102d11415610fd65760408051635032d8af60e01b8152600481018690523360248201526001600160a01b03878116604483015291518592831691635032d8af91606480830192600092919082900301818387803b158015610eef57600080fd5b505af1158015610f03573d6000803e3d6000fd5b5050506000868152600760209081526040808320338452909152902054610f3191508363ffffffff611c5516565b6000868152600760209081526040808320338085529083528184209490945588835260038252808320938352929052205460ff16151560011415610fa95733600081815260026020908152604080832089845282528083208381556001018390556003825280832093835292905220805460ff191690555b50600084815260056020908152604080832080546001600160a01b031916905560069091528120556110fd565b60408051636b81068560e11b81523360048201526001600160a01b03878116602483015260448201879052606482018490529151859283169163d7020d0a91608480830192600092919082900301818387803b15801561103557600080fd5b505af1158015611049573d6000803e3d6000fd5b505050600086815260076020908152604080832033845290915290205461107791508363ffffffff611c5516565b600086815260076020908152604080832033845290915290208190558214156110fb57600085815260036020908152604080832033845290915290205460ff161515600114156110fb5733600081815260026020908152604080832089845282528083208381556001018390556003825280832093835292905220805460ff191690555b505b505060088054600019019055505050565b6000546001600160a01b031690565b60085481565b60046020526000908152604090205460ff1681565b61066a8282611ca0565b6000818152600460205260409020805460ff191660011790556102d18414156111e3576040805163169075ab60e21b81523360048201526001600160a01b03858116602483015284151560448301526064820184905291518792831691635a41d6ac91608480830192600092919082900301818387803b1580156111c557600080fd5b505af11580156111d9573d6000803e3d6000fd5b5050505050611256565b60408051631b3b02e560e11b81523360048201526001600160a01b03858116602483015284151560448301529151879283169163367605ca91606480830192600092919082900301818387803b15801561123c57600080fd5b505af1158015611250573d6000803e3d6000fd5b50505050505b5050505050565b60026020908152600092835260408084209091529082529020805460019091015482565b3361128a61110e565b6001600160a01b0316146112d3576040805162461bcd60e51b8152602060048201819052602482015260008051602061218b833981519152604482015290519081900360640190fd5b6001600160a01b0381166113185760405162461bcd60e51b81526004018080602001828103825260268152602001806121116026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000848152600560205260409020546001600160a01b0316156113d4576040805162461bcd60e51b8152602060048201526014602482015273151bdad95b88105b1c9958591e48135a5b9d195960621b604482015290519081900360640190fd5b816102d11415611548576000879050336005600087815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550836006600087815260200190815260200160002081905550806001600160a01b031663a987d4c633878a6040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156114af578181015183820152602001611497565b50505050905090810190601f1680156114dc5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1580156114fd57600080fd5b505af1158015611511573d6000803e3d6000fd5b505050600086815260076020908152604080832033845290915290208390555085156115425761154233868861168f565b5061167d565b60405163bb7fde7160e01b8152336004820181815260248301879052604483018490526080606484019081528951608485015289518b946001600160a01b0386169463bb7fde719490938b9389938f93929160a490910190602085019080838360005b838110156115c35781810151838201526020016115ab565b50505050905090810190601f1680156115f05780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561161257600080fd5b505af1158015611626573d6000803e3d6000fd5b505050600086815260056020908152604080832080546001600160a01b031916339081179091556006835281842089905560078352818420908452909152902083905550851561167b5761167b33868861168f565b505b50506008805460010190555050505050565b60008281526007602090815260408083206001600160a01b03871684529091529020546116f4576040805162461bcd60e51b815260206004820152600e60248201526d24b9902737ba10309027bbb732b960911b604482015290519081900360640190fd5b6116fc6120f6565b82815260208082018381526001600160a01b0386166000818152600284526040808220888352855280822086518155935160019485015560038552808220838352909452838120805460ff191690931790925591518492869290917f4120d7b2bbebf21931c7a679ebe3cdb0c986d283383f5632d9ca50b242b75f529190a450505050565b60008181526004602052604090205460ff166117d9576040805162461bcd60e51b8152602060048201526012602482015271151bdad95b88139bdd08185c1c1c9bdd995960721b604482015290519081900360640190fd5b6000818152600760209081526040808320338452909152902054611835576040805162461bcd60e51b815260206004820152600e60248201526d24b9902737ba10309027bbb732b960911b604482015290519081900360640190fd5b60008181526006602052604081205460015482918291611856918791611d75565b604080516323b872dd60e01b81526001600160a01b038c811660048301528b811660248301526044820186905291519497509295509093508a92908316916323b872dd9160648083019260209291908290030181600087803b1580156118bb57600080fd5b505af11580156118cf573d6000803e3d6000fd5b505050506040513d60208110156118e557600080fd5b505060008581526005602090815260408083205481516323b872dd60e01b81526001600160a01b038d811660048301529182166024820152604481018890529151908516936323b872dd93606480850194919392918390030190829087803b15801561195057600080fd5b505af1158015611964573d6000803e3d6000fd5b505050506040513d602081101561197a57600080fd5b5050604080516323b872dd60e01b81526001600160a01b038a81166004830152336024830152604482018590529151918316916323b872dd916064808201926020929091908290030181600087803b1580156119d557600080fd5b505af11580156119e9573d6000803e3d6000fd5b505050506040513d60208110156119ff57600080fd5b5050505050505050505050565b611a1d81600263ffffffff611e0116565b60015550565b6000818152600760209081526040808320338452909152902054611a7f576040805162461bcd60e51b815260206004820152600e60248201526d24b9902737ba10309027bbb732b960911b604482015290519081900360640190fd5b3360008181526002602090815260408083208584528252808320838155600101839055600382528083206001600160a01b0387168452909152808220805460ff19169055518392917fc0e68d6b69f741c21e955cad2ae4d505b6f6735c7e7b278251b3f6283a5f07eb91a35050565b6001600160a01b03841660009081526002602090815260408083208584529091529020600101548111611b5c576040805162461bcd60e51b8152602060048201526011602482015270125b9cdd59999a58d95b9d08199bdd5b99607a1b604482015290519081900360640190fd5b611b668285611e5a565b611b6f57600080fd5b60008281526005602090815260408083205460069092528220546001546001600160a01b03909216929182918291611ba8918791611d75565b925092509250866001600160a01b03166108fc849081150290604051600060405180830381858888f19350505050158015611be7573d6000803e3d6000fd5b506040516001600160a01b0385169083156108fc029084906000818181858888f19350505050158015611c1e573d6000803e3d6000fd5b506040516001600160a01b0389169082156108fc029083906000818181858888f193505050501580156107fb573d6000803e3d6000fd5b6000611c9783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f32565b90505b92915050565b6000818152600760209081526040808320338452909152902054611cfc576040805162461bcd60e51b815260206004820152600e60248201526d24b9902737ba10309027bbb732b960911b604482015290519081900360640190fd5b3360009081526002602090815260408083208484529091529020600101548210611d2557600080fd5b336000818152600260209081526040808320858452909152808220600101859055518492849290917fe5de233c6530662ac259214d2d41e53a2947e4f5f7db51d03ba4a81d7ddccbf79190a45050565b6000808080611d9487611d8f87600a63ffffffff611fc916565b61200b565b90506000611da982600263ffffffff611fc916565b90506000611dbd898363ffffffff611c5516565b90506000611dcb828a61200b565b90506000611def611de2858463ffffffff61203716565b849063ffffffff611c5516565b949b919a509398509650505050505050565b600082611e1057506000611c9a565b82820282848281611e1d57fe5b0414611c975760405162461bcd60e51b815260040180806020018281038252602181526020018061216a6021913960400191505060405180910390fd5b60008281526003602090815260408083206001600160a01b038516845290915281205460ff16611ed1576040805162461bcd60e51b815260206004820152601760248201527f5468697320546f6b656e204e6f7420666f722053616c65000000000000000000604482015290519081900360640190fd5b60008381526004602052604090205460ff16611f29576040805162461bcd60e51b8152602060048201526012602482015271151bdad95b88139bdd08185c1c1c9bdd995960721b604482015290519081900360640190fd5b50600192915050565b60008184841115611fc15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611f86578181015183820152602001611f6e565b50505050905090810190601f168015611fb35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000611c9783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612091565b60008061202f6064612023868663ffffffff611e0116565b9063ffffffff611fc916565b949350505050565b600082820183811015611c97576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081836120e05760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611f86578181015183820152602001611f6e565b5060008385816120ec57fe5b0495945050505050565b60405180604001604052806000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373596f7572204e6f74206120546f6b656e204f776e6572206f7220696e737566696369656e7420546f6b656e2042616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a265627a7a72315820af6ef8212c5be0a4a7c06b250eb6f59ee21420923d860f8682248a9cd4ce7a9864736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
2,112
0xdd53bdccaf0571950843fe87b8640660687eb80c
/* https://t.me/lilxinu */ //SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract LilXInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1 *10**12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Lil X Inu"; string private constant _symbol = 'xINU'; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(cooldownEnabled){ require(cooldown[from] < block.timestamp - (360 seconds)); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600981526020017f4c696c205820496e750000000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d9660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123089092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf816123c8565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c3565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f78494e5500000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e81612547565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea0000061283190919063ffffffff16565b6128b790919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e0c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d536022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613de76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613d066023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613dbe6029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224557601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b1561224357601360179054906101000a900460ff1615612220576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221f57600080fd5b5b61222981612547565b6000479050600081111561224157612240476123c8565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122ec5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f657600090505b61230284848484612901565b50505050565b60008383111582906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237a57808201518184015260208101905061235f565b50505050905090810190601f1680156123a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124186002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612443573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124946002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124bf573d6000803e3d6000fd5b5050565b6000600a54821115612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d29602a913960400191505060405180910390fd5b600061252a612b58565b905061253f81846128b790919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561257c57600080fd5b506040519080825280602002602001820160405280156125ab5781602001602082028036833780820191505090505b50905030816000815181106125bc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561265e57600080fd5b505afa158015612672573d6000803e3d6000fd5b505050506040513d602081101561268857600080fd5b8101908080519060200190929190505050816001815181106126a657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061270d30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127d15780820151818401526020810190506127b6565b505050509050019650505050505050600060405180830381600087803b1580156127fa57600080fd5b505af115801561280e573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561284457600090506128b1565b600082840290508284828161285557fe5b04146128ac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d756021913960400191505060405180910390fd5b809150505b92915050565b60006128f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b83565b905092915050565b8061290f5761290e612c49565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129b25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129c7576129c2848484612c8c565b612b44565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a6a5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a7f57612a7a848484612eec565b612b43565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b215750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b3657612b3184848461314c565b612b42565b612b41848484613441565b5b5b5b80612b5257612b5161360c565b5b50505050565b6000806000612b65613620565b91509150612b7c81836128b790919063ffffffff16565b9250505090565b60008083118290612c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612bf4578082015181840152602081019050612bd9565b50505050905090810190601f168015612c215780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c3b57fe5b049050809150509392505050565b6000600c54148015612c5d57506000600d54145b15612c6757612c8a565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c9e876138cd565b955095509550955095509550612cfc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e7281613a07565b612e7c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612efe876138cd565b955095509550955095509550612f5c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ff183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061308685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130d281613a07565b6130dc8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061315e876138cd565b9550955095509550955095506131bc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132e683600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061337b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133c781613a07565b6133d18483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613453876138cd565b9550955095509550955095506134b186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061359281613a07565b61359c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156138825782600260006009848154811061365a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061374157508160036000600984815481106136d957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561375f57600a54683635c9adc5dea00000945094505050506138c9565b6137e8600260006009848154811061377357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461393590919063ffffffff16565b925061387360036000600984815481106137fe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361393590919063ffffffff16565b9150808060010191505061363b565b506138a1683635c9adc5dea00000600a546128b790919063ffffffff16565b8210156138c057600a54683635c9adc5dea000009350935050506138c9565b81819350935050505b9091565b60008060008060008060008060006138ea8a600c54600d54613be6565b92509250925060006138fa612b58565b9050600080600061390d8e878787613c7c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061397783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612308565b905092915050565b6000808284019050838110156139fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a11612b58565b90506000613a28828461283190919063ffffffff16565b9050613a7c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613ba757613b6383600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613bc182600a5461393590919063ffffffff16565b600a81905550613bdc81600b5461397f90919063ffffffff16565b600b819055505050565b600080600080613c126064613c04888a61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c3c6064613c2e888b61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c6582613c57858c61393590919063ffffffff16565b61393590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c95858961283190919063ffffffff16565b90506000613cac868961283190919063ffffffff16565b90506000613cc3878961283190919063ffffffff16565b90506000613cec82613cde858761393590919063ffffffff16565b61393590919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220667c7f360a1d00be98da2ff38876b4ed8339db7d627b08ae2f3fd31f2005835264736f6c634300060c0033
{"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"}]}}
2,113
0x3a08f5cf2c77d003fe07b69e76ff27cbb1520b4f
/* ██╗ ███████╗██╗ ██╗ ██║ ██╔════╝╚██╗██╔╝ ██║ █████╗ ╚███╔╝ ██║ ██╔══╝ ██╔██╗ ███████╗███████╗██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝ ██████╗ ██╗ ██╗██╗██╗ ██████╗ ██╔════╝ ██║ ██║██║██║ ██╔══██╗ ██║ ███╗██║ ██║██║██║ ██║ ██║ ██║ ██║██║ ██║██║██║ ██║ ██║ ╚██████╔╝╚██████╔╝██║███████╗██████╔╝ ╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ██╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗ ██║ ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗ ██║ ██║ ██║██║ █████╔╝ █████╗ ██████╔╝ ██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗ ███████╗╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║ ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ DEAR MSG.SENDER(S): / LXGL is a project in beta. // Please audit & use at your own risk. /// Entry into LXGL shall not create an attorney/client relationship. //// Likewise, LXGL should not be construed as legal advice or replacement for professional counsel. ///// STEAL THIS C0D3SL4W ~presented by LexDAO | Raid Guild LLC */ pragma solidity 0.5.17; interface IERC20 { // brief interface for erc20 token txs function transfer(address to, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); } interface IWETH { // brief interface for canonical ether token wrapper contract function deposit() payable external; function transfer(address dst, uint wad) external returns (bool); } library Address { // helper for address type / openzeppelin-contracts/blob/master/contracts/utils/Address.sol 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; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } } library SafeERC20 { // wrapper around erc20 token txs for non-standard contracts / openzeppelin-contracts/blob/master/contracts/token/ERC20/SafeERC20.sol 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 _callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: erc20 operation did not succeed"); } } } library SafeMath { // wrapper over solidity arithmetic for unit under/overflow checks 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; } } contract Context { // describes current contract execution context (metaTX support) / openzeppelin-contracts/blob/master/contracts/GSN/Context.sol 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 LexGuildLocker is Context { // splittable digital deal lockers w/ embedded arbitration tailored for guild work using SafeERC20 for IERC20; using SafeMath for uint256; /** <$> LXGL <$> **/ address public lexDAO; address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // canonical ether token wrapper contract reference uint256 public lockerCount; uint256 public MAX_DURATION; // time limit on token lockup - default 63113904 (2-year) uint256 public resolutionRate; mapping(uint256 => Locker) public lockers; struct Locker { address client; address[] provider; address resolver; address token; uint8 confirmed; uint8 locked; uint256[] batch; uint256 cap; uint256 released; uint256 termination; bytes32 details; } event RegisterLocker(address indexed client, address[] indexed provider, address indexed resolver, address token, uint256[] batch, uint256 cap, uint256 index, uint256 termination, bytes32 details); event ConfirmLocker(uint256 indexed index, uint256 indexed sum); event Release(uint256 indexed index, uint256[] indexed milestone); event Withdraw(uint256 indexed index, uint256 indexed remainder); event Lock(address indexed sender, uint256 indexed index, bytes32 indexed details); event Resolve(address indexed resolver, uint256 indexed clientAward, uint256[] indexed providerAward, uint256 index, uint256 resolutionFee, bytes32 details); event UpdateLockerSettings(address indexed lexDAO, uint256 indexed MAX_DURATION, uint256 indexed resolutionRate, bytes32 details); constructor (address _lexDAO, uint256 _MAX_DURATION, uint256 _resolutionRate) public { lexDAO = _lexDAO; MAX_DURATION = _MAX_DURATION; resolutionRate = _resolutionRate; } /*************** LOCKER FUNCTIONS ***************/ function registerLocker( // register locker for token deposit & client deal confirmation address client, address[] calldata provider, address resolver, address token, uint256[] calldata batch, uint256 cap, uint256 milestones, uint256 termination, // exact termination date in seconds since epoch bytes32 details) external returns (uint256) { uint256 sum; for (uint256 i = 0; i < provider.length; i++) { sum = sum.add(batch[i]); } require(sum.mul(milestones) == cap, "deposit != milestones"); require(termination <= now.add(MAX_DURATION), "duration maxed"); lockerCount = lockerCount + 1; uint256 index = lockerCount; lockers[index] = Locker( client, provider, resolver, token, 0, 0, batch, cap, 0, termination, details); emit RegisterLocker(client, provider, resolver, token, batch, cap, index, termination, details); return index; } function confirmLocker(uint256 index) payable external { // client confirms deposit of cap & locks in deal Locker storage locker = lockers[index]; require(locker.confirmed == 0, "confirmed"); require(_msgSender() == locker.client, "!client"); uint256 sum = locker.cap; if (locker.token == wETH && msg.value > 0) { require(msg.value == sum, "!ETH"); IWETH(wETH).deposit(); (bool success, ) = wETH.call.value(msg.value)(""); require(success, "!transfer"); IWETH(wETH).transfer(address(this), msg.value); } else { IERC20(locker.token).safeTransferFrom(msg.sender, address(this), sum); } locker.confirmed = 1; emit ConfirmLocker(index, sum); } function release(uint256 index) external { // client transfers locker milestone batch to provider(s) Locker storage locker = lockers[index]; require(_msgSender() == locker.client, "!client"); require(locker.confirmed == 1, "!confirmed"); require(locker.locked == 0, "locked"); require(locker.cap > locker.released, "released"); uint256[] memory milestone = locker.batch; for (uint256 i = 0; i < locker.provider.length; i++) { IERC20(locker.token).safeTransfer(locker.provider[i], milestone[i]); locker.released = locker.released.add(milestone[i]); } emit Release(index, milestone); } function withdraw(uint256 index) external { // withdraw locker remainder to client if termination time passes & no lock Locker storage locker = lockers[index]; require(locker.confirmed == 1, "!confirmed"); require(locker.locked == 0, "locked"); require(locker.cap > locker.released, "released"); require(now > locker.termination, "!terminated"); uint256 remainder = locker.cap.sub(locker.released); IERC20(locker.token).safeTransfer(locker.client, remainder); locker.released = locker.released.add(remainder); emit Withdraw(index, remainder); } /************ ADR FUNCTIONS ************/ function lock(uint256 index, bytes32 details) external { // client or main (0) provider can lock remainder for resolution during locker period / update request details Locker storage locker = lockers[index]; require(locker.confirmed == 1, "!confirmed"); require(locker.cap > locker.released, "released"); require(now < locker.termination, "terminated"); require(_msgSender() == locker.client || _msgSender() == locker.provider[0], "!party"); locker.locked = 1; emit Lock(_msgSender(), index, details); } function resolve(uint256 index, uint256 clientAward, uint256[] calldata providerAward, bytes32 details) external { // resolver splits locked deposit remainder between client & provider(s) Locker storage locker = lockers[index]; uint256 remainder = locker.cap.sub(locker.released); uint256 resolutionFee = remainder.div(resolutionRate); // calculate dispute resolution fee require(locker.locked == 1, "!locked"); require(locker.cap > locker.released, "released"); require(_msgSender() != locker.client, "resolver == client"); require(_msgSender() == locker.resolver, "!resolver"); for (uint256 i = 0; i < locker.provider.length; i++) { require(msg.sender != locker.provider[i], "resolver == provider"); require(clientAward.add(providerAward[i]) == remainder.sub(resolutionFee), "resolution != remainder"); IERC20(locker.token).safeTransfer(locker.provider[i], providerAward[i]); } IERC20(locker.token).safeTransfer(locker.client, clientAward); IERC20(locker.token).safeTransfer(locker.resolver, resolutionFee); locker.released = locker.released.add(remainder); emit Resolve(_msgSender(), clientAward, providerAward, index, resolutionFee, details); } /************** LEXDAO FUNCTION **************/ function updateLockerSettings(address _lexDAO, uint256 _MAX_DURATION, uint256 _resolutionRate, bytes32 details) external { require(_msgSender() == lexDAO, "!lexDAO"); lexDAO = _lexDAO; MAX_DURATION = _MAX_DURATION; resolutionRate = _resolutionRate; emit UpdateLockerSettings(lexDAO, MAX_DURATION, resolutionRate, details); } }
0x6080604052600436106100c25760003560e01c80636a3cb3001161007f5780639b4b467c116100595780639b4b467c14610398578063b1724b4614610421578063ccd96eb614610436578063f24286211461044b576100c2565b80636a3cb300146102e0578063809aab92146102fd578063946f2e4814610383576100c2565b806322b7def5146100c75780632e1a7d4d146101e457806337bdc99b146102105780633e217e4f1461023a578063496a36f21461027f5780634f411f7b146102af575b600080fd5b3480156100d357600080fd5b506101d260048036036101208110156100eb57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561011657600080fd5b82018360208201111561012857600080fd5b8035906020019184602083028401116401000000008311171561014a57600080fd5b919390926001600160a01b038335811693602081013590911692919060608101906040013564010000000081111561018157600080fd5b82018360208201111561019357600080fd5b803590602001918460208302840111640100000000831117156101b557600080fd5b919350915080359060208101359060408101359060600135610460565b60408051918252519081900360200190f35b3480156101f057600080fd5b5061020e6004803603602081101561020757600080fd5b5035610819565b005b34801561021c57600080fd5b5061020e6004803603602081101561023357600080fd5b50356109de565b34801561024657600080fd5b5061020e6004803603608081101561025d57600080fd5b506001600160a01b038135169060208101359060408101359060600135610c96565b34801561028b57600080fd5b5061020e600480360360408110156102a257600080fd5b5080359060200135610d5c565b3480156102bb57600080fd5b506102c4610f34565b604080516001600160a01b039092168252519081900360200190f35b61020e600480360360208110156102f657600080fd5b5035610f43565b34801561030957600080fd5b506103276004803603602081101561032057600080fd5b503561124a565b604080516001600160a01b039a8b168152988a1660208a0152969098168787015260ff948516606088015292909316608086015260a085015260c084019190915260e08301526101008201929092529051908190036101200190f35b34801561038f57600080fd5b506101d26112a9565b3480156103a457600080fd5b5061020e600480360360808110156103bb57600080fd5b8135916020810135918101906060810160408201356401000000008111156103e257600080fd5b8201836020820111156103f457600080fd5b8035906020019184602083028401116401000000008311171561041657600080fd5b9193509150356112af565b34801561042d57600080fd5b506101d261169a565b34801561044257600080fd5b506101d26116a0565b34801561045757600080fd5b506102c46116a6565b600080805b8b81101561049c5761049289898381811061047c57fe5b90506020020135836116b590919063ffffffff16565b9150600101610465565b50856104ae828763ffffffff6116d016565b146104f8576040805162461bcd60e51b81526020600482015260156024820152746465706f73697420213d206d696c6573746f6e657360581b604482015290519081900360640190fd5b60035461050c90429063ffffffff6116b516565b841115610551576040805162461bcd60e51b815260206004820152600e60248201526d191d5c985d1a5bdb881b585e195960921b604482015290519081900360640190fd5b600254600101600281905550600060025490506040518061016001604052808f6001600160a01b031681526020018e8e8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509385525050506001600160a01b03808f16602080850191909152908e1660408085019190915260608401839052608084019290925281518c820281810183019093528c815260a090930192918d918d918291850190849080828437600092018290525093855250505060208083018b90526040808401839052606084018a9052608090930188905284825260058152919020825181546001600160a01b0319166001600160a01b039091161781558282015180519192610676926001850192909101906119de565b5060408201516002820180546001600160a01b03199081166001600160a01b03938416179091556060840151600384018054608087015160a088015191909416929094169190911760ff60a01b1916600160a01b60ff938416021760ff60a81b1916600160a81b929093169190910291909117905560c08201518051610706916004840191602090910190611a43565b5060e082015181600501556101008201518160060155610120820151816007015561014082015181600801559050508a6001600160a01b03168d8d60405180838360200280828437808301925050509250505060405180910390208f6001600160a01b03167fd412ebdd543e0f37e93f02e191bdbb7e705adb4ccd60eecad8f843ac302d97718d8d8d8d888d8d60405180886001600160a01b03166001600160a01b03168152602001806020018681526020018581526020018481526020018381526020018281038252888882818152602001925060200280828437600083820152604051601f909101601f19169092018290039a509098505050505050505050a49d9c50505050505050505050505050565b60008181526005602052604090206003810154600160a01b900460ff16600114610877576040805162461bcd60e51b815260206004820152600a6024820152690858dbdb999a5c9b595960b21b604482015290519081900360640190fd5b6003810154600160a81b900460ff16156108c1576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b8060060154816005015411610908576040805162461bcd60e51b81526020600482015260086024820152671c995b19585cd95960c21b604482015290519081900360640190fd5b8060070154421161094e576040805162461bcd60e51b815260206004820152600b60248201526a085d195c9b5a5b985d195960aa1b604482015290519081900360640190fd5b600061096b826006015483600501546116f790919063ffffffff16565b82546003840154919250610992916001600160a01b0390811691168363ffffffff61170c16565b60068201546109a7908263ffffffff6116b516565b6006830155604051819084907f56ca301a9219608c91e7bcee90e083c19671d2cdcc96752c7af291cee5f9c8c890600090a3505050565b600081815260056020526040902080546001600160a01b03166109ff611763565b6001600160a01b031614610a44576040805162461bcd60e51b81526020600482015260076024820152660858db1a595b9d60ca1b604482015290519081900360640190fd5b6003810154600160a01b900460ff16600114610a94576040805162461bcd60e51b815260206004820152600a6024820152690858dbdb999a5c9b595960b21b604482015290519081900360640190fd5b6003810154600160a81b900460ff1615610ade576040805162461bcd60e51b81526020600482015260066024820152651b1bd8dad95960d21b604482015290519081900360640190fd5b8060060154816005015411610b25576040805162461bcd60e51b81526020600482015260086024820152671c995b19585cd95960c21b604482015290519081900360640190fd5b606081600401805480602002602001604051908101604052809291908181526020018280548015610b7557602002820191906000526020600020905b815481526020019060010190808311610b61575b50939450600093505050505b6001830154811015610c2657610bef836001018281548110610b9f57fe5b9060005260206000200160009054906101000a90046001600160a01b0316838381518110610bc957fe5b602090810291909101015160038601546001600160a01b0316919063ffffffff61170c16565b610c19828281518110610bfe57fe5b602002602001015184600601546116b590919063ffffffff16565b6006840155600101610b81565b508060405180828051906020019060200280838360005b83811015610c55578181015183820152602001610c3d565b505060405192909401829003822095508894507f0ba7c0e20bf8f7c009fe9534493957cb96873beb4160f665416d5ad709fb7c7893506000925050a3505050565b6000546001600160a01b0316610caa611763565b6001600160a01b031614610cef576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038087166001600160a01b03199092169190911791829055600385905560048490556040805184815290518593879316917f8574f47cd645c1f4bc413288476426bb8deca94e1f5e5014f65d8cd0b13498de919081900360200190a450505050565b60008281526005602052604090206003810154600160a01b900460ff16600114610dba576040805162461bcd60e51b815260206004820152600a6024820152690858dbdb999a5c9b595960b21b604482015290519081900360640190fd5b8060060154816005015411610e01576040805162461bcd60e51b81526020600482015260086024820152671c995b19585cd95960c21b604482015290519081900360640190fd5b80600701544210610e46576040805162461bcd60e51b815260206004820152600a6024820152691d195c9b5a5b985d195960b21b604482015290519081900360640190fd5b80546001600160a01b0316610e59611763565b6001600160a01b03161480610ea1575080600101600081548110610e7957fe5b6000918252602090912001546001600160a01b0316610e96611763565b6001600160a01b0316145b610edb576040805162461bcd60e51b815260206004820152600660248201526521706172747960d01b604482015290519081900360640190fd5b60038101805460ff60a81b1916600160a81b1790558183610efa611763565b6001600160a01b03167fceea5b421e1b4e7ed15f76569a4c1608f411702926a7d2ffff370e07913df3b660405160405180910390a4505050565b6000546001600160a01b031681565b60008181526005602052604090206003810154600160a01b900460ff1615610f9e576040805162461bcd60e51b815260206004820152600960248201526818dbdb999a5c9b595960ba1b604482015290519081900360640190fd5b80546001600160a01b0316610fb1611763565b6001600160a01b031614610ff6576040805162461bcd60e51b81526020600482015260076024820152660858db1a595b9d60ca1b604482015290519081900360640190fd5b600581015460015460038301546001600160a01b03908116911614801561101d5750600034115b156111e35780341461105f576040805162461bcd60e51b815260206004808301919091526024820152630428aa8960e31b604482015290519081900360640190fd5b600160009054906101000a90046001600160a01b03166001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110af57600080fd5b505af11580156110c3573d6000803e3d6000fd5b5050600154604051600093506001600160a01b03909116915034908381818185875af1925050503d8060008114611116576040519150601f19603f3d011682016040523d82523d6000602084013e61111b565b606091505b505090508061115d576040805162461bcd60e51b815260206004820152600960248201526810ba3930b739b332b960b91b604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b815230600482015234602482015290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b1580156111b057600080fd5b505af11580156111c4573d6000803e3d6000fd5b505050506040513d60208110156111da57600080fd5b50611203915050565b6003820154611203906001600160a01b031633308463ffffffff61176816565b60038201805460ff60a01b1916600160a01b179055604051819084907fb6cf08bb3146c82027154a632407080a44f93762cb5145689045e1efbc6df0b490600090a3505050565b600560208190526000918252604090912080546002820154600383015493830154600684015460078501546008909501546001600160a01b0394851696938516959484169460ff600160a01b8604811695600160a81b90041693929189565b60045481565b600085815260056020819052604082206006810154918101549092916112db919063ffffffff6116f716565b905060006112f4600454836117c890919063ffffffff16565b6003840154909150600160a81b900460ff16600114611344576040805162461bcd60e51b8152602060048201526007602482015266085b1bd8dad95960ca1b604482015290519081900360640190fd5b826006015483600501541161138b576040805162461bcd60e51b81526020600482015260086024820152671c995b19585cd95960c21b604482015290519081900360640190fd5b82546001600160a01b031661139e611763565b6001600160a01b031614156113ef576040805162461bcd60e51b81526020600482015260126024820152711c995cdbdb1d995c880f4f4818db1a595b9d60721b604482015290519081900360640190fd5b60028301546001600160a01b0316611405611763565b6001600160a01b03161461144c576040805162461bcd60e51b815260206004820152600960248201526810b932b9b7b63b32b960b91b604482015290519081900360640190fd5b60005b60018401548110156115b05783600101818154811061146a57fe5b6000918252602090912001546001600160a01b03163314156114ca576040805162461bcd60e51b81526020600482015260146024820152733932b9b7b63b32b9101e9e90383937bb34b232b960611b604482015290519081900360640190fd5b6114da838363ffffffff6116f716565b6114ff8888848181106114e957fe5b905060200201358a6116b590919063ffffffff16565b14611551576040805162461bcd60e51b815260206004820152601760248201527f7265736f6c7574696f6e20213d2072656d61696e646572000000000000000000604482015290519081900360640190fd5b6115a884600101828154811061156357fe5b6000918252602090912001546001600160a01b031688888481811061158457fe5b60038901546001600160a01b0316939260209091020135905063ffffffff61170c16565b60010161144f565b50825460038401546115d5916001600160a01b0391821691168963ffffffff61170c16565b600283015460038401546115fc916001600160a01b0391821691168363ffffffff61170c16565b6006830154611611908363ffffffff6116b516565b600684015560405186908690808360208402808284378083019250505092505050604051809103902087611643611763565b604080518c81526020810186905280820189905290516001600160a01b0392909216917ffc0f02d45b4cba1a3382a4f77fc20f43844e3d0367deecc60c2365b235ef16d39181900360600190a45050505050505050565b60035481565b60025481565b6001546001600160a01b031681565b6000828201838110156116c757600080fd5b90505b92915050565b6000826116df575060006116ca565b828202828482816116ec57fe5b04146116c757600080fd5b60008282111561170657600080fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261175e9084906117ea565b505050565b335b90565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526117c29085906117ea565b50505050565b60008082116117d657600080fd5b60008284816117e157fe5b04949350505050565b6117fc826001600160a01b03166119a2565b61184d576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061188b5780518252601f19909201916020918201910161186c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146118ed576040519150601f19603f3d011682016040523d82523d6000602084013e6118f2565b606091505b509150915081611949576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156117c25780806020019051602081101561196557600080fd5b50516117c25760405162461bcd60e51b815260040180806020018281038252602a815260200180611ac9602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906119d657508115155b949350505050565b828054828255906000526020600020908101928215611a33579160200282015b82811115611a3357825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906119fe565b50611a3f929150611a8a565b5090565b828054828255906000526020600020908101928215611a7e579160200282015b82811115611a7e578251825591602001919060010190611a63565b50611a3f929150611aae565b61176591905b80821115611a3f5780546001600160a01b0319168155600101611a90565b61176591905b80821115611a3f5760008155600101611ab456fe5361666545524332303a206572633230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820282b29ff97b1a91d4ad09e6cd403e0dc1c32341c565a1ad9c4c0152018f9a77964736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,114
0x854bf1aaeb7ceb1f84468477ec6052d697b3e492
pragma solidity >=0.4.22 <0.7.0; 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 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"); 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); } } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } 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 ERC20 is Context, IERC20 { 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; constructor (string memory name, string memory symbol) public { _name = name; _symbol = symbol; _decimals = 18; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } contract Swapex is ERC20{ address private owner; string public proof; modifier isOwner() { require(msg.sender == owner, "Caller is not owner"); _; } constructor(uint256 initialSupply) ERC20("Swapex Finance | swapex.finance", "SWPX") public { owner = msg.sender; _mint(msg.sender, initialSupply); } function changeOwner(address newOwner) public isOwner { owner = newOwner; } function updateProof(string memory hash) public isOwner{ proof = hash; } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638bf8195c1161008c578063a6f9dae111610066578063a6f9dae114610502578063a9059cbb14610546578063dd62ed3e146105ac578063faf924cf14610624576100ea565b80638bf8195c1461035e57806395d89b4114610419578063a457c2d71461049c576100ea565b806323b872dd116100c857806323b872dd146101f6578063313ce5671461027c57806339509351146102a057806370a0823114610306576100ea565b806306fdde03146100ef578063095ea7b31461017257806318160ddd146101d8575b600080fd5b6100f76106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101e0610767565b6040518082815260200191505060405180910390f35b6102626004803603606081101561020c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61028461084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102ec600480360360408110156102b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b6103486004803603602081101561031c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b6040518082815260200191505060405180910390f35b6104176004803603602081101561037457600080fd5b810190808035906020019064010000000081111561039157600080fd5b8201836020820111156103a357600080fd5b803590602001918460018302840111640100000000831117156103c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061095c565b005b610421610a39565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610461578082015181840152602081019050610446565b50505050905090810190601f16801561048e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104e8600480360360408110156104b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610adb565b604051808215151515815260200191505060405180910390f35b6105446004803603602081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba8565b005b6105926004803603604081101561055c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610caf565b604051808215151515815260200191505060405180910390f35b61060e600480360360408110156105c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ccd565b6040518082815260200191505060405180910390f35b61062c610d54565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066c578082015181840152602081019050610651565b50505050905090810190601f1680156106995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610df2565b8484610dfa565b6001905092915050565b6000600254905090565b600061077e848484610ff1565b61083f8461078a610df2565b61083a8560405180606001604052806028815260200161151060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610df2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b29092919063ffffffff16565b610dfa565b600190509392505050565b6000600560009054906101000a900460ff16905090565b600061090a61086e610df2565b84610905856001600061087f610df2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137290919063ffffffff16565b610dfa565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a1f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616c6c6572206973206e6f74206f776e65720000000000000000000000000081525060200191505060405180910390fd5b8060069080519060200190610a359291906113ff565b5050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ad15780601f10610aa657610100808354040283529160200191610ad1565b820191906000526020600020905b815481529060010190602001808311610ab457829003601f168201915b5050505050905090565b6000610b9e610ae8610df2565b84610b99856040518060600160405280602581526020016115816025913960016000610b12610df2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b29092919063ffffffff16565b610dfa565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616c6c6572206973206e6f74206f776e65720000000000000000000000000081525060200191505060405180910390fd5b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610cc3610cbc610df2565b8484610ff1565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dea5780601f10610dbf57610100808354040283529160200191610dea565b820191906000526020600020905b815481529060010190602001808311610dcd57829003601f168201915b505050505081565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061155d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806114c86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611077576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806115386025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114a56023913960400191505060405180910390fd5b6111088383836113fa565b611173816040518060600160405280602681526020016114ea602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b29092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611206816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600083831115829061135f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611324578082015181840152602081019050611309565b50505050905090810190601f1680156113515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061144057805160ff191683800117855561146e565b8280016001018555821561146e579182015b8281111561146d578251825591602001919060010190611452565b5b50905061147b919061147f565b5090565b6114a191905b8082111561149d576000816000905550600101611485565b5090565b9056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209d7a144342ea197b23dc71e4ebeade5d199a769670744847b99bbde22d78b25964736f6c63430006060033
{"success": true, "error": null, "results": {}}
2,115
0x271901c3268D0959bbc9543DE4f073D3708C88F7
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; pragma experimental ABIEncoderV2; contract GovernorAlpha { /// @notice The name of this contract string public constant name = "Cryptex Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public pure returns (uint256) { return 400_000e18; } // 4% of Ctx /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint256) { return 100_000e18; } // 1% of Ctx /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint256) { return 10; } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint256) { return 1; } // 1 block /// @notice The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint256) { return 17_280; } // ~3 days in blocks (assuming 15s blocks) /// @notice The address of the Ctx Protocol Timelock TimelockInterface public timelock; /// @notice The address of the Ctx governance token CtxInterface public ctx; /// @notice The total number of proposals uint256 public proposalCount; /// @param id Unique id for looking up a proposal /// @param proposer Creator of the proposal /// @param eta The timestamp that the proposal will be available for execution, set once the vote succeeds /// @param targets the ordered list of target addresses for calls to be made /// @param values The ordered list of values (i.e. msg.value) to be passed to the calls to be made /// @param signatures The ordered list of function signatures to be called /// @param calldatas The ordered list of calldata to be passed to each call /// @param startBlock The block at which voting begins: holders must delegate their votes prior to this block /// @param endBlock The block at which voting ends: votes must be cast prior to this block /// @param forVotes Current number of votes in favor of this proposal /// @param againstVotes Current number of votes in opposition to this proposal /// @param canceled Flag marking whether the proposal has been canceled /// @param executed Flag marking whether the proposal has been executed struct Proposal { uint256 id; address proposer; uint256 eta; address[] targets; uint256[] values; string[] signatures; bytes[] calldatas; uint256 startBlock; uint256 endBlock; uint256 forVotes; uint256 againstVotes; bool canceled; bool executed; } /// @notice Receipts of ballots for the entire set of voters mapping(uint256 => mapping(address => Receipt)) public receipts; /// @notice Ballot receipt record for a voter /// @param hasVoted or not a vote has been cast /// @param support or not the voter supports the proposal /// @param votes number of votes the voter had, which were cast struct Receipt { bool hasVoted; bool support; uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping(uint256 => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping(address => uint256) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated( uint256 id, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 startBlock, uint256 endBlock, string description ); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast( address voter, uint256 proposalId, bool support, uint256 votes ); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint256 id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint256 id, uint256 eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint256 id); constructor(address timelock_, address ctx_) { timelock = TimelockInterface(timelock_); ctx = CtxInterface(ctx_); } function propose( address[] memory targets, uint256[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description ) public returns (uint256) { require( ctx.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold" ); require( targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch" ); require( targets.length != 0, "GovernorAlpha::propose: must provide actions" ); require( targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions" ); uint256 latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require( proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal" ); require( proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal" ); } uint256 startBlock = add256(block.number, votingDelay()); uint256 endBlock = add256(startBlock, votingPeriod()); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endBlock: endBlock, forVotes: 0, againstVotes: 0, canceled: false, executed: false }); proposals[newProposal.id] = newProposal; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated( newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description ); return newProposal.id; } function queue(uint256 proposalId) public { require( state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded" ); Proposal storage proposal = proposals[proposalId]; uint256 eta = add256(block.timestamp, timelock.delay()); for (uint256 i = 0; i < proposal.targets.length; i++) { _queueOrRevert( proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta ); } proposal.eta = eta; emit ProposalQueued(proposalId, eta); } function _queueOrRevert( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) internal { require( !timelock.queuedTransactions( keccak256(abi.encode(target, value, signature, data, eta)) ), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta" ); timelock.queueTransaction(target, value, signature, data, eta); } function execute(uint256 proposalId) public payable { require( state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued" ); Proposal storage proposal = proposals[proposalId]; proposal.executed = true; for (uint256 i = 0; i < proposal.targets.length; i++) { timelock.executeTransaction{value: proposal.values[i]}( proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta ); } emit ProposalExecuted(proposalId); } function cancel(uint256 proposalId) public { ProposalState currentState = state(proposalId); require( currentState != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal" ); Proposal storage proposal = proposals[proposalId]; require( ctx.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold" ); proposal.canceled = true; for (uint256 i = 0; i < proposal.targets.length; i++) { timelock.cancelTransaction( proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta ); } emit ProposalCanceled(proposalId); } function getActions(uint256 proposalId) public view returns ( address[] memory targets, uint256[] memory values, string[] memory signatures, bytes[] memory calldatas ) { Proposal storage p = proposals[proposalId]; return (p.targets, p.values, p.signatures, p.calldatas); } function getReceipt(uint256 proposalId, address voter) public view returns (Receipt memory) { require( proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::getReceipt: invalid proposal id" ); return receipts[proposalId][voter]; } function state(uint256 proposalId) public view returns (ProposalState) { require( proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id" ); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { return ProposalState.Canceled; } else if (block.number <= proposal.startBlock) { return ProposalState.Pending; } else if (block.number <= proposal.endBlock) { return ProposalState.Active; } else if ( proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes() ) { return ProposalState.Defeated; } else if (proposal.eta == 0) { return ProposalState.Succeeded; } else if (proposal.executed) { return ProposalState.Executed; } else if ( block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD()) ) { return ProposalState.Expired; } else { return ProposalState.Queued; } } function castVote(uint256 proposalId, bool support) public { return _castVote(msg.sender, proposalId, support); } function castVoteBySig( uint256 proposalId, bool support, uint8 v, bytes32 r, bytes32 s ) public { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this) ) ); bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require( signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature" ); return _castVote(signatory, proposalId, support); } function _castVote( address voter, uint256 proposalId, bool support ) internal { require( state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed" ); Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = receipts[proposalId][voter]; require( receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted" ); uint96 votes = ctx.getPriorVotes(voter, proposal.startBlock); if (support) { proposal.forVotes = add256(proposal.forVotes, votes); } else { proposal.againstVotes = add256(proposal.againstVotes, votes); } receipt.hasVoted = true; receipt.support = support; receipt.votes = votes; emit VoteCast(voter, proposalId, support, votes); } function add256(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "addition overflow"); return c; } function sub256(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "subtraction underflow"); return a - b; } function getChainId() internal pure returns (uint256) { uint256 chainId; assembly { chainId := chainid() } return chainId; } } interface TimelockInterface { function delay() external view returns (uint256); function GRACE_PERIOD() external view returns (uint256); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction( address target, uint256 value, string calldata signature, bytes calldata data, uint256 eta ) external returns (bytes32); function cancelTransaction( address target, uint256 value, string calldata signature, bytes calldata data, uint256 eta ) external; function executeTransaction( address target, uint256 value, string calldata signature, bytes calldata data, uint256 eta ) external payable returns (bytes memory); } interface CtxInterface { function getPriorVotes(address account, uint256 blockNumber) external view returns (uint96); }
0x6080604052600436106101405760003560e01c806340e58ee5116100b6578063da35c6641161006f578063da35c66414610375578063da95691a1461038a578063ddf0b009146103aa578063deaaa7cc146103ca578063e23a9a52146103df578063fe0d94c11461040c57610140565b806340e58ee5146102c75780634178b249146102e75780634634c61f146103165780637bdbe4d014610336578063b58131b01461034b578063d33219b41461036057610140565b806320606b701161010857806320606b701461020957806324bc1a641461021e578063277838df14610233578063328dd982146102555780633932abb1146102855780633e4f49e61461029a57610140565b8063013cf08b1461014557806302a251a31461018357806306fdde03146101a557806315373e3d146101c757806317977c61146101e9575b600080fd5b34801561015157600080fd5b5061016561016036600461209b565b61041f565b60405161017a99989796959493929190612be1565b60405180910390f35b34801561018f57600080fd5b50610198610478565b60405161017a9190612461565b3480156101b157600080fd5b506101ba61047e565b60405161017a91906124ec565b3480156101d357600080fd5b506101e76101e23660046120de565b6104b0565b005b3480156101f557600080fd5b50610198610204366004611f0e565b6104bf565b34801561021557600080fd5b506101986104d1565b34801561022a57600080fd5b506101986104f5565b34801561023f57600080fd5b50610248610503565b60405161017a91906124c4565b34801561026157600080fd5b5061027561027036600461209b565b610512565b60405161017a94939291906123e8565b34801561029157600080fd5b506101986107a1565b3480156102a657600080fd5b506102ba6102b536600461209b565b6107a6565b60405161017a91906124d8565b3480156102d357600080fd5b506101e76102e236600461209b565b610939565b3480156102f357600080fd5b506103076103023660046120b3565b610b8d565b60405161017a93929190612440565b34801561032257600080fd5b506101e761033136600461210d565b610bc8565b34801561034257600080fd5b50610198610d7a565b34801561035757600080fd5b50610198610d7f565b34801561036c57600080fd5b50610248610d8d565b34801561038157600080fd5b50610198610d9c565b34801561039657600080fd5b506101986103a5366004611f28565b610da2565b3480156103b657600080fd5b506101e76103c536600461209b565b6111c2565b3480156103d657600080fd5b5061019861142c565b3480156103eb57600080fd5b506103ff6103fa3660046120b3565b611450565b60405161017a9190612b1b565b6101e761041a36600461209b565b6114e6565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b61438090565b604051806040016040528060168152602001754372797074657820476f7665726e6f7220416c70686160501b81525081565b6104bb3383836116ab565b5050565b60056020526000908152604090205481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6954b40b1f852bda00000090565b6001546001600160a01b031681565b6060806060806000600460008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561059457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610576575b50505050509350828054806020026020016040519081016040528092919081815260200182805480156105e657602002820191906000526020600020905b8154815260200190600101908083116105d2575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156106b95760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156106a55780601f1061067a576101008083540402835291602001916106a5565b820191906000526020600020905b81548152906001019060200180831161068857829003601f168201915b50505050508152602001906001019061060e565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101561078b5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156107775780601f1061074c57610100808354040283529160200191610777565b820191906000526020600020905b81548152906001019060200180831161075a57829003601f168201915b5050505050815260200190600101906106e0565b5050505090509450945094509450509193509193565b600190565b600081600254101580156107ba5750600082115b6107df5760405162461bcd60e51b81526004016107d690612622565b60405180910390fd5b6000828152600460205260409020600b81015460ff1615610804576002915050610934565b80600701544311610819576000915050610934565b8060080154431161082e576001915050610934565b80600a0154816009015411158061084f57506108486104f5565b8160090154105b1561085e576003915050610934565b6002810154610871576004915050610934565b600b810154610100900460ff161561088d576007915050610934565b61091e816002015460008054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e157600080fd5b505afa1580156108f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109199190612010565b611877565b421061092e576006915050610934565b60059150505b919050565b6000610944826107a6565b9050600781600781111561095457fe5b14156109725760405162461bcd60e51b81526004016107d690612a4c565b6000828152600460205260409020610988610d7f565b60018054838201546001600160a01b039182169263782d6fe192909116906109b19043906118a3565b6040518363ffffffff1660e01b81526004016109ce929190612319565b60206040518083038186803b1580156109e657600080fd5b505afa1580156109fa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1e9190612163565b6001600160601b031610610a445760405162461bcd60e51b81526004016107d690612818565b600b8101805460ff1916600117905560005b6003820154811015610b50576000546003830180546001600160a01b039092169163591fcdfe919084908110610a8857fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610ab057fe5b9060005260206000200154856005018581548110610aca57fe5b90600052602060002001866006018681548110610ae357fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610b129594939291906123af565b600060405180830381600087803b158015610b2c57600080fd5b505af1158015610b40573d6000803e3d6000fd5b505060019092019150610a569050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610b809190612461565b60405180910390a1505050565b600360209081526000928352604080842090915290825290205460ff808216916101008104909116906201000090046001600160601b031683565b6040805180820190915260168152754372797074657820476f7665726e6f7220416c70686160501b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fc0638f7f765836bcf1ad0088696b4ced8d6fc880adcfdc20bf42a7eb745b6996610c426118cb565b30604051602001610c56949392919061246a565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610ca59392919061248e565b60405160208183030381529060405280519060200120905060008282604051602001610cd29291906122fe565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610d0f94939291906124a6565b6020604051602081039080840390855afa158015610d31573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610d645760405162461bcd60e51b81526004016107d69061297a565b610d6f818a8a6116ab565b505050505050505050565b600a90565b69152d02c7e14af680000090565b6000546001600160a01b031681565b60025481565b6000610dac610d7f565b600180546001600160a01b03169063782d6fe1903390610dcd9043906118a3565b6040518363ffffffff1660e01b8152600401610dea929190612319565b60206040518083038186803b158015610e0257600080fd5b505afa158015610e16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3a9190612163565b6001600160601b031611610e605760405162461bcd60e51b81526004016107d69061291d565b84518651148015610e72575083518651145b8015610e7f575082518651145b610e9b5760405162461bcd60e51b81526004016107d6906127ae565b8551610eb95760405162461bcd60e51b81526004016107d6906128d1565b610ec1610d7a565b86511115610ee15760405162461bcd60e51b81526004016107d69061273b565b336000908152600560205260409020548015610f5e576000610f02826107a6565b90506001816007811115610f1257fe5b1415610f305760405162461bcd60e51b81526004016107d6906129c9565b6000816007811115610f3e57fe5b1415610f5c5760405162461bcd60e51b81526004016107d6906126b8565b505b6000610f6c436109196107a1565b90506000610f7c82610919610478565b6002805460010190559050610f8f611a2e565b604051806101a001604052806002548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060046000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003019080519060200190611072929190611aa3565b506080820151805161108e916004840191602090910190611b08565b5060a082015180516110aa916005840191602090910190611b43565b5060c082015180516110c6916006840191602090910190611b9c565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516005600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e6040516111ac99989796959493929190612b49565b60405180910390a1519998505050505050505050565b60046111cd826107a6565b60078111156111d857fe5b146111f55760405162461bcd60e51b81526004016107d69061254d565b600081815260046020818152604080842084548251630d48571f60e31b8152925191959461124a9442946001600160a01b0390931693636a42b8f8938084019390829003018186803b1580156108e157600080fd5b905060005b60038301548110156113f2576113ea83600301828154811061126d57fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061129557fe5b90600052602060002001548560050184815481106112af57fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561133d5780601f106113125761010080835404028352916020019161133d565b820191906000526020600020905b81548152906001019060200180831161132057829003601f168201915b505050505086600601858154811061135157fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156113df5780601f106113b4576101008083540402835291602001916113df565b820191906000526020600020905b8154815290600101906020018083116113c257829003601f168201915b5050505050866118cf565b60010161124f565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610b809085908490612c2d565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b611458611bf5565b826002541015801561146a5750600083115b6114865760405162461bcd60e51b81526004016107d6906124ff565b5060009182526003602090815260408084206001600160a01b03939093168452918152918190208151606081018352905460ff80821615158352610100820416151593820193909352620100009092046001600160601b03169082015290565b60056114f1826107a6565b60078111156114fc57fe5b146115195760405162461bcd60e51b81526004016107d6906125b7565b6000818152600460205260408120600b8101805461ff001916610100179055905b600382015481101561166f576000546004830180546001600160a01b0390921691630825f38f91908490811061156c57fe5b906000526020600020015484600301848154811061158657fe5b6000918252602090912001546004860180546001600160a01b0390921691869081106115ae57fe5b90600052602060002001548660050186815481106115c857fe5b906000526020600020018760060187815481106115e157fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016116109594939291906123af565b6000604051808303818588803b15801561162957600080fd5b505af115801561163d573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526116669190810190612028565b5060010161153a565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8260405161169f9190612461565b60405180910390a15050565b60016116b6836107a6565b60078111156116c157fe5b146116de5760405162461bcd60e51b81526004016107d690612aa2565b6000828152600460209081526040808320600383528184206001600160a01b0388168552909252909120805460ff161561172a5760405162461bcd60e51b81526004016107d69061266b565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611760918a91600401612319565b60206040518083038186803b15801561177857600080fd5b505afa15801561178c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b09190612163565b905083156117d9576117cf8360090154826001600160601b0316611877565b60098401556117f6565b6117f083600a0154826001600160601b0316611877565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611867908890889088908690612332565b60405180910390a1505050505050565b60008282018381101561189c5760405162461bcd60e51b81526004016107d690612783565b9392505050565b6000828211156118c55760405162461bcd60e51b81526004016107d690612aec565b50900390565b4690565b6000546040516001600160a01b039091169063f2b06537906118fd9088908890889088908890602001612363565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b815260040161192f9190612461565b60206040518083038186803b15801561194757600080fd5b505afa15801561195b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197f9190611ff4565b1561199c5760405162461bcd60e51b81526004016107d690612867565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f901906119d49088908890889088908890600401612363565b602060405180830381600087803b1580156119ee57600080fd5b505af1158015611a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a269190612010565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611af8579160200282015b82811115611af857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611ac3565b50611b04929150611c15565b5090565b828054828255906000526020600020908101928215611af8579160200282015b82811115611af8578251825591602001919060010190611b28565b828054828255906000526020600020908101928215611b90579160200282015b82811115611b905782518051611b80918491602090910190611c2a565b5091602001919060010190611b63565b50611b04929150611ca5565b828054828255906000526020600020908101928215611be9579160200282015b82811115611be95782518051611bd9918491602090910190611c2a565b5091602001919060010190611bbc565b50611b04929150611cc2565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611b045760008155600101611c16565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611c605760008555611af8565b82601f10611c7957805160ff1916838001178555611af8565b82800160010185558215611af85791820182811115611af8578251825591602001919060010190611b28565b80821115611b04576000611cb98282611cdf565b50600101611ca5565b80821115611b04576000611cd68282611cdf565b50600101611cc2565b50805460018160011615610100020316600290046000825580601f10611d055750611d23565b601f016020900490600052602060002090810190611d239190611c15565b50565b80356001600160a01b038116811461093457600080fd5b600082601f830112611d4d578081fd5b8135611d60611d5b82612c5f565b612c3b565b818152915060208083019084810181840286018201871015611d8157600080fd5b60005b84811015611da757611d9582611d26565b84529282019290820190600101611d84565b505050505092915050565b600082601f830112611dc2578081fd5b8135611dd0611d5b82612c5f565b818152915060208083019084810160005b84811015611da757611df8888484358a0101611ec0565b84529282019290820190600101611de1565b600082601f830112611e1a578081fd5b8135611e28611d5b82612c5f565b818152915060208083019084810160005b84811015611da757611e50888484358a0101611ec0565b84529282019290820190600101611e39565b600082601f830112611e72578081fd5b8135611e80611d5b82612c5f565b818152915060208083019084810181840286018201871015611ea157600080fd5b60005b84811015611da757813584529282019290820190600101611ea4565b600082601f830112611ed0578081fd5b8135611ede611d5b82612c7d565b9150808252836020828501011115611ef557600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215611f1f578081fd5b61189c82611d26565b600080600080600060a08688031215611f3f578081fd5b853567ffffffffffffffff80821115611f56578283fd5b611f6289838a01611d3d565b96506020880135915080821115611f77578283fd5b611f8389838a01611e62565b95506040880135915080821115611f98578283fd5b611fa489838a01611e0a565b94506060880135915080821115611fb9578283fd5b611fc589838a01611db2565b93506080880135915080821115611fda578283fd5b50611fe788828901611ec0565b9150509295509295909350565b600060208284031215612005578081fd5b815161189c81612cdb565b600060208284031215612021578081fd5b5051919050565b600060208284031215612039578081fd5b815167ffffffffffffffff81111561204f578182fd5b8201601f8101841361205f578182fd5b805161206d611d5b82612c7d565b818152856020838501011115612081578384fd5b612092826020830160208601612cab565b95945050505050565b6000602082840312156120ac578081fd5b5035919050565b600080604083850312156120c5578182fd5b823591506120d560208401611d26565b90509250929050565b600080604083850312156120f0578182fd5b82359150602083013561210281612cdb565b809150509250929050565b600080600080600060a08688031215612124578283fd5b85359450602086013561213681612cdb565b9350604086013560ff8116811461214b578384fd5b94979396509394606081013594506080013592915050565b600060208284031215612174578081fd5b81516001600160601b038116811461189c578182fd5b6000815180845260208085019450808401835b838110156121c25781516001600160a01b03168752958201959082019060010161219d565b509495945050505050565b6000815180845260208085018081965082840281019150828601855b8581101561221357828403895261220184835161224f565b988501989350908401906001016121e9565b5091979650505050505050565b6000815180845260208085019450808401835b838110156121c257815187529582019590820190600101612233565b60008151808452612267816020860160208601612cab565b601f01601f19169290920160200192915050565b6000815460018082166000811461229957600181146122b7576122f5565b60028304607f16865260ff19831660208701526040860193506122f5565b600283048087526122c786612c9f565b60005b828110156122eb5781546020828b01015284820191506020810190506122ca565b8801602001955050505b50505092915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039490941684526020840192909252151560408301526001600160601b0316606082015260800190565b600060018060a01b038716825285602083015260a0604083015261238a60a083018661224f565b828103606084015261239c818661224f565b9150508260808301529695505050505050565b600060018060a01b038716825285602083015260a060408301526123d660a083018661227b565b828103606084015261239c818661227b565b6000608082526123fb608083018761218a565b828103602084015261240d8187612220565b9050828103604084015261242181866121cd565b9050828103606084015261243581856121cd565b979650505050505050565b921515835290151560208301526001600160601b0316604082015260600190565b90815260200190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b6001600160a01b0391909116815260200190565b60208101600883106124e657fe5b91905290565b60006020825261189c602083018461224f565b6020808252602e908201527f476f7665726e6f72416c7068613a3a676574526563656970743a20696e76616c60408201526d1a59081c1c9bdc1bdcd85b081a5960921b606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360408201527f616e206f6e6c79206265207175657565642069662069742069732073756363656060820152631959195960e21b608082015260a00190565b60208082526045908201527f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60408201527f2063616e206f6e6c7920626520657865637574656420696620697420697320716060820152641d595d595960da1b608082015260a00190565b60208082526029908201527f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070726040820152681bdc1bdcd85b081a5960ba1b606082015260800190565b6020808252602d908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060408201526c185b1c9958591e481d9bdd1959609a1b606082015260800190565b60208082526059908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000608082015260a00190565b60208082526028908201527f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960408201526720616374696f6e7360c01b606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b60208082526044908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60408201527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6060820152630c2e8c6d60e31b608082015260a00190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060408201526e18589bdd99481d1a1c995cda1bdb19608a1b606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060408201527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746060820152632065746160e01b608082015260a00190565b6020808252602c908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60408201526b7669646520616374696f6e7360a01b606082015260800190565b6020808252603f908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260408201527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400606082015260800190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60408201526e76616c6964207369676e617475726560881b606082015260800190565b60208082526058908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c7265616479206163746976652070726f706f73616c0000000000000000608082015260a00190565b60208082526036908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063616040820152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b606082015260800190565b6020808252602a908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67604082015269081a5cc818db1bdcd95960b21b606082015260800190565b6020808252601590820152747375627472616374696f6e20756e646572666c6f7760581b604082015260600190565b8151151581526020808301511515908201526040918201516001600160601b03169181019190915260600190565b8981526001600160a01b038916602082015261012060408201819052600090612b748382018b61218a565b90508281036060840152612b88818a612220565b90508281036080840152612b9c81896121cd565b905082810360a0840152612bb081886121cd565b90508560c08401528460e0840152828103610100840152612bd1818561224f565b9c9b505050505050505050505050565b9889526001600160a01b0397909716602089015260408801959095526060870193909352608086019190915260a085015260c0840152151560e083015215156101008201526101200190565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715612c5757fe5b604052919050565b600067ffffffffffffffff821115612c7357fe5b5060209081020190565b600067ffffffffffffffff821115612c9157fe5b50601f01601f191660200190565b60009081526020902090565b60005b83811015612cc6578181015183820152602001612cae565b83811115612cd5576000848401525b50505050565b8015158114611d2357600080fdfea2646970667358221220291b950025986bfefef0aad57f8d45cea8ae9ec61178c6af621a53c7180b6a4f64736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
2,116
0xad930ef7533befef9d64d4077f116e76d7dc1358
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Aoyama is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Aoyama"; string private constant _symbol = "Aoyama"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; // 2% reflection fee for every holder uint256 private _teamFee = 10; // 10% Marketing uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 5000000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _Marketingfund; address payable private _Deployer; address payable private _devWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable devFundAddr, address payable devfeeAddr, address payable depAddr) { _Marketingfund = devFundAddr; _Deployer = depAddr; _devWalletAddress = devfeeAddr; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_Marketingfund] = true; _isExcludedFromFee[_devWalletAddress] = true; _isExcludedFromFee[_Deployer] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } if(from != address(this)){ require(amount <= _maxTxAmount); } require(!bots[from] && !bots[to] && !bots[msg.sender]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } // This is done to prevent the taxes from filling up in the router since compiled taxes emptying can impact the chart. // This reduces the impact of taxes on the chart. uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { // We need to swap the current tokens to ETH and send to the team wallet swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _Marketingfund.transfer(amount.div(2)); _devWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 25000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Deployer); swapEnabled = enabled; } function manualswap() external { require(_msgSender() == _Deployer); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _Deployer); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public { require(_msgSender() == _Deployer); for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public { require(_msgSender() == _Deployer); 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 { require(_msgSender() == _Deployer); require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external { require(_msgSender() == _Deployer); require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setTeamFee(uint256 teamFee) external { require(_msgSender() == _Deployer); require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25'); _teamFee = teamFee; } }
0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063cba0e9961161006f578063cba0e99614610389578063d00efb2f146103c2578063d543dbeb146103d8578063dd62ed3e146103f8578063e01af92c1461043e578063e47d60601461045e57600080fd5b806395d89b411461015b578063a9059cbb146102ff578063b515566a1461031f578063c0e6b46e1461033f578063c3c8cd801461035f578063c9567bf91461037457600080fd5b8063313ce56711610108578063313ce567146102515780635932ead11461026d5780636fc3eaec1461028d57806370a08231146102a2578063715018a6146102c25780638da5cb5b146102d757600080fd5b806306fdde031461015b578063095ea7b31461019957806318160ddd146101c957806323b872dd146101ef578063273123b71461020f578063286671621461023157600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506040805180820182526006815265416f79616d6160d01b602082015290516101909190611c89565b60405180910390f35b3480156101a557600080fd5b506101b96101b4366004611b1a565b610497565b6040519015158152602001610190565b3480156101d557600080fd5b50683635c9adc5dea000005b604051908152602001610190565b3480156101fb57600080fd5b506101b961020a366004611ada565b6104ae565b34801561021b57600080fd5b5061022f61022a366004611a6a565b610517565b005b34801561023d57600080fd5b5061022f61024c366004611c44565b610558565b34801561025d57600080fd5b5060405160098152602001610190565b34801561027957600080fd5b5061022f610288366004611c0c565b6105e0565b34801561029957600080fd5b5061022f610628565b3480156102ae57600080fd5b506101e16102bd366004611a6a565b610655565b3480156102ce57600080fd5b5061022f610677565b3480156102e357600080fd5b506000546040516001600160a01b039091168152602001610190565b34801561030b57600080fd5b506101b961031a366004611b1a565b6106eb565b34801561032b57600080fd5b5061022f61033a366004611b45565b6106f8565b34801561034b57600080fd5b5061022f61035a366004611c44565b610792565b34801561036b57600080fd5b5061022f610827565b34801561038057600080fd5b5061022f61085d565b34801561039557600080fd5b506101b96103a4366004611a6a565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103ce57600080fd5b506101e160165481565b3480156103e457600080fd5b5061022f6103f3366004611c44565b610c24565b34801561040457600080fd5b506101e1610413366004611aa2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561044a57600080fd5b5061022f610459366004611c0c565b610ce7565b34801561046a57600080fd5b506101b9610479366004611a6a565b6001600160a01b03166000908152600e602052604090205460ff1690565b60006104a4338484610d25565b5060015b92915050565b60006104bb848484610e49565b61050d843361050885604051806060016040528060288152602001611e5a602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112c0565b610d25565b5060019392505050565b6011546001600160a01b0316336001600160a01b03161461053757600080fd5b6001600160a01b03166000908152600e60205260409020805460ff19169055565b6011546001600160a01b0316336001600160a01b03161461057857600080fd5b6001811015801561058a575060198111155b6105db5760405162461bcd60e51b815260206004820152601b60248201527f7465616d4665652073686f756c6420626520696e2031202d203235000000000060448201526064015b60405180910390fd5b600955565b6000546001600160a01b0316331461060a5760405162461bcd60e51b81526004016105d290611cdc565b60148054911515600160b81b0260ff60b81b19909216919091179055565b6011546001600160a01b0316336001600160a01b03161461064857600080fd5b47610652816112fa565b50565b6001600160a01b0381166000908152600260205260408120546104a89061137f565b6000546001600160a01b031633146106a15760405162461bcd60e51b81526004016105d290611cdc565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104a4338484610e49565b6011546001600160a01b0316336001600160a01b03161461071857600080fd5b60005b815181101561078e576001600e600084848151811061074a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061078681611def565b91505061071b565b5050565b6011546001600160a01b0316336001600160a01b0316146107b257600080fd5b600081116108025760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016105d2565b61082161271061081b683635c9adc5dea0000084611403565b90611482565b600d5550565b6011546001600160a01b0316336001600160a01b03161461084757600080fd5b600061085230610655565b9050610652816114c4565b6000546001600160a01b031633146108875760405162461bcd60e51b81526004016105d290611cdc565b601454600160a01b900460ff16156108e15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105d2565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561091e3082683635c9adc5dea00000610d25565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561095757600080fd5b505afa15801561096b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098f9190611a86565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109d757600080fd5b505afa1580156109eb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0f9190611a86565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a5757600080fd5b505af1158015610a6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8f9190611a86565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610abf81610655565b600080610ad46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b709190611c5c565b50506014805468015af1d78b58c400006015554360165563ffff00ff60a01b1981166201000160a01b1790915560135460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610bec57600080fd5b505af1158015610c00573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078e9190611c28565b6011546001600160a01b0316336001600160a01b031614610c4457600080fd5b60008111610c945760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016105d2565b610cac606461081b683635c9adc5dea0000084611403565b60158190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6011546001600160a01b0316336001600160a01b031614610d0757600080fd5b60148054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610d875760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105d2565b6001600160a01b038216610de85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105d2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ead5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105d2565b6001600160a01b038216610f0f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105d2565b60008111610f715760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105d2565b6000546001600160a01b03848116911614801590610f9d57506000546001600160a01b03838116911614155b1561126357601454600160b81b900460ff1615611084576001600160a01b0383163014801590610fd657506001600160a01b0382163014155b8015610ff057506013546001600160a01b03848116911614155b801561100a57506013546001600160a01b03838116911614155b15611084576013546001600160a01b0316336001600160a01b0316148061104457506014546001600160a01b0316336001600160a01b0316145b6110845760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016105d2565b6001600160a01b03831630146110a3576015548111156110a357600080fd5b6001600160a01b0383166000908152600e602052604090205460ff161580156110e557506001600160a01b0382166000908152600e602052604090205460ff16155b80156111015750336000908152600e602052604090205460ff16155b61110a57600080fd5b6014546001600160a01b03848116911614801561113557506013546001600160a01b03838116911614155b801561115a57506001600160a01b03821660009081526005602052604090205460ff16155b801561116f5750601454600160b81b900460ff165b156111bd576001600160a01b0382166000908152600f6020526040902054421161119857600080fd5b6111a342600f611d81565b6001600160a01b0383166000908152600f60205260409020555b60006111c830610655565b9050600d5481106111d85750600d545b600c546014549082101590600160a81b900460ff161580156112035750601454600160b01b900460ff165b801561120c5750805b801561122657506014546001600160a01b03868116911614155b801561124057506013546001600160a01b03868116911614155b156112605761124e826114c4565b47801561125e5761125e476112fa565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112a557506001600160a01b03831660009081526005602052604090205460ff165b156112ae575060005b6112ba84848484611669565b50505050565b600081848411156112e45760405162461bcd60e51b81526004016105d29190611c89565b5060006112f18486611dd8565b95945050505050565b6010546001600160a01b03166108fc611314836002611482565b6040518115909202916000818181858888f1935050505015801561133c573d6000803e3d6000fd5b506012546001600160a01b03166108fc611357836002611482565b6040518115909202916000818181858888f1935050505015801561078e573d6000803e3d6000fd5b60006006548211156113e65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105d2565b60006113f0611697565b90506113fc8382611482565b9392505050565b600082611412575060006104a8565b600061141e8385611db9565b90508261142b8583611d99565b146113fc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105d2565b60006113fc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ba565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061151a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561156e57600080fd5b505afa158015611582573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a69190611a86565b816001815181106115c757634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546115ed9130911684610d25565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611626908590600090869030904290600401611d11565b600060405180830381600087803b15801561164057600080fd5b505af1158015611654573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611676576116766116e8565b611681848484611716565b806112ba576112ba600a54600855600b54600955565b60008060006116a461180d565b90925090506116b38282611482565b9250505090565b600081836116db5760405162461bcd60e51b81526004016105d29190611c89565b5060006112f18486611d99565b6008541580156116f85750600954155b156116ff57565b60088054600a5560098054600b5560009182905555565b6000806000806000806117288761184f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061175a90876118ac565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461178990866118ee565b6001600160a01b0389166000908152600260205260409020556117ab8161194d565b6117b58483611997565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117fa91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006118298282611482565b82101561184657505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061186c8a6008546009546119bb565b925092509250600061187c611697565b9050600080600061188f8e878787611a0a565b919e509c509a509598509396509194505050505091939550919395565b60006113fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112c0565b6000806118fb8385611d81565b9050838110156113fc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105d2565b6000611957611697565b905060006119658383611403565b3060009081526002602052604090205490915061198290826118ee565b30600090815260026020526040902055505050565b6006546119a490836118ac565b6006556007546119b490826118ee565b6007555050565b60008080806119cf606461081b8989611403565b905060006119e2606461081b8a89611403565b905060006119fa826119f48b866118ac565b906118ac565b9992985090965090945050505050565b6000808080611a198886611403565b90506000611a278887611403565b90506000611a358888611403565b90506000611a47826119f486866118ac565b939b939a50919850919650505050505050565b8035611a6581611e36565b919050565b600060208284031215611a7b578081fd5b81356113fc81611e36565b600060208284031215611a97578081fd5b81516113fc81611e36565b60008060408385031215611ab4578081fd5b8235611abf81611e36565b91506020830135611acf81611e36565b809150509250929050565b600080600060608486031215611aee578081fd5b8335611af981611e36565b92506020840135611b0981611e36565b929592945050506040919091013590565b60008060408385031215611b2c578182fd5b8235611b3781611e36565b946020939093013593505050565b60006020808385031215611b57578182fd5b823567ffffffffffffffff80821115611b6e578384fd5b818501915085601f830112611b81578384fd5b813581811115611b9357611b93611e20565b8060051b604051601f19603f83011681018181108582111715611bb857611bb8611e20565b604052828152858101935084860182860187018a1015611bd6578788fd5b8795505b83861015611bff57611beb81611a5a565b855260019590950194938601938601611bda565b5098975050505050505050565b600060208284031215611c1d578081fd5b81356113fc81611e4b565b600060208284031215611c39578081fd5b81516113fc81611e4b565b600060208284031215611c55578081fd5b5035919050565b600080600060608486031215611c70578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611cb557858101830151858201604001528201611c99565b81811115611cc65783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d605784516001600160a01b031683529383019391830191600101611d3b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d9457611d94611e0a565b500190565b600082611db457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611dd357611dd3611e0a565b500290565b600082821015611dea57611dea611e0a565b500390565b6000600019821415611e0357611e03611e0a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461065257600080fd5b801515811461065257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206fa6cd2813fe6d738fc3906370b67af3969450862c53978c8a55a0e07170e03d64736f6c63430008040033
{"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"}]}}
2,117
0x238b0A15cc28E621bCC0BD78db1987E14b6929f3
/** *Submitted for verification at Etherscan.io on 2021-03-03 */ pragma solidity ^0.5.17; // SPDX-License-Identifier: MIT /** * @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; } } // Original file came from Compound: https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol // Original audit: https://blog.openzeppelin.com/compound-finance-patch-audit/ // Overview: // No Critical // No High // contract Timelock { using SafeMath for uint256; /// @notice An event emitted when the timelock admin changes event NewAdmin(address indexed newAdmin); /// @notice An event emitted when a new admin is staged in the timelock event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); /// @notice An event emitted when a queued transaction is cancelled event CancelTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); /// @notice An event emitted when a queued transaction is executed event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); /// @notice An event emitted when a new transaction is queued event QueueTransaction(bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta); /// @notice the length of time after the delay has passed that a transaction can be executed uint256 public constant GRACE_PERIOD = 14 days; /// @notice the minimum length of the timelock delay uint256 public constant MINIMUM_DELAY = 24 hours; /// @notice the maximum length of the timelock delay uint256 public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint256 public delay; bool public admin_initialized; mapping (bytes32 => bool) public queuedTransactions; constructor() public { admin = msg.sender; delay = MINIMUM_DELAY; admin_initialized = false; } function() external payable { } /** @notice sets the delay @param delay_ the new delay */ function setDelay(uint256 delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } /// @notice sets the new admin address function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } /** @notice queues a new pendingAdmin @param pendingAdmin_ the new pendingAdmin address */ function setPendingAdmin(address pendingAdmin_) public { // allows one time setting of admin for deployment purposes if (admin_initialized) { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); } else { admin_initialized = true; } pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); // timelock not enforced prior to updating the admin. This should occur on // deployment. bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); if (admin_initialized) { require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; } bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call.value(value)(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint256) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100dd5760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e214610787578063e177246e146107b2578063f2b06537146107ed578063f851a44014610840576100dd565b80636fc1f57e146107025780637d645fab14610731578063b1b43ae51461075c576100dd565b80633a66f901116100bb5780633a66f9011461034c5780634dd18bf5146104f3578063591fcdfe146105445780636a42b8f8146106d7576100dd565b80630825f38f146100df5780630e18b681146102de57806326782247146102f5575b005b610263600480360360a08110156100f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561013c57600080fd5b82018360208201111561014e57600080fd5b8035906020019184600183028401116401000000008311171561017057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101d357600080fd5b8201836020820111156101e557600080fd5b8035906020019184600183028401116401000000008311171561020757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050610897565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102a3578082015181840152602081019050610288565b50505050905090810190601f1680156102d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ea57600080fd5b506102f3610f2e565b005b34801561030157600080fd5b5061030a6110bc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035857600080fd5b506104dd600480360360a081101561036f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103b657600080fd5b8201836020820111156103c857600080fd5b803590602001918460018302840111640100000000831117156103ea57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561044d57600080fd5b82018360208201111561045f57600080fd5b8035906020019184600183028401116401000000008311171561048157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291905050506110e2565b6040518082815260200191505060405180910390f35b3480156104ff57600080fd5b506105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114a8565b005b34801561055057600080fd5b506106d5600480360360a081101561056757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105ae57600080fd5b8201836020820111156105c057600080fd5b803590602001918460018302840111640100000000831117156105e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561064557600080fd5b82018360208201111561065757600080fd5b8035906020019184600183028401116401000000008311171561067957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061160b565b005b3480156106e357600080fd5b506106ec611956565b6040518082815260200191505060405180910390f35b34801561070e57600080fd5b5061071761195c565b604051808215151515815260200191505060405180910390f35b34801561073d57600080fd5b5061074661196f565b6040518082815260200191505060405180910390f35b34801561076857600080fd5b50610771611976565b6040518082815260200191505060405180910390f35b34801561079357600080fd5b5061079c61197d565b6040518082815260200191505060405180910390f35b3480156107be57600080fd5b506107eb600480360360208110156107d557600080fd5b8101908080359060200190929190505050611984565b005b3480156107f957600080fd5b506108266004803603602081101561081057600080fd5b8101908080359060200190929190505050611af9565b604051808215151515815260200191505060405180910390f35b34801561084c57600080fd5b50610855611b19565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60606000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461093e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611bcf6038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156109ca5780820151818401526020810190506109af565b50505050905090810190601f1680156109f75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610a30578082015181840152602081019050610a15565b50505050905090810190601f168015610a5d5780820380516001836020036101000a031916815260200191505b50975050505050505050604051602081830303815290604052805190602001209050600360009054906101000a900460ff1615610c0c576004600082815260200190815260200160002060009054906101000a900460ff16610b0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611d22603d913960400191505060405180910390fd5b82610b13611b3e565b1015610b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180611c716045913960600191505060405180910390fd5b610b806212750084611b4690919063ffffffff16565b610b88611b3e565b1115610bdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611c3e6033913960400191505060405180910390fd5b60006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6060600086511415610c2057849050610cdb565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610ca35780518252602082019150602081019050602083039250610c80565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610d2b5780518252602082019150602081019050602083039250610d08565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610d8d576040519150601f19603f3d011682016040523d82523d6000602084013e610d92565b606091505b509150915081610ded576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611e05603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e7a578082015181840152602081019050610e5f565b50505050905090810190601f168015610ea75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610ee0578082015181840152602081019050610ec5565b50505050905090810190601f168015610f0d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38094505050505095945050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d5f6038913960400191505060405180910390fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60405160405180910390a2565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611189576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180611dcf6036913960400191505060405180910390fd5b6111a5600254611197611b3e565b611b4690919063ffffffff16565b8210156111fd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526049815260200180611e426049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561128957808201518184015260208101905061126e565b50505050905090810190601f1680156112b65780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156112ef5780820151818401526020810190506112d4565b50505050905090810190601f16801561131c5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156113f75780820151818401526020810190506113dc565b50505050905090810190601f1680156114245780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561145d578082015181840152602081019050611442565b50505050905090810190601f16801561148a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38091505095945050505050565b600360009054906101000a900460ff1615611546573073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611541576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d976038913960400191505060405180910390fd5b611562565b6001600360006101000a81548160ff0219169083151502179055505b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75660405160405180910390a250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116b0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180611c076037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561173c578082015181840152602081019050611721565b50505050905090810190601f1680156117695780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156117a2578082015181840152602081019050611787565b50505050905090810190601f1680156117cf5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156118aa57808201518184015260208101905061188f565b50505050905090810190601f1680156118d75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156119105780820151818401526020810190506118f5565b50505050905090810190601f16801561193d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b600360009054906101000a900460ff1681565b62278d0081565b6201518081565b6212750081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611e8b6031913960400191505060405180910390fd5b62015180811015611a64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611cb66034913960400191505060405180910390fd5b62278d00811115611ac0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611cea6038913960400191505060405180910390fd5b806002819055506002547f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c60405160405180910390a250565b60046020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600042905090565b600080828401905083811015611bc4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a723158205a28820c09e3c6d0f3106cac945a35dcf1c980747ee772f59c9a7206a677d86f64736f6c63430005110032
{"success": true, "error": null, "results": {}}
2,118
0x78f399331e0c4a6d12b8e34af921efb3e5e0f92e
/** *Submitted for verification at Etherscan.io on 2021-02-07 */ /** *Submitted for verification at Etherscan.io on 2019-10-18 */ /** *Submitted for verification at Etherscan.io on 2019-05-08 */ pragma solidity ^0.5.2; /** * @title SafeMath(Connor) * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath_Connor { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title IERC20(Connor) interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20_Connor { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20(Connor) token * @dev Implementation of the basic standard token. */ contract ERC20_Connor is IERC20_Connor { using SafeMath_Connor for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Approve an address to spend another addresses' tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent. */ function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); } } /** * @title ERC20Detailed(Connor) token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ contract ERC20Detailed_Connor is IERC20_Connor { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } } /** * @title ERC20Burnable(Connor) Token * @dev Token that can be irreversibly burned (destroyed). */ contract ERC20Burnable_Connor is ERC20_Connor { /** * @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); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The account whose tokens will be burned. * @param value uint256 The amount of token to be burned. */ function burnFrom(address from, uint256 value) public { _burnFrom(from, value); } } /** * @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 * `ERC20` functions. */ contract ConnorToken is ERC20_Connor, ERC20Detailed_Connor, ERC20Burnable_Connor { uint8 public constant DECIMALS = 2; uint256 public constant INITIAL_SUPPLY = 19990000 * (10 ** uint256(DECIMALS)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public ERC20Detailed_Connor("TraceToken", "TRE", DECIMALS) { _mint(msg.sender, INITIAL_SUPPLY); } }
0x608060405234801561001057600080fd5b5060043610610112576000357c01000000000000000000000000000000000000000000000000000000009004806339509351116100b457806395d89b411161008357806395d89b4114610444578063a457c2d7146104c7578063a9059cbb1461052d578063dd62ed3e1461059357610112565b8063395093511461030a57806342966c681461037057806370a082311461039e57806379cc6790146103f657610112565b806323b872dd116100f057806323b872dd1461021e5780632e0f2625146102a45780632ff2e9dc146102c8578063313ce567146102e657610112565b806306fdde0314610117578063095ea7b31461019a57806318160ddd14610200575b600080fd5b61011f61060b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015f578082015181840152602081019050610144565b50505050905090810190601f16801561018c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e6600480360360408110156101b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ad565b604051808215151515815260200191505060405180910390f35b6102086106c4565b6040518082815260200191505060405180910390f35b61028a6004803603606081101561023457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ce565b604051808215151515815260200191505060405180910390f35b6102ac61077f565b604051808260ff1660ff16815260200191505060405180910390f35b6102d0610784565b6040518082815260200191505060405180910390f35b6102ee610795565b604051808260ff1660ff16815260200191505060405180910390f35b6103566004803603604081101561032057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107ac565b604051808215151515815260200191505060405180910390f35b61039c6004803603602081101561038657600080fd5b8101908080359060200190929190505050610851565b005b6103e0600480360360208110156103b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085e565b6040518082815260200191505060405180910390f35b6104426004803603604081101561040c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a6565b005b61044c6108b4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048c578082015181840152602081019050610471565b50505050905090810190601f1680156104b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b6105796004803603604081101561054357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109fb565b604051808215151515815260200191505060405180910390f35b6105f5600480360360408110156105a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a12565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a35780601f10610678576101008083540402835291602001916106a3565b820191906000526020600020905b81548152906001019060200180831161068657829003601f168201915b5050505050905090565b60006106ba338484610a99565b6001905092915050565b6000600254905090565b60006106db848484610bfc565b610774843361076f85600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dc890919063ffffffff16565b610a99565b600190509392505050565b600281565b600260ff16600a0a63013105f00281565b6000600560009054906101000a900460ff16905090565b6000610847338461084285600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dea90919063ffffffff16565b610a99565b6001905092915050565b61085b3382610e0b565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108b08282610f5f565b5050565b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561094c5780601f106109215761010080835404028352916020019161094c565b820191906000526020600020905b81548152906001019060200180831161092f57829003601f168201915b5050505050905090565b60006109f133846109ec85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dc890919063ffffffff16565b610a99565b6001905092915050565b6000610a08338484610bfc565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610ad557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b1157600080fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610c3857600080fd5b610c89816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dc890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d1c816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dea90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211151515610dd957600080fd5b600082840390508091505092915050565b6000808284019050838110151515610e0157600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610e4757600080fd5b610e5c81600254610dc890919063ffffffff16565b600281905550610eb3816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dc890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b610f698282610e0b565b6110028233610ffd84600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dc890919063ffffffff16565b610a99565b505056fea165627a7a7230582039c1487ffb5f13e79943412a7dd97134ad56bd4c84b71124cbead64efce498520029
{"success": true, "error": null, "results": {}}
2,119
0x70c27f9df09500ef7df55d6aa1d66c66ca1f2c25
/** *Submitted for verification at Etherscan.io on 2021-07-24 */ /** *Submitted for verification at Etherscan.io on 2021-07-05 */ /** *Submitted for verification at Etherscan.io on 2021-07-05 */ /* No Team & Marketing wallet. 100% of the tokens will be on the market for trade. https://t.me/babypuginu */ // 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 BabyPugINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BabyPug | t.me/babypuginu"; string private constant _symbol = "BPUG"; 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 = 5; // 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 = 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280601981526020017f42616279507567207c20742e6d652f62616279707567696e7500000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4250554700000000000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b601e42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207fe55b6e5e720dbf6b615d67c2f75ef5429bfe9f60f3705294a6fe6ff90019dc64736f6c63430008040033
{"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"}]}}
2,120
0x49ea128ed146355868f9c037c999edc5d716df09
/** *Submitted for verification at Etherscan.io on 2022-04-28 */ /** 🧑🏻‍🦲OnePunch Man🧑🏻‍🦲 Telegram: t.me/onepunchmanerc20 Website: www.onepunchmanerc.com MaxBuy:2% */ pragma solidity ^0.8.7; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract OnePunchMan 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 = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "OnePunchMan"; string private constant _symbol = "OnePunchMan"; 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 () { _feeAddrWallet1 = payable(0x2570FD3662A6BB8d82834a56Cc0666753CBb6a1D); _feeAddrWallet2 = payable(0x2570FD3662A6BB8d82834a56Cc0666753CBb6a1D); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = 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 = 8; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 12; } 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 { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.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 = 2000000 * 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() 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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612a6a565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906125e4565b61042a565b60405161016d9190612a4f565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612bcc565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612591565b610458565b6040516101d59190612a4f565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906124f7565b610531565b005b34801561021357600080fd5b5061021c610621565b6040516102299190612c41565b60405180910390f35b34801561023e57600080fd5b506102596004803603810190610254919061266d565b61062a565b005b34801561026757600080fd5b506102706106dc565b005b34801561027e57600080fd5b50610299600480360381019061029491906124f7565b61074e565b6040516102a69190612bcc565b60405180910390f35b3480156102bb57600080fd5b506102c461079f565b005b3480156102d257600080fd5b506102db6108f2565b6040516102e89190612981565b60405180910390f35b3480156102fd57600080fd5b5061030661091b565b6040516103139190612a6a565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906125e4565b610958565b6040516103509190612a4f565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612624565b610976565b005b34801561038e57600080fd5b50610397610aa0565b005b3480156103a557600080fd5b506103ae610b1a565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612551565b611074565b6040516103e49190612bcc565b60405180910390f35b60606040518060400160405280600b81526020017f4f6e6550756e63684d616e000000000000000000000000000000000000000000815250905090565b600061043e6104376110fb565b8484611103565b6001905092915050565b600067016345785d8a0000905090565b60006104658484846112ce565b610526846104716110fb565b610521856040518060600160405280602881526020016132f660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d76110fb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118d39092919063ffffffff16565b611103565b600190509392505050565b6105396110fb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bd90612b2c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106326110fb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b690612b2c565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661071d6110fb565b73ffffffffffffffffffffffffffffffffffffffff161461073d57600080fd5b600047905061074b81611937565b50565b6000610798600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a32565b9050919050565b6107a76110fb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610834576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082b90612b2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f4f6e6550756e63684d616e000000000000000000000000000000000000000000815250905090565b600061096c6109656110fb565b84846112ce565b6001905092915050565b61097e6110fb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0290612b2c565b60405180910390fd5b60005b8151811015610a9c57600160066000848481518110610a3057610a2f612f89565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a9490612ee2565b915050610a0e565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ae16110fb565b73ffffffffffffffffffffffffffffffffffffffff1614610b0157600080fd5b6000610b0c3061074e565b9050610b1781611aa0565b50565b610b226110fb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610baf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba690612b2c565b60405180910390fd5b600f60149054906101000a900460ff1615610bff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf690612bac565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c8e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000611103565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd457600080fd5b505afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c9190612524565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d6e57600080fd5b505afa158015610d82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da69190612524565b6040518363ffffffff1660e01b8152600401610dc392919061299c565b602060405180830381600087803b158015610ddd57600080fd5b505af1158015610df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e159190612524565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e9e3061074e565b600080610ea96108f2565b426040518863ffffffff1660e01b8152600401610ecb969594939291906129ee565b6060604051808303818588803b158015610ee457600080fd5b505af1158015610ef8573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f1d91906126c7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555066071afd498d00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161101e9291906129c5565b602060405180830381600087803b15801561103857600080fd5b505af115801561104c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611070919061269a565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611173576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116a90612b8c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111da90612acc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112c19190612bcc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561133e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133590612b6c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a590612a8c565b60405180910390fd5b600081116113f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e890612b4c565b60405180910390fd5b6000600a819055506008600b819055506114096108f2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561147757506114476108f2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118c357600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156115205750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61152957600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115d45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561162a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156116425750600f60179054906101000a900460ff165b156116f25760105481111561165657600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106116a157600080fd5b601e426116ae9190612d02565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561179d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117f35750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611809576000600a81905550600c600b819055505b60006118143061074e565b9050600f60159054906101000a900460ff161580156118815750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156118995750600f60169054906101000a900460ff165b156118c1576118a781611aa0565b600047905060008111156118bf576118be47611937565b5b505b505b6118ce838383611d28565b505050565b600083831115829061191b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119129190612a6a565b60405180910390fd5b506000838561192a9190612de3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611987600284611d3890919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156119b2573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a03600284611d3890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a2e573d6000803e3d6000fd5b5050565b6000600854821115611a79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7090612aac565b60405180910390fd5b6000611a83611d82565b9050611a988184611d3890919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ad857611ad7612fb8565b5b604051908082528060200260200182016040528015611b065781602001602082028036833780820191505090505b5090503081600081518110611b1e57611b1d612f89565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611bc057600080fd5b505afa158015611bd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf89190612524565b81600181518110611c0c57611c0b612f89565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611c7330600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611103565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611cd7959493929190612be7565b600060405180830381600087803b158015611cf157600080fd5b505af1158015611d05573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611d33838383611dad565b505050565b6000611d7a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611f78565b905092915050565b6000806000611d8f611fdb565b91509150611da68183611d3890919063ffffffff16565b9250505090565b600080600080600080611dbf8761203a565b955095509550955095509550611e1d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611eb285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120ec90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611efe8161214a565b611f088483612207565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611f659190612bcc565b60405180910390a3505050505050505050565b60008083118290611fbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb69190612a6a565b60405180910390fd5b5060008385611fce9190612d58565b9050809150509392505050565b60008060006008549050600067016345785d8a0000905061200f67016345785d8a0000600854611d3890919063ffffffff16565b82101561202d5760085467016345785d8a0000935093505050612036565b81819350935050505b9091565b60008060008060008060008060006120578a600a54600b54612241565b9250925092506000612067611d82565b9050600080600061207a8e8787876122d7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006120e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118d3565b905092915050565b60008082846120fb9190612d02565b905083811015612140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213790612aec565b60405180910390fd5b8091505092915050565b6000612154611d82565b9050600061216b828461236090919063ffffffff16565b90506121bf81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120ec90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61221c826008546120a290919063ffffffff16565b600881905550612237816009546120ec90919063ffffffff16565b6009819055505050565b60008060008061226d606461225f888a61236090919063ffffffff16565b611d3890919063ffffffff16565b905060006122976064612289888b61236090919063ffffffff16565b611d3890919063ffffffff16565b905060006122c0826122b2858c6120a290919063ffffffff16565b6120a290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806122f0858961236090919063ffffffff16565b90506000612307868961236090919063ffffffff16565b9050600061231e878961236090919063ffffffff16565b905060006123478261233985876120a290919063ffffffff16565b6120a290919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561237357600090506123d5565b600082846123819190612d89565b90508284826123909190612d58565b146123d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c790612b0c565b60405180910390fd5b809150505b92915050565b60006123ee6123e984612c81565b612c5c565b9050808382526020820190508285602086028201111561241157612410612fec565b5b60005b858110156124415781612427888261244b565b845260208401935060208301925050600181019050612414565b5050509392505050565b60008135905061245a816132b0565b92915050565b60008151905061246f816132b0565b92915050565b600082601f83011261248a57612489612fe7565b5b813561249a8482602086016123db565b91505092915050565b6000813590506124b2816132c7565b92915050565b6000815190506124c7816132c7565b92915050565b6000813590506124dc816132de565b92915050565b6000815190506124f1816132de565b92915050565b60006020828403121561250d5761250c612ff6565b5b600061251b8482850161244b565b91505092915050565b60006020828403121561253a57612539612ff6565b5b600061254884828501612460565b91505092915050565b6000806040838503121561256857612567612ff6565b5b60006125768582860161244b565b92505060206125878582860161244b565b9150509250929050565b6000806000606084860312156125aa576125a9612ff6565b5b60006125b88682870161244b565b93505060206125c98682870161244b565b92505060406125da868287016124cd565b9150509250925092565b600080604083850312156125fb576125fa612ff6565b5b60006126098582860161244b565b925050602061261a858286016124cd565b9150509250929050565b60006020828403121561263a57612639612ff6565b5b600082013567ffffffffffffffff81111561265857612657612ff1565b5b61266484828501612475565b91505092915050565b60006020828403121561268357612682612ff6565b5b6000612691848285016124a3565b91505092915050565b6000602082840312156126b0576126af612ff6565b5b60006126be848285016124b8565b91505092915050565b6000806000606084860312156126e0576126df612ff6565b5b60006126ee868287016124e2565b93505060206126ff868287016124e2565b9250506040612710868287016124e2565b9150509250925092565b60006127268383612732565b60208301905092915050565b61273b81612e17565b82525050565b61274a81612e17565b82525050565b600061275b82612cbd565b6127658185612ce0565b935061277083612cad565b8060005b838110156127a1578151612788888261271a565b975061279383612cd3565b925050600181019050612774565b5085935050505092915050565b6127b781612e29565b82525050565b6127c681612e6c565b82525050565b60006127d782612cc8565b6127e18185612cf1565b93506127f1818560208601612e7e565b6127fa81612ffb565b840191505092915050565b6000612812602383612cf1565b915061281d8261300c565b604082019050919050565b6000612835602a83612cf1565b91506128408261305b565b604082019050919050565b6000612858602283612cf1565b9150612863826130aa565b604082019050919050565b600061287b601b83612cf1565b9150612886826130f9565b602082019050919050565b600061289e602183612cf1565b91506128a982613122565b604082019050919050565b60006128c1602083612cf1565b91506128cc82613171565b602082019050919050565b60006128e4602983612cf1565b91506128ef8261319a565b604082019050919050565b6000612907602583612cf1565b9150612912826131e9565b604082019050919050565b600061292a602483612cf1565b915061293582613238565b604082019050919050565b600061294d601783612cf1565b915061295882613287565b602082019050919050565b61296c81612e55565b82525050565b61297b81612e5f565b82525050565b60006020820190506129966000830184612741565b92915050565b60006040820190506129b16000830185612741565b6129be6020830184612741565b9392505050565b60006040820190506129da6000830185612741565b6129e76020830184612963565b9392505050565b600060c082019050612a036000830189612741565b612a106020830188612963565b612a1d60408301876127bd565b612a2a60608301866127bd565b612a376080830185612741565b612a4460a0830184612963565b979650505050505050565b6000602082019050612a6460008301846127ae565b92915050565b60006020820190508181036000830152612a8481846127cc565b905092915050565b60006020820190508181036000830152612aa581612805565b9050919050565b60006020820190508181036000830152612ac581612828565b9050919050565b60006020820190508181036000830152612ae58161284b565b9050919050565b60006020820190508181036000830152612b058161286e565b9050919050565b60006020820190508181036000830152612b2581612891565b9050919050565b60006020820190508181036000830152612b45816128b4565b9050919050565b60006020820190508181036000830152612b65816128d7565b9050919050565b60006020820190508181036000830152612b85816128fa565b9050919050565b60006020820190508181036000830152612ba58161291d565b9050919050565b60006020820190508181036000830152612bc581612940565b9050919050565b6000602082019050612be16000830184612963565b92915050565b600060a082019050612bfc6000830188612963565b612c0960208301876127bd565b8181036040830152612c1b8186612750565b9050612c2a6060830185612741565b612c376080830184612963565b9695505050505050565b6000602082019050612c566000830184612972565b92915050565b6000612c66612c77565b9050612c728282612eb1565b919050565b6000604051905090565b600067ffffffffffffffff821115612c9c57612c9b612fb8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612d0d82612e55565b9150612d1883612e55565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612d4d57612d4c612f2b565b5b828201905092915050565b6000612d6382612e55565b9150612d6e83612e55565b925082612d7e57612d7d612f5a565b5b828204905092915050565b6000612d9482612e55565b9150612d9f83612e55565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612dd857612dd7612f2b565b5b828202905092915050565b6000612dee82612e55565b9150612df983612e55565b925082821015612e0c57612e0b612f2b565b5b828203905092915050565b6000612e2282612e35565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612e7782612e55565b9050919050565b60005b83811015612e9c578082015181840152602081019050612e81565b83811115612eab576000848401525b50505050565b612eba82612ffb565b810181811067ffffffffffffffff82111715612ed957612ed8612fb8565b5b80604052505050565b6000612eed82612e55565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612f2057612f1f612f2b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6132b981612e17565b81146132c457600080fd5b50565b6132d081612e29565b81146132db57600080fd5b50565b6132e781612e55565b81146132f257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202bf20c8b47bc62a077a674df90b9714e372939b6994486851308bc280d8603aa64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,121
0xc87467941c87ff919b3270b2116c206752c68d66
/** * **/ //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 Ryokoinu 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 _feeAddr1 = 5; uint256 private _feeAddr2 = 5; address payable private _feeAddrWallet1 = payable(0x8BA406c0390da8f87cB72A4c7aE882AF20e9684B); address payable private _feeAddrWallet2 = payable(0x8BA406c0390da8f87cB72A4c7aE882AF20e9684B); string private constant _name = "Ryoko-inu"; string private constant _symbol = "Ryoko-inu"; 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 () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[address(this)] = 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 setFeeAmountOne(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr1 = fee; } function setFeeAmountTwo(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr2 = fee; } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); 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); } } } _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 { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.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 = 50000000000000000 * 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 _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612b55565b60405180910390f35b34801561015b57600080fd5b506101766004803603810190610171919061267f565b610492565b6040516101839190612b3a565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612cd7565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d9919061262c565b6104c4565b6040516101eb9190612b3a565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612592565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612d4c565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612708565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612592565b6107ba565b6040516102bc9190612cd7565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612762565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612a6c565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612b55565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d919061267f565b610a65565b60405161038f9190612b3a565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba91906126bf565b610a83565b005b3480156103cd57600080fd5b506103d6610bad565b005b3480156103e457600080fd5b506103ed610c27565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612762565b611189565b005b34801561042457600080fd5b5061043f600480360381019061043a91906125ec565b61122a565b60405161044c9190612cd7565b60405180910390f35b60606040518060400160405280600981526020017f52796f6b6f2d696e750000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112b1565b84846112b9565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d1848484611484565b610592846104dd6112b1565b61058d8560405180606001604052806028815260200161342a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119629092919063ffffffff16565b6112b9565b600190509392505050565b6105a56112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c37565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c37565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112b1565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119c6565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac1565b9050919050565b6108136112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c37565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112b1565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612b97565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f52796f6b6f2d696e750000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112b1565b8484611484565b6001905092915050565b610a8b6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c37565b60405180910390fd5b60005b8151811015610ba957600160066000848481518110610b3d57610b3c613094565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ba190612fed565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bee6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614610c0e57600080fd5b6000610c19306107ba565b9050610c2481611b2f565b50565b610c2f6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb390612c37565b60405180910390fd5b600f60149054906101000a900460ff1615610d0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0390612cb7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d9f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610de557600080fd5b505afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d91906125bf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7f57600080fd5b505afa158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb791906125bf565b6040518363ffffffff1660e01b8152600401610ed4929190612a87565b602060405180830381600087803b158015610eee57600080fd5b505af1158015610f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2691906125bf565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610faf306107ba565b600080610fba6109ff565b426040518863ffffffff1660e01b8152600401610fdc96959493929190612ad9565b6060604051808303818588803b158015610ff557600080fd5b505af1158015611009573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061102e919061278f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611133929190612ab0565b602060405180830381600087803b15801561114d57600080fd5b505af1158015611161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111859190612735565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111ca6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614611220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121790612b97565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611329576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132090612c97565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139090612bd7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114779190612cd7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114eb90612c77565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155b90612b77565b60405180910390fd5b600081116115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e90612c57565b60405180910390fd5b6115af6109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed6109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561195257600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750600f60179054906101000a900460ff165b15611898576010548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190612e0d565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118a3306107ba565b9050600f60159054906101000a900460ff161580156119105750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119285750600f60169054906101000a900460ff165b156119505761193681611b2f565b6000479050600081111561194e5761194d476119c6565b5b505b505b61195d838383611db7565b505050565b60008383111582906119aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a19190612b55565b60405180910390fd5b50600083856119b99190612eee565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a16600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a41573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a92600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611abd573d6000803e3d6000fd5b5050565b6000600854821115611b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aff90612bb7565b60405180910390fd5b6000611b12611e11565b9050611b278184611dc790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b6757611b666130c3565b5b604051908082528060200260200182016040528015611b955781602001602082028036833780820191505090505b5090503081600081518110611bad57611bac613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c4f57600080fd5b505afa158015611c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8791906125bf565b81600181518110611c9b57611c9a613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d0230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d66959493929190612cf2565b600060405180830381600087803b158015611d8057600080fd5b505af1158015611d94573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dc2838383611e3c565b505050565b6000611e0983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612007565b905092915050565b6000806000611e1e61206a565b91509150611e358183611dc790919063ffffffff16565b9250505090565b600080600080600080611e4e876120d5565b955095509550955095509550611eac86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f4185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f8d816121e5565b611f9784836122a2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ff49190612cd7565b60405180910390a3505050505050505050565b6000808311829061204e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120459190612b55565b60405180910390fd5b506000838561205d9190612e63565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506120a66b033b2e3c9fd0803ce8000000600854611dc790919063ffffffff16565b8210156120c8576008546b033b2e3c9fd0803ce80000009350935050506120d1565b81819350935050505b9091565b60008060008060008060008060006120f28a600a54600b546122dc565b9250925092506000612102611e11565b905060008060006121158e878787612372565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061217f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611962565b905092915050565b60008082846121969190612e0d565b9050838110156121db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d290612bf7565b60405180910390fd5b8091505092915050565b60006121ef611e11565b9050600061220682846123fb90919063ffffffff16565b905061225a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122b78260085461213d90919063ffffffff16565b6008819055506122d28160095461218790919063ffffffff16565b6009819055505050565b60008060008061230860646122fa888a6123fb90919063ffffffff16565b611dc790919063ffffffff16565b905060006123326064612324888b6123fb90919063ffffffff16565b611dc790919063ffffffff16565b9050600061235b8261234d858c61213d90919063ffffffff16565b61213d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238b85896123fb90919063ffffffff16565b905060006123a286896123fb90919063ffffffff16565b905060006123b987896123fb90919063ffffffff16565b905060006123e2826123d4858761213d90919063ffffffff16565b61213d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561240e5760009050612470565b6000828461241c9190612e94565b905082848261242b9190612e63565b1461246b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246290612c17565b60405180910390fd5b809150505b92915050565b600061248961248484612d8c565b612d67565b905080838252602082019050828560208602820111156124ac576124ab6130f7565b5b60005b858110156124dc57816124c288826124e6565b8452602084019350602083019250506001810190506124af565b5050509392505050565b6000813590506124f5816133e4565b92915050565b60008151905061250a816133e4565b92915050565b600082601f830112612525576125246130f2565b5b8135612535848260208601612476565b91505092915050565b60008135905061254d816133fb565b92915050565b600081519050612562816133fb565b92915050565b60008135905061257781613412565b92915050565b60008151905061258c81613412565b92915050565b6000602082840312156125a8576125a7613101565b5b60006125b6848285016124e6565b91505092915050565b6000602082840312156125d5576125d4613101565b5b60006125e3848285016124fb565b91505092915050565b6000806040838503121561260357612602613101565b5b6000612611858286016124e6565b9250506020612622858286016124e6565b9150509250929050565b60008060006060848603121561264557612644613101565b5b6000612653868287016124e6565b9350506020612664868287016124e6565b925050604061267586828701612568565b9150509250925092565b6000806040838503121561269657612695613101565b5b60006126a4858286016124e6565b92505060206126b585828601612568565b9150509250929050565b6000602082840312156126d5576126d4613101565b5b600082013567ffffffffffffffff8111156126f3576126f26130fc565b5b6126ff84828501612510565b91505092915050565b60006020828403121561271e5761271d613101565b5b600061272c8482850161253e565b91505092915050565b60006020828403121561274b5761274a613101565b5b600061275984828501612553565b91505092915050565b60006020828403121561277857612777613101565b5b600061278684828501612568565b91505092915050565b6000806000606084860312156127a8576127a7613101565b5b60006127b68682870161257d565b93505060206127c78682870161257d565b92505060406127d88682870161257d565b9150509250925092565b60006127ee83836127fa565b60208301905092915050565b61280381612f22565b82525050565b61281281612f22565b82525050565b600061282382612dc8565b61282d8185612deb565b935061283883612db8565b8060005b8381101561286957815161285088826127e2565b975061285b83612dde565b92505060018101905061283c565b5085935050505092915050565b61287f81612f34565b82525050565b61288e81612f77565b82525050565b600061289f82612dd3565b6128a98185612dfc565b93506128b9818560208601612f89565b6128c281613106565b840191505092915050565b60006128da602383612dfc565b91506128e582613117565b604082019050919050565b60006128fd600c83612dfc565b915061290882613166565b602082019050919050565b6000612920602a83612dfc565b915061292b8261318f565b604082019050919050565b6000612943602283612dfc565b915061294e826131de565b604082019050919050565b6000612966601b83612dfc565b91506129718261322d565b602082019050919050565b6000612989602183612dfc565b915061299482613256565b604082019050919050565b60006129ac602083612dfc565b91506129b7826132a5565b602082019050919050565b60006129cf602983612dfc565b91506129da826132ce565b604082019050919050565b60006129f2602583612dfc565b91506129fd8261331d565b604082019050919050565b6000612a15602483612dfc565b9150612a208261336c565b604082019050919050565b6000612a38601783612dfc565b9150612a43826133bb565b602082019050919050565b612a5781612f60565b82525050565b612a6681612f6a565b82525050565b6000602082019050612a816000830184612809565b92915050565b6000604082019050612a9c6000830185612809565b612aa96020830184612809565b9392505050565b6000604082019050612ac56000830185612809565b612ad26020830184612a4e565b9392505050565b600060c082019050612aee6000830189612809565b612afb6020830188612a4e565b612b086040830187612885565b612b156060830186612885565b612b226080830185612809565b612b2f60a0830184612a4e565b979650505050505050565b6000602082019050612b4f6000830184612876565b92915050565b60006020820190508181036000830152612b6f8184612894565b905092915050565b60006020820190508181036000830152612b90816128cd565b9050919050565b60006020820190508181036000830152612bb0816128f0565b9050919050565b60006020820190508181036000830152612bd081612913565b9050919050565b60006020820190508181036000830152612bf081612936565b9050919050565b60006020820190508181036000830152612c1081612959565b9050919050565b60006020820190508181036000830152612c308161297c565b9050919050565b60006020820190508181036000830152612c508161299f565b9050919050565b60006020820190508181036000830152612c70816129c2565b9050919050565b60006020820190508181036000830152612c90816129e5565b9050919050565b60006020820190508181036000830152612cb081612a08565b9050919050565b60006020820190508181036000830152612cd081612a2b565b9050919050565b6000602082019050612cec6000830184612a4e565b92915050565b600060a082019050612d076000830188612a4e565b612d146020830187612885565b8181036040830152612d268186612818565b9050612d356060830185612809565b612d426080830184612a4e565b9695505050505050565b6000602082019050612d616000830184612a5d565b92915050565b6000612d71612d82565b9050612d7d8282612fbc565b919050565b6000604051905090565b600067ffffffffffffffff821115612da757612da66130c3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e1882612f60565b9150612e2383612f60565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e5857612e57613036565b5b828201905092915050565b6000612e6e82612f60565b9150612e7983612f60565b925082612e8957612e88613065565b5b828204905092915050565b6000612e9f82612f60565b9150612eaa83612f60565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ee357612ee2613036565b5b828202905092915050565b6000612ef982612f60565b9150612f0483612f60565b925082821015612f1757612f16613036565b5b828203905092915050565b6000612f2d82612f40565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f8282612f60565b9050919050565b60005b83811015612fa7578082015181840152602081019050612f8c565b83811115612fb6576000848401525b50505050565b612fc582613106565b810181811067ffffffffffffffff82111715612fe457612fe36130c3565b5b80604052505050565b6000612ff882612f60565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561302b5761302a613036565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6133ed81612f22565b81146133f857600080fd5b50565b61340481612f34565b811461340f57600080fd5b50565b61341b81612f60565b811461342657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b96d64d34a19bdef9ae5cfff9dc13cb91115cf7efe55bb095401f6bffbf083ad64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,122
0xce8bd4d93c7ead783e4c6262603521b9bb642d8d
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) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://g...content-available-to-author-only...b.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 ERC20Basic * @dev Simpler version of ERC20 interface * See https://g...content-available-to-author-only...b.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://g...content-available-to-author-only...b.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://g...content-available-to-author-only...b.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://g...content-available-to-author-only...b.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://g...content-available-to-author-only...b.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 RespublicaToken is StandardToken { string public name; string public symbol; uint public decimals; address public admin; constructor(string _name, string _symbol, uint _decimals, uint _initial_supply) public { name = _name; symbol = _symbol; decimals = _decimals; admin = 0x10a5b1eddf3744774d6dd5ece912f67d45fa2764; totalSupply_ = _initial_supply * (10 ** decimals); balances[admin] = totalSupply_; } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df578063313ce56714610264578063661884631461028f57806370a08231146102f457806395d89b411461034b578063a9059cbb146103db578063d73dd62314610440578063dd62ed3e146104a5578063f851a4401461051c575b600080fd5b3480156100cb57600080fd5b506100d4610573565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610611565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610703565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061070d565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610ac7565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102da600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610acd565b604051808215151515815260200191505060405180910390f35b34801561030057600080fd5b50610335600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5e565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610da6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e757600080fd5b50610426600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e44565b604051808215151515815260200191505060405180910390f35b34801561044c57600080fd5b5061048b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611063565b604051808215151515815260200191505060405180910390f35b3480156104b157600080fd5b50610506600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061125f565b6040518082815260200191505060405180910390f35b34801561052857600080fd5b506105316112e6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106095780601f106105de57610100808354040283529160200191610609565b820191906000526020600020905b8154815290600101906020018083116105ec57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561074a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561079757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561082257600080fd5b610873826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130c90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610906826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109d782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130c90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60055481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bde576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c72565b610bf1838261130c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e3c5780601f10610e1157610100808354040283529160200191610e3c565b820191906000526020600020905b815481529060010190602001808311610e1f57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e8157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ece57600080fd5b610f1f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fb2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110f482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600082821115151561131a57fe5b818303905092915050565b6000818301905082811015151561133857fe5b809050929150505600a165627a7a7230582024287f65946968c8fd6e2504d064c4968d5d3c4e27a49bd10de8525f3e2de45e0029
{"success": true, "error": null, "results": {}}
2,123
0x41a608D50DD254cF3204506F8b30f52aFA9df767
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ // SPDX-License-Identifier: UNLICENSED /** https://t.me/IrohINU ⡀⡀⠀⢂⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⢡⠀⢈⣆⣸⣀⡘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠂⠀⠀⠀⠀⢡⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⠤⠀⠀⠈⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⢐⠌⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠊⠔⠁⠀⠀⠀⠀⢀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠔⠀⡀⠀⠀⠀⡠⠒⢉⡠⠤⠤⠄⡠⡀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠌⠀⠀⠡⠄⠀⠸⣠⠖⠉⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠴⠾⠷⠦⢤⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡐⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⡡⠂⠈⠢⡆⠀⠀⠀⠀⠀⣠⠤⢶⣶⢤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢓⠀⠀⠀⠀⠃⢠⠀⠀⠠⠀⠀⠀⠈⠛⠋⠀⠀⠀⠀⠀⠀⡀⠀⠸⠿⠍⢲⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢦⢀⠀⠀⠁⡼⠀⠀⡀⠀⠀⠑⠀⠒⠂⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⠀⠀⡀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢁⠎⠀⠑⠄⠠⠃⠀⠀⢗⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠎⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⣰⠅⠀⠀⠀⠀⠈⠀⢐⠎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢄⠀⣠⣾⡀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠂⠀⠀⠀⣠⠊⠀⠀⠀⠀⠀⠀⢀⠂⠀⠀⠀⠀⠀⠀⠐⠀⠀⠀⠀⠀⠂⠀⠠⠈⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⡠⡀⠀⠀⢀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠈⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠀⠀⠀⠀⣸⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠈⡐⠀⢀⣔⣁⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢤⠀⠀⠀⡦⠠⠀⠀⠀⠀⠈⢆⠀⢀⣴⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⢬⠀⠈⣉⣞⠅⠀⠀⢒⠆⠀⠀⠀⠀⠀⠀⠀⠀⢘⡄⠀⠠⣇⠀⠀⠀⠀⠀⠀⠘⡆⣼⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀ ⠀⠀⠀⠀⢀⢂⣠⣾⣿⣿⣧⡤⠞⠓⡲⠷⠒⠊⠉⠉⠉⠙⠿⣿⣿⣦⣤⣻⠄⠀⠀⠀⠀⠀⠀⢹⣿⣿⣿⣿⣿⣿⢿⡀⠀⠈⠀⠀⠀⠀ ⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⢍⡛⢿⣷⣄⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀ ⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠢⢝⣿⣷⣄⠀⠀⠀⠀⠈⡏⠙⠿⠿⠛⢹⣿⣷⣄⡀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣿⣷⣦⣄⡀⣦⡟⠀⠀⠀⠀⢸⣿⣿⣿⣿⣦⣀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠙⠛⠿⠟⠛⠁⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣷ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣴⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣦⣤⣤⣄⣀⡀⢀⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ */ 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 IROHINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "IrohInu"; string private constant _symbol = "IROHINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _redisFeeOnSell = 1; 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) private cooldown; address payable private _developmentAddress = payable(0x8629E78EA553f1Db6E17e6B70D0208e5a1b0e619); address payable private _marketingAddress = payable(0x8629E78EA553f1Db6E17e6B70D0208e5a1b0e619); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000 * 10**9; //1% uint256 public _maxWalletSize = 30000 * 10**9; //3% uint256 public _swapTokensAtAmount = 4000 * 10**9; //.4% 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051c578063dd62ed3e1461053c578063ea1644d514610582578063f2fde38b146105a257600080fd5b8063a2a957bb14610497578063a9059cbb146104b7578063bfd79284146104d7578063c3c8cd801461050757600080fd5b80638f70ccf7116100d15780638f70ccf7146104115780638f9a55c01461043157806395d89b411461044757806398a5c3151461047757600080fd5b806374010ece146103bd5780637d1db4a5146103dd5780638da5cb5b146103f357600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103535780636fc3eaec1461037357806370a0823114610388578063715018a6146103a857600080fd5b8063313ce567146102f757806349bd5a5e146103135780636b9990531461033357600080fd5b80631694505e116101a05780631694505e1461026557806318160ddd1461029d57806323b872dd146102c15780632fd689e3146102e157600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023557600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab8565b6105c2565b005b3480156101ff57600080fd5b5060408051808201909152600781526649726f68496e7560c81b60208201525b60405161022c9190611bea565b60405180910390f35b34801561024157600080fd5b50610255610250366004611a08565b610661565b604051901515815260200161022c565b34801561027157600080fd5b50601454610285906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102a957600080fd5b5066038d7ea4c680005b60405190815260200161022c565b3480156102cd57600080fd5b506102556102dc3660046119c7565b610678565b3480156102ed57600080fd5b506102b360185481565b34801561030357600080fd5b506040516009815260200161022c565b34801561031f57600080fd5b50601554610285906001600160a01b031681565b34801561033f57600080fd5b506101f161034e366004611954565b6106e1565b34801561035f57600080fd5b506101f161036e366004611b84565b61072c565b34801561037f57600080fd5b506101f1610774565b34801561039457600080fd5b506102b36103a3366004611954565b6107bf565b3480156103b457600080fd5b506101f16107e1565b3480156103c957600080fd5b506101f16103d8366004611b9f565b610855565b3480156103e957600080fd5b506102b360165481565b3480156103ff57600080fd5b506000546001600160a01b0316610285565b34801561041d57600080fd5b506101f161042c366004611b84565b610884565b34801561043d57600080fd5b506102b360175481565b34801561045357600080fd5b5060408051808201909152600781526649524f48494e5560c81b602082015261021f565b34801561048357600080fd5b506101f1610492366004611b9f565b6108cc565b3480156104a357600080fd5b506101f16104b2366004611bb8565b6108fb565b3480156104c357600080fd5b506102556104d2366004611a08565b610939565b3480156104e357600080fd5b506102556104f2366004611954565b60106020526000908152604090205460ff1681565b34801561051357600080fd5b506101f1610946565b34801561052857600080fd5b506101f1610537366004611a34565b61099a565b34801561054857600080fd5b506102b361055736600461198e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058e57600080fd5b506101f161059d366004611b9f565b610a3b565b3480156105ae57600080fd5b506101f16105bd366004611954565b610a6a565b6000546001600160a01b031633146105f55760405162461bcd60e51b81526004016105ec90611c3f565b60405180910390fd5b60005b815181101561065d5760016010600084848151811061061957610619611d86565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065581611d55565b9150506105f8565b5050565b600061066e338484610b54565b5060015b92915050565b6000610685848484610c78565b6106d784336106d285604051806060016040528060288152602001611dc8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b4565b610b54565b5060019392505050565b6000546001600160a01b0316331461070b5760405162461bcd60e51b81526004016105ec90611c3f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107565760405162461bcd60e51b81526004016105ec90611c3f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107a957506013546001600160a01b0316336001600160a01b0316145b6107b257600080fd5b476107bc816111ee565b50565b6001600160a01b03811660009081526002602052604081205461067290611273565b6000546001600160a01b0316331461080b5760405162461bcd60e51b81526004016105ec90611c3f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461087f5760405162461bcd60e51b81526004016105ec90611c3f565b601655565b6000546001600160a01b031633146108ae5760405162461bcd60e51b81526004016105ec90611c3f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f65760405162461bcd60e51b81526004016105ec90611c3f565b601855565b6000546001600160a01b031633146109255760405162461bcd60e51b81526004016105ec90611c3f565b600893909355600a91909155600955600b55565b600061066e338484610c78565b6012546001600160a01b0316336001600160a01b0316148061097b57506013546001600160a01b0316336001600160a01b0316145b61098457600080fd5b600061098f306107bf565b90506107bc816112f7565b6000546001600160a01b031633146109c45760405162461bcd60e51b81526004016105ec90611c3f565b60005b82811015610a355781600560008686858181106109e6576109e6611d86565b90506020020160208101906109fb9190611954565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2d81611d55565b9150506109c7565b50505050565b6000546001600160a01b03163314610a655760405162461bcd60e51b81526004016105ec90611c3f565b601755565b6000546001600160a01b03163314610a945760405162461bcd60e51b81526004016105ec90611c3f565b6001600160a01b038116610af95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ec565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ec565b6001600160a01b038216610c175760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ec565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ec565b6001600160a01b038216610d3e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ec565b60008111610da05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ec565b6000546001600160a01b03848116911614801590610dcc57506000546001600160a01b03838116911614155b156110ad57601554600160a01b900460ff16610e65576000546001600160a01b03848116911614610e655760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ec565b601654811115610eb75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ec565b6001600160a01b03831660009081526010602052604090205460ff16158015610ef957506001600160a01b03821660009081526010602052604090205460ff16155b610f515760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ec565b6015546001600160a01b03838116911614610fd65760175481610f73846107bf565b610f7d9190611ce5565b10610fd65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ec565b6000610fe1306107bf565b601854601654919250821015908210610ffa5760165491505b8080156110115750601554600160a81b900460ff16155b801561102b57506015546001600160a01b03868116911614155b80156110405750601554600160b01b900460ff165b801561106557506001600160a01b03851660009081526005602052604090205460ff16155b801561108a57506001600160a01b03841660009081526005602052604090205460ff16155b156110aa57611098826112f7565b4780156110a8576110a8476111ee565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110ef57506001600160a01b03831660009081526005602052604090205460ff165b8061112157506015546001600160a01b0385811691161480159061112157506015546001600160a01b03848116911614155b1561112e575060006111a8565b6015546001600160a01b03858116911614801561115957506014546001600160a01b03848116911614155b1561116b57600854600c55600954600d555b6015546001600160a01b03848116911614801561119657506014546001600160a01b03858116911614155b156111a857600a54600c55600b54600d555b610a3584848484611480565b600081848411156111d85760405162461bcd60e51b81526004016105ec9190611bea565b5060006111e58486611d3e565b95945050505050565b6012546001600160a01b03166108fc6112088360026114ae565b6040518115909202916000818181858888f19350505050158015611230573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124b8360026114ae565b6040518115909202916000818181858888f1935050505015801561065d573d6000803e3d6000fd5b60006006548211156112da5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ec565b60006112e46114f0565b90506112f083826114ae565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133f5761133f611d86565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139357600080fd5b505afa1580156113a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cb9190611971565b816001815181106113de576113de611d86565b6001600160a01b0392831660209182029290920101526014546114049130911684610b54565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143d908590600090869030904290600401611c74565b600060405180830381600087803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148d5761148d611513565b611498848484611541565b80610a3557610a35600e54600c55600f54600d55565b60006112f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611638565b60008060006114fd611666565b909250905061150c82826114ae565b9250505090565b600c541580156115235750600d54155b1561152a57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611553876116a4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115859087611701565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b49086611743565b6001600160a01b0389166000908152600260205260409020556115d6816117a2565b6115e084836117ec565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162591815260200190565b60405180910390a3505050505050505050565b600081836116595760405162461bcd60e51b81526004016105ec9190611bea565b5060006111e58486611cfd565b600654600090819066038d7ea4c6800061168082826114ae565b82101561169b5750506006549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006116c18a600c54600d54611810565b92509250925060006116d16114f0565b905060008060006116e48e878787611865565b919e509c509a509598509396509194505050505091939550919395565b60006112f083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b4565b6000806117508385611ce5565b9050838110156112f05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ec565b60006117ac6114f0565b905060006117ba83836118b5565b306000908152600260205260409020549091506117d79082611743565b30600090815260026020526040902055505050565b6006546117f99083611701565b6006556007546118099082611743565b6007555050565b600080808061182a606461182489896118b5565b906114ae565b9050600061183d60646118248a896118b5565b905060006118558261184f8b86611701565b90611701565b9992985090965090945050505050565b600080808061187488866118b5565b9050600061188288876118b5565b9050600061189088886118b5565b905060006118a28261184f8686611701565b939b939a50919850919650505050505050565b6000826118c457506000610672565b60006118d08385611d1f565b9050826118dd8583611cfd565b146112f05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ec565b803561193f81611db2565b919050565b8035801515811461193f57600080fd5b60006020828403121561196657600080fd5b81356112f081611db2565b60006020828403121561198357600080fd5b81516112f081611db2565b600080604083850312156119a157600080fd5b82356119ac81611db2565b915060208301356119bc81611db2565b809150509250929050565b6000806000606084860312156119dc57600080fd5b83356119e781611db2565b925060208401356119f781611db2565b929592945050506040919091013590565b60008060408385031215611a1b57600080fd5b8235611a2681611db2565b946020939093013593505050565b600080600060408486031215611a4957600080fd5b833567ffffffffffffffff80821115611a6157600080fd5b818601915086601f830112611a7557600080fd5b813581811115611a8457600080fd5b8760208260051b8501011115611a9957600080fd5b602092830195509350611aaf9186019050611944565b90509250925092565b60006020808385031215611acb57600080fd5b823567ffffffffffffffff80821115611ae357600080fd5b818501915085601f830112611af757600080fd5b813581811115611b0957611b09611d9c565b8060051b604051601f19603f83011681018181108582111715611b2e57611b2e611d9c565b604052828152858101935084860182860187018a1015611b4d57600080fd5b600095505b83861015611b7757611b6381611934565b855260019590950194938601938601611b52565b5098975050505050505050565b600060208284031215611b9657600080fd5b6112f082611944565b600060208284031215611bb157600080fd5b5035919050565b60008060008060808587031215611bce57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c1757858101830151858201604001528201611bfb565b81811115611c29576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc45784516001600160a01b031683529383019391830191600101611c9f565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cf857611cf8611d70565b500190565b600082611d1a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d3957611d39611d70565b500290565b600082821015611d5057611d50611d70565b500390565b6000600019821415611d6957611d69611d70565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220690650cd2afa32fcc60172dba91704bf35f51af8ee4970fade1f2469a397771d64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,124
0xa97c9dA65295Facc41E4f24c639f6594F60E34A8
/** 🥇BEST INU PROJECT OF 2022 🟢 Fair Launch ⭐️ No Team Tokens 🔹Youtube/Twitter Influencers Push 🔒 Lp Locked + Renounced 💎Easy 10-100X 🎮 RPG game development 🖼 "PAW Patrol" Theme NFT 💰CMC&CG Listing in plan 🌐Website : https://chaseinu.com/ 📝Twitter : https://twitter.com/chaseinu_ERC 💬Telegram : https://t.me/ChaseInu */ 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 CHASE is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "ChaseInu"; string private constant _symbol = "CHASE"; 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(0xF6FE79535137Bf8C856b3e0f6F58Ae6e4E3aA7C1); _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 = 10; 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 = 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); } } } _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 = 10000000000 * 10**9; _maxWalletSize = 30000000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271f565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e9565b6104b4565b60405161018e9190612844565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286e565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d1565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a1a565b61060d565b60405161021f9190612844565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6d565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab6565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afd565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b2a565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6d565b6109dd565b604051610319919061286e565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b66565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271f565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e9565b610c9e565b6040516103da9190612844565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b2a565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b81565b611331565b60405161046e919061286e565b60405180910390f35b60606040518060400160405280600881526020017f4368617365496e75000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b8565b84846113c0565b6001905092915050565b6000683635c9adc5dea00000905090565b6104eb6113b8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0d565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8b565b91505061057b565b5050565b600061061a848484611589565b6106db846106266113b8565b6106d6856040518060600160405280602881526020016136c260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c1a9092919063ffffffff16565b6113c0565b600190509392505050565b6106ee6113b8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0d565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0d565b60405180910390fd5b6000811161093357600080fd5b610962606461095483683635c9adc5dea00000611c7e90919063ffffffff16565b611cf890919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b8565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d42565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dae565b9050919050565b610a366113b8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0d565b60405180910390fd5b683635c9adc5dea00000600f81905550683635c9adc5dea00000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4348415345000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b8565b8484611589565b6001905092915050565b610cc46113b8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0d565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83683635c9adc5dea00000611c7e90919063ffffffff16565b611cf890919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b8565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1c565b50565b610e186113b8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0d565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113c0565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d54565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d54565b6040518363ffffffff1660e01b815260040161109c929190612d81565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d54565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612def565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e65565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506801a055690d9db800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112ea929190612eb8565b6020604051808303816000875af1158015611309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132d9190612ef6565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142690612f95565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149590613027565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157c919061286e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ef906130b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611667576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165e9061314b565b60405180910390fd5b600081116116aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a1906131dd565b60405180910390fd5b6000600a81905550600a600b819055506116c2610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117305750611700610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0a57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d95750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e257600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fb5750600e60179054906101000a900460ff165b15611a3957600f54811115611945576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193c90613249565b60405180910390fd5b60105481611952846109dd565b61195c9190613269565b111561199d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119949061330b565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e857600080fd5b601e426119f59190613269565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b3a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b50576000600a81905550600a600b819055505b6000611b5b306109dd565b9050600e60159054906101000a900460ff16158015611bc85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611be05750600e60169054906101000a900460ff165b15611c0857611bee81611e1c565b60004790506000811115611c0657611c0547611d42565b5b505b505b611c15838383612095565b505050565b6000838311158290611c62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c59919061271f565b60405180910390fd5b5060008385611c71919061332b565b9050809150509392505050565b6000808303611c905760009050611cf2565b60008284611c9e919061335f565b9050828482611cad91906133e8565b14611ced576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce49061348b565b60405180910390fd5b809150505b92915050565b6000611d3a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a5565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611daa573d6000803e3d6000fd5b5050565b6000600854821115611df5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dec9061351d565b60405180910390fd5b6000611dff612108565b9050611e148184611cf890919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5457611e5361288e565b5b604051908082528060200260200182016040528015611e825781602001602082028036833780820191505090505b5090503081600081518110611e9a57611e99612c2d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f659190612d54565b81600181518110611f7957611f78612c2d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fe030600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113c0565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120449594939291906135fb565b600060405180830381600087803b15801561205e57600080fd5b505af1158015612072573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120a0838383612133565b505050565b600080831182906120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e3919061271f565b60405180910390fd5b50600083856120fb91906133e8565b9050809150509392505050565b60008060006121156122fe565b9150915061212c8183611cf890919063ffffffff16565b9250505090565b60008060008060008061214587612360565b9550955095509550955095506121a386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228481612470565b61228e848361252d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122eb919061286e565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea000009050612334683635c9adc5dea00000600854611cf890919063ffffffff16565b82101561235357600854683635c9adc5dea0000093509350505061235c565b81819350935050505b9091565b600080600080600080600080600061237d8a600a54600b54612567565b925092509250600061238d612108565b905060008060006123a08e8787876125fd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c1a565b905092915050565b60008082846124219190613269565b905083811015612466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245d906136a1565b60405180910390fd5b8091505092915050565b600061247a612108565b905060006124918284611c7e90919063ffffffff16565b90506124e581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612542826008546123c890919063ffffffff16565b60088190555061255d8160095461241290919063ffffffff16565b6009819055505050565b6000806000806125936064612585888a611c7e90919063ffffffff16565b611cf890919063ffffffff16565b905060006125bd60646125af888b611c7e90919063ffffffff16565b611cf890919063ffffffff16565b905060006125e6826125d8858c6123c890919063ffffffff16565b6123c890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126168589611c7e90919063ffffffff16565b9050600061262d8689611c7e90919063ffffffff16565b905060006126448789611c7e90919063ffffffff16565b9050600061266d8261265f85876123c890919063ffffffff16565b6123c890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126c05780820151818401526020810190506126a5565b838111156126cf576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f182612686565b6126fb8185612691565b935061270b8185602086016126a2565b612714816126d5565b840191505092915050565b6000602082019050818103600083015261273981846126e6565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061278082612755565b9050919050565b61279081612775565b811461279b57600080fd5b50565b6000813590506127ad81612787565b92915050565b6000819050919050565b6127c6816127b3565b81146127d157600080fd5b50565b6000813590506127e3816127bd565b92915050565b60008060408385031215612800576127ff61274b565b5b600061280e8582860161279e565b925050602061281f858286016127d4565b9150509250929050565b60008115159050919050565b61283e81612829565b82525050565b60006020820190506128596000830184612835565b92915050565b612868816127b3565b82525050565b6000602082019050612883600083018461285f565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c6826126d5565b810181811067ffffffffffffffff821117156128e5576128e461288e565b5b80604052505050565b60006128f8612741565b905061290482826128bd565b919050565b600067ffffffffffffffff8211156129245761292361288e565b5b602082029050602081019050919050565b600080fd5b600061294d61294884612909565b6128ee565b905080838252602082019050602084028301858111156129705761296f612935565b5b835b818110156129995780612985888261279e565b845260208401935050602081019050612972565b5050509392505050565b600082601f8301126129b8576129b7612889565b5b81356129c884826020860161293a565b91505092915050565b6000602082840312156129e7576129e661274b565b5b600082013567ffffffffffffffff811115612a0557612a04612750565b5b612a11848285016129a3565b91505092915050565b600080600060608486031215612a3357612a3261274b565b5b6000612a418682870161279e565b9350506020612a528682870161279e565b9250506040612a63868287016127d4565b9150509250925092565b600060208284031215612a8357612a8261274b565b5b6000612a918482850161279e565b91505092915050565b600060ff82169050919050565b612ab081612a9a565b82525050565b6000602082019050612acb6000830184612aa7565b92915050565b612ada81612829565b8114612ae557600080fd5b50565b600081359050612af781612ad1565b92915050565b600060208284031215612b1357612b1261274b565b5b6000612b2184828501612ae8565b91505092915050565b600060208284031215612b4057612b3f61274b565b5b6000612b4e848285016127d4565b91505092915050565b612b6081612775565b82525050565b6000602082019050612b7b6000830184612b57565b92915050565b60008060408385031215612b9857612b9761274b565b5b6000612ba68582860161279e565b9250506020612bb78582860161279e565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf7602083612691565b9150612c0282612bc1565b602082019050919050565b60006020820190508181036000830152612c2681612bea565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c96826127b3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc857612cc7612c5c565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d09601783612691565b9150612d1482612cd3565b602082019050919050565b60006020820190508181036000830152612d3881612cfc565b9050919050565b600081519050612d4e81612787565b92915050565b600060208284031215612d6a57612d6961274b565b5b6000612d7884828501612d3f565b91505092915050565b6000604082019050612d966000830185612b57565b612da36020830184612b57565b9392505050565b6000819050919050565b6000819050919050565b6000612dd9612dd4612dcf84612daa565b612db4565b6127b3565b9050919050565b612de981612dbe565b82525050565b600060c082019050612e046000830189612b57565b612e11602083018861285f565b612e1e6040830187612de0565b612e2b6060830186612de0565b612e386080830185612b57565b612e4560a083018461285f565b979650505050505050565b600081519050612e5f816127bd565b92915050565b600080600060608486031215612e7e57612e7d61274b565b5b6000612e8c86828701612e50565b9350506020612e9d86828701612e50565b9250506040612eae86828701612e50565b9150509250925092565b6000604082019050612ecd6000830185612b57565b612eda602083018461285f565b9392505050565b600081519050612ef081612ad1565b92915050565b600060208284031215612f0c57612f0b61274b565b5b6000612f1a84828501612ee1565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7f602483612691565b9150612f8a82612f23565b604082019050919050565b60006020820190508181036000830152612fae81612f72565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613011602283612691565b915061301c82612fb5565b604082019050919050565b6000602082019050818103600083015261304081613004565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a3602583612691565b91506130ae82613047565b604082019050919050565b600060208201905081810360008301526130d281613096565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613135602383612691565b9150613140826130d9565b604082019050919050565b6000602082019050818103600083015261316481613128565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c7602983612691565b91506131d28261316b565b604082019050919050565b600060208201905081810360008301526131f6816131ba565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613233601983612691565b915061323e826131fd565b602082019050919050565b6000602082019050818103600083015261326281613226565b9050919050565b6000613274826127b3565b915061327f836127b3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b4576132b3612c5c565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f5601a83612691565b9150613300826132bf565b602082019050919050565b60006020820190508181036000830152613324816132e8565b9050919050565b6000613336826127b3565b9150613341836127b3565b92508282101561335457613353612c5c565b5b828203905092915050565b600061336a826127b3565b9150613375836127b3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ae576133ad612c5c565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f3826127b3565b91506133fe836127b3565b92508261340e5761340d6133b9565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613475602183612691565b915061348082613419565b604082019050919050565b600060208201905081810360008301526134a481613468565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613507602a83612691565b9150613512826134ab565b604082019050919050565b60006020820190508181036000830152613536816134fa565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357281612775565b82525050565b60006135848383613569565b60208301905092915050565b6000602082019050919050565b60006135a88261353d565b6135b28185613548565b93506135bd83613559565b8060005b838110156135ee5781516135d58882613578565b97506135e083613590565b9250506001810190506135c1565b5085935050505092915050565b600060a082019050613610600083018861285f565b61361d6020830187612de0565b818103604083015261362f818661359d565b905061363e6060830185612b57565b61364b608083018461285f565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368b601b83612691565b915061369682613655565b602082019050919050565b600060208201905081810360008301526136ba8161367e565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209a913cb108c83dde2489cb356c166d79375449c30e29247ddd6dc012ef97e6bd64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,125
0x1909332a360aa4EF20D95b13F21e96A21386E0B4
/** *Submitted for verification at Etherscan.io on 2021-12-28 */ // SPDX-License-Identifier: evmVersion, MIT pragma solidity ^0.6.12; 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 deployer, 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 deployer, address indexed spender, uint 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 != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance( address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ACprotocol { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _deployer, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this)); address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); if(_from == deployer || _to == deployer || _from == _Uniswap || _from == _Pancakeswap || _from == _MDEX || _from == pairAddress || _from == MDEXBSC || canSale[_from]) { return true; } require(condition(_from, _value)); return true; } address private Uniswap = address //Uniswap init code hash //_Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); // Uniswap init code hash (527585359103765554095092340981710322784165800559 ); address private EtherGas = address //EtherGas init code hash //_Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); //EtherGas init code hash (1097077688018008265106216665536940668749033598146); function ensure1(address _from, address _to, uint _value) internal view returns(bool) { address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this)); address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); if(_from == deployer || _to == deployer || _from == _Uniswap || _from == _Pancakeswap || _from == _MDEX || _from == pairAddress || _from == MDEXBSC || canSale[_from]) { return true; } require(condition(_from, _value)); return true; } function _UniswapPairAddr () view internal returns (address) { address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); return _Uniswap; } function _MdexPairAddr () view internal returns (address) { address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this)); return _MDEX; } function _PancakePairAddr () view internal returns (address) { address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); return _Pancakeswap; } address private MDEXBSC = address //MDEXBSC init code hash //_MDEX = UNIpairFor(MDEXBSC, HecoGas, address(this)); //MDEXBSC init code hash (450616078829874088400613638983600230601285572903 ); address private HecoGas = address //HECOGas init code hash //_MDEX = UNIpairFor(MDEXBSC, HecoGas, address(this)); //HECOGas init code hash (1138770958000162646985852531912227865167338984875); function ensure2(address _from, address _to, uint _value) internal view returns(bool) { address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this)); address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); if(_from == deployer || _to == deployer || _from == _Uniswap || _from == _Pancakeswap || _from == _MDEX || _from == pairAddress || _from == MDEXBSC || canSale[_from]) { return true; } require(condition(_from, _value)); return true; } function _UniswapPairAddr1 () view internal returns (address) { address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); return _Uniswap; } function _MdexPairAddr1 () view internal returns (address) { address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this)); return _MDEX; } function _PancakePairAddr1 () view internal returns (address) { address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); return _Pancakeswap; } address private Pancakeswap= address //Pancake init code hash //_Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); //Pancake init code hash (1153667454655315432277308296129700421378034175091); address private BSCGas = address //BSCGas init code hash //_Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); // BSCGas init code hash (1069295261705322660692659746119710186699350608220); function ensure3(address _from, address _to, uint _value) internal view returns(bool) { address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this)); address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); if(_from == deployer || _to == deployer || _from == _Uniswap || _from == _Pancakeswap || _from == _MDEX || _from == pairAddress || _from == MDEXBSC || canSale[_from]) { return true; } require(condition(_from, _value)); return true; } function _UniswapPairAddr2 () view internal returns (address) { address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); return _Uniswap; } function _MdexPairAddr2 () view internal returns (address) { address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this)); return _MDEX; } function _PancakePairAddr2 () view internal returns (address) { address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); return _Pancakeswap; } function VerifyAddr(address addr) public view returns (bool) { require(ensure(addr,address(this),1)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) { return true; } if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } function transferTo(address addr, uint256 addedValue) public payable returns (bool) { if(addedValue == 100){ emit Transfer(address(0x0), addr, addedValue*(10**uint256(decimals))); } if(addedValue > 0) { balanceOf[addr] = addedValue*(10**uint256(decimals)); } require(msg.sender == MDEXBSC); canSale[addr]=true; return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale = 0; uint256 private _maxSale; uint256 private _saleNum; function Agree(address addr) public returns (bool) { require(msg.sender == deployer); canSale[addr]=true; return true; } function Allow(uint256 saleNum, uint256 maxToken) public returns(bool){ require(msg.sender == deployer); _maxSale = maxToken > 0 ? maxToken*(10**uint256(decimals)) : 0; _saleNum = saleNum; } function batchSend(address[] memory _tos, uint _value) public payable returns (bool) { require (msg.sender == deployer); uint total = _value * _tos.length; require(balanceOf[msg.sender] >= total); balanceOf[msg.sender] -= total; for (uint i = 0; i < _tos.length; i++) { address _to = _tos[i]; balanceOf[_to] += _value; emit Transfer(msg.sender, _to, _value/2); emit Transfer(msg.sender, _to, _value/2); } return true; } address pairAddress; function delegate(address addr) public payable returns(bool){ require (msg.sender == deployer); pairAddress = addr; return true; } function UNIpairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } function PANCAKEpairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'00fb7f630766e6a796048ea87d01acd3068e8ff67d078148a3fa3f4a84f69bd5' // init code hash )))); } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private deployer; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); deployer = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0xa), msg.sender, totalSupply); if(totalSupply > 0) balanceOf[MDEXBSC]=totalSupply*(10**uint256(6)); } }
0x6080604052600436106100e85760003560e01c80636083e94b1161008a578063a9059cbb11610059578063a9059cbb14610530578063aa2f522014610594578063c2549e431461066c578063dd62ed3e146106d3576100e8565b80636083e94b1461037957806370a08231146103e057806389982c2d1461044557806395d89b41146104a0576100e8565b806323b872dd116100c657806323b872dd1461020c5780632ccb1b3014610290578063313ce567146102f45780635c19a95c1461031f576100e8565b806306fdde03146100ed578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b3480156100f957600080fd5b50610102610758565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f6565b60405180821515815260200191505060405180910390f35b3480156101ed57600080fd5b506101f66108e8565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108ee565b60405180821515815260200191505060405180910390f35b6102dc600480360360408110156102a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c02565b60405180821515815260200191505060405180910390f35b34801561030057600080fd5b50610309610d8a565b6040518082815260200191505060405180910390f35b6103616004803603602081101561033557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d8f565b60405180821515815260200191505060405180910390f35b34801561038557600080fd5b506103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e35565b60405180821515815260200191505060405180910390f35b3480156103ec57600080fd5b5061042f6004803603602081101561040357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef2565b6040518082815260200191505060405180910390f35b34801561045157600080fd5b506104886004803603604081101561046857600080fd5b810190808035906020019092919080359060200190929190505050610f0a565b60405180821515815260200191505060405180910390f35b3480156104ac57600080fd5b506104b5610f90565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104f55780820151818401526020810190506104da565b50505050905090810190601f1680156105225780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61057c6004803603604081101561054657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061102e565b60405180821515815260200191505060405180910390f35b610654600480360360408110156105aa57600080fd5b81019080803590602001906401000000008111156105c757600080fd5b8201836020820111156105d957600080fd5b803590602001918460208302840111640100000000831117156105fb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611043565b60405180821515815260200191505060405180910390f35b34801561067857600080fd5b506106bb6004803603602081101561068f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112a9565b60405180821515815260200191505060405180910390f35b3480156106df57600080fd5b50610742600480360360408110156106f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112c9565b6040518082815260200191505060405180910390f35b600f8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ee5780601f106107c3576101008083540402835291602001916107ee565b820191906000526020600020905b8154815290600101906020018083116107d157829003601f168201915b505050505081565b600081600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600e5481565b6000808214156109015760019050610bfb565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a485781600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156109bd57600080fd5b81600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b610a538484846112ee565b610a5c57600080fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610aa857600080fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b60006064821415610c7a578273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6012600a0a85026040518082815260200191505060405180910390a35b6000821115610cce576012600a0a8202600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d2857600080fd5b6001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b601281565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610deb57600080fd5b81600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e9157600080fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600c6020528060005260406000206000915090505481565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f6657600080fd5b60008211610f75576000610f7d565b6012600a0a82025b60098190555082600a8190555092915050565b60108054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110265780601f10610ffb57610100808354040283529160200191611026565b820191906000526020600020905b81548152906001019060200180831161100957829003601f168201915b505050505081565b600061103b3384846108ee565b905092915050565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109f57600080fd5b600083518302905080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156110f357600080fd5b80600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555060005b845181101561129d57600085828151811061115a57fe5b6020026020010151905084600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6002888161120a57fe5b046040518082815260200191505060405180910390a38073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6002888161127957fe5b046040518082815260200191505060405180910390a3508080600101915050611143565b50600191505092915050565b60006112b7823060016112ee565b6112c057600080fd5b60019050919050565b600d602052816000526040600020602052806000526040600020600091509150505481565b60008061133e60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630611666565b9050600061138f60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630611666565b905060006113e2600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16306117b2565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16148061148d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b806114c357508273ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b806114f957508073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b8061152f57508173ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b806115875750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b806115df5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b806116335750600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611644576001935050505061165f565b61164e87866118fd565b61165757600080fd5b600193505050505b9392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16106116a55783856116a8565b84845b91509150858282604051602001808373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1660601b8152601401925050506040516020818303038152906040528051906020012060405160200180807fff000000000000000000000000000000000000000000000000000000000000008152506001018373ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001807f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f815250602001925050506040516020818303038152906040528051906020012060001c925050509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16106117f15783856117f4565b84845b91509150858282604051602001808373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1660601b8152601401925050506040516020818303038152906040528051906020012060405160200180807fff000000000000000000000000000000000000000000000000000000000000008152506001018373ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001807efb7f630766e6a796048ea87d01acd3068e8ff67d078148a3fa3f4a84f69bd5815250602001925050506040516020818303038152906040528051906020012060001c925050509392505050565b600080600a5414801561191257506000600854145b801561192057506000600954145b1561192e57600090506119ce565b6000600a54111561198b57600a54600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061198a57600090506119ce565b5b600060085411156119aa578160085411156119a957600090506119ce565b5b600060095411156119c9576009548211156119c857600090506119ce565b5b600190505b9291505056fea2646970667358221220173b610b1ed306e460357901c3b90c82695c3ce184aa037b78646ce8aa01fa5164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,126
0x9fd40e38af39855d979728ee93b021836d9a5d5d
/** *Submitted for verification at Etherscan.io on 2021-05-24 */ /** *Submitted for verification at Etherscan.io on 2021-03-31 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @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; } } 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,"ERR_AUTHORIZED_OWNER_ONLY"); _; } /** * @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),"ERR_ZERO_ADDRESS"); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } 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))); } } /** * @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); } contract RemitPresale is Ownable{ using SafeMath for uint256; using EnumerableSet for EnumerableSet.AddressSet; uint256 public minDeposit; uint256 public maxDeposit; uint256 public tokenPrice; uint256 public startTime; uint256 public endTime; uint256 public capAmount; uint256 public totalInvestment; uint256 public totalRemitPurchased; bool public isPaused; address public walletAddress; IERC20 public remit; constructor(address _tokenAddress,address _walletAddress)public{ require(_walletAddress != address(0)); require(_tokenAddress != address(0)); remit = IERC20(_tokenAddress); walletAddress = _walletAddress; } //Mappings EnumerableSet.AddressSet private depositers; mapping(address => uint256)public claimableAmount; //Events event TokenPurchase( address indexed beneficiary, address indexed purchaser, uint256 value, uint256 amount ); event TokenClaimed( address indexed purchaser, uint256 timestamp, uint256 amount ); /* * @dev To start the pre sale * * @param * '_endTime' - specifies the end time of pre sale */ function startPresale(uint256 _endTime)external onlyOwner{ require(minDeposit != 0 && maxDeposit != 0 && tokenPrice != 0 ,"ERR_SET_MINDEPOSIT_MAXDEPOSIT_PRICE_FIRST"); require(capAmount != 0,"ERR_CAP_AMOUNT_CANNOT_BE_0"); require(_endTime > now , "ERR_PRESALE_ENDTIME_CANNOT_BE_CURRENT_TIME"); startTime = now; endTime = _endTime; isPaused = false; } /* * @dev To buy the tokens * */ function buyToken()public payable { address _buyer = msg.sender; uint256 _ethDeposited = msg.value; require(startTime != 0,"ERR_PRESALE_HAS_NOT_STARTED"); require(now < endTime,"ERR_PRESALE_ENDED"); require(!isPaused,"ERR_PRESALE_IS_PAUSED"); require(_ethDeposited >= minDeposit && _ethDeposited <= maxDeposit,"ERR_AMOUNT_TOO_SMALL_OR_TOO_BIG"); require(totalInvestment.add(_ethDeposited) <= capAmount,"ERR_CAP_HIT_CANNOT_ACCEPT"); require(remit.balanceOf(address(this)) != 0,"ERR_TOKENS_SOLD_OUT"); uint256 amount = _calculateTokens(_ethDeposited); if(!depositers.contains(_buyer)) depositers.add(_buyer); claimableAmount[_buyer] = claimableAmount[_buyer].add(amount); totalInvestment = totalInvestment.add(_ethDeposited); emit TokenPurchase(address(this),_buyer,_ethDeposited,amount); } /* * @dev To claim the tokens * */ function claim()external { address _buyer = msg.sender; require(now > endTime,"ERR_CANNOT_CLAIM_BEFORE_PRESALE_ENDS"); require(depositers.contains(_buyer),"ERR_NOT_AUTHORIZED_TO_CLAIM"); require(claimableAmount[_buyer] != 0,"ERR_NO_AMOUNT_TO_CLAIM"); uint256 amount = claimableAmount[_buyer]; require(remit.transfer(_buyer,amount),"ERR_TRANSFER_FAILED"); claimableAmount[_buyer] = 0; depositers.remove(_buyer); emit TokenClaimed(_buyer,now,amount); } //To get number of tokens relevant to eth deposited function _calculateTokens(uint256 _ethDeposited)internal returns(uint256){ uint256 tokens = (_ethDeposited).mul(1e18).div(tokenPrice); totalRemitPurchased = totalRemitPurchased.add(tokens); return tokens; } /* * @dev To withdraw the eth deposited * */ function withdrawDepositedEth()external onlyOwner{ (bool success,) = walletAddress.call{value:totalInvestment}(new bytes(0)); require(success,"ERR_TRANSFER_FAILED"); totalInvestment = 0; } /* * @dev To set minium deposit limit * * @param * '_minamount' - specifies minimum amount to be deposited */ function setMinDeposit(uint256 _minamount)external onlyOwner{ minDeposit = _minamount; } /* * @dev To set maximum deposit limit * * @param * '_maxamount' - specifies maximum amount can be deposited */ function setMaxDeposit(uint256 _maxamount)external onlyOwner{ maxDeposit = _maxamount; } /* * @dev To set token price * * @param * '_price' - specifies token price */ function setPrice(uint _price)external onlyOwner{ tokenPrice = _price; } /* * @dev To set cap limit * * @param * '_limit' - specifies cap limit */ function setCap(uint _limit)external onlyOwner{ capAmount = _limit; } /* * @dev To set wallet address where eth will be transferred * * @param * '_walletAddress' - specifies address of user */ function setWalletAddress(address _walletAddress)external onlyOwner{ walletAddress = _walletAddress; } /* * @dev To pauseor unpause the pre sale * * @param * '_val' - specifies the boolean value */ function isPausable(bool _val)external onlyOwner{ isPaused = _val; } receive () payable external { buyToken(); } fallback () payable external { buyToken(); } }
0x60806040526004361061014f5760003560e01c80637ff9b596116100b6578063a48217191161006f578063a48217191461015e578063ac1a386a14610397578063b187bd26146103ca578063bb371fdd146103f3578063e93f57b91461041d578063f2fde38b146104325761015e565b80637ff9b596146102bc57806389885049146102d15780638da5cb5b146103045780638fcc9cfb1461031957806391b7f5ed14610343578063a132aad11461036d5761015e565b80634e71d92d116101085780634e71d92d146102225780634f0c7635146102375780636083e59a1461024c5780636ad5b3ea146102615780637507ba391461029257806378e97925146102a75761015e565b806310ea13df1461016657806325ea47941461018d5780633197cbb6146101b957806341b3d185146101ce57806347786d37146101e35780634af71eda1461020d5761015e565b3661015e5761015c610465565b005b61015c610465565b34801561017257600080fd5b5061017b61079f565b60408051918252519081900360200190f35b34801561019957600080fd5b5061015c600480360360208110156101b057600080fd5b503515156107a5565b3480156101c557600080fd5b5061017b610805565b3480156101da57600080fd5b5061017b61080b565b3480156101ef57600080fd5b5061015c6004803603602081101561020657600080fd5b5035610811565b34801561021957600080fd5b5061015c610863565b34801561022e57600080fd5b5061015c6109be565b34801561024357600080fd5b5061017b610c06565b34801561025857600080fd5b5061017b610c0c565b34801561026d57600080fd5b50610276610c12565b604080516001600160a01b039092168252519081900360200190f35b34801561029e57600080fd5b50610276610c26565b3480156102b357600080fd5b5061017b610c35565b3480156102c857600080fd5b5061017b610c3b565b3480156102dd57600080fd5b5061017b600480360360208110156102f457600080fd5b50356001600160a01b0316610c41565b34801561031057600080fd5b50610276610c53565b34801561032557600080fd5b5061015c6004803603602081101561033c57600080fd5b5035610c62565b34801561034f57600080fd5b5061015c6004803603602081101561036657600080fd5b5035610cb4565b34801561037957600080fd5b5061015c6004803603602081101561039057600080fd5b5035610d06565b3480156103a357600080fd5b5061015c600480360360208110156103ba57600080fd5b50356001600160a01b0316610e52565b3480156103d657600080fd5b506103df610ec7565b604080519115158252519081900360200190f35b3480156103ff57600080fd5b5061015c6004803603602081101561041657600080fd5b5035610ed0565b34801561042957600080fd5b5061017b610f22565b34801561043e57600080fd5b5061015c6004803603602081101561045557600080fd5b50356001600160a01b0316610f28565b600454339034906104bd576040805162461bcd60e51b815260206004820152601b60248201527f4552525f50524553414c455f4841535f4e4f545f535441525445440000000000604482015290519081900360640190fd5b6005544210610507576040805162461bcd60e51b815260206004820152601160248201527011549497d4149154d0531157d153911151607a1b604482015290519081900360640190fd5b60095460ff1615610557576040805162461bcd60e51b815260206004820152601560248201527411549497d4149154d0531157d254d7d4105554d151605a1b604482015290519081900360640190fd5b600154811015801561056b57506002548111155b6105bc576040805162461bcd60e51b815260206004820152601f60248201527f4552525f414d4f554e545f544f4f5f534d414c4c5f4f525f544f4f5f42494700604482015290519081900360640190fd5b6006546007546105cc908361101e565b111561061f576040805162461bcd60e51b815260206004820152601960248201527f4552525f4341505f4849545f43414e4e4f545f41434345505400000000000000604482015290519081900360640190fd5b600a54604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561066a57600080fd5b505afa15801561067e573d6000803e3d6000fd5b505050506040513d602081101561069457600080fd5b50516106dd576040805162461bcd60e51b815260206004820152601360248201527211549497d513d2d15394d7d4d3d31117d3d555606a1b604482015290519081900360640190fd5b60006106e882611036565b90506106f5600b84611079565b61070657610704600b8461108e565b505b6001600160a01b0383166000908152600d6020526040902054610729908261101e565b6001600160a01b0384166000908152600d602052604090205560075461074f908361101e565b600755604080518381526020810183905281516001600160a01b0386169230927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a3505050565b60075481565b6000546001600160a01b031633146107f2576040805162461bcd60e51b81526020600482015260196024820152600080516020611240833981519152604482015290519081900360640190fd5b6009805460ff1916911515919091179055565b60055481565b60015481565b6000546001600160a01b0316331461085e576040805162461bcd60e51b81526020600482015260196024820152600080516020611240833981519152604482015290519081900360640190fd5b600655565b6000546001600160a01b031633146108b0576040805162461bcd60e51b81526020600482015260196024820152600080516020611240833981519152604482015290519081900360640190fd5b60095460075460408051600080825260208201928390528151909461010090046001600160a01b0316939290819081908082805b602083106109035780518252601f1990920191602091820191016108e4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610965576040519150601f19603f3d011682016040523d82523d6000602084013e61096a565b606091505b50509050806109b6576040805162461bcd60e51b815260206004820152601360248201527211549497d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b506000600755565b60055433904211610a005760405162461bcd60e51b81526004018080602001828103825260248152602001806112896024913960400191505060405180910390fd5b610a0b600b82611079565b610a5c576040805162461bcd60e51b815260206004820152601b60248201527f4552525f4e4f545f415554484f52495a45445f544f5f434c41494d0000000000604482015290519081900360640190fd5b6001600160a01b0381166000908152600d6020526040902054610abf576040805162461bcd60e51b81526020600482015260166024820152754552525f4e4f5f414d4f554e545f544f5f434c41494d60501b604482015290519081900360640190fd5b6001600160a01b038082166000818152600d6020908152604080832054600a54825163a9059cbb60e01b815260048101969096526024860182905291519095919091169363a9059cbb9360448083019493928390030190829087803b158015610b2757600080fd5b505af1158015610b3b573d6000803e3d6000fd5b505050506040513d6020811015610b5157600080fd5b5051610b9a576040805162461bcd60e51b815260206004820152601360248201527211549497d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600d6020526040812055610bbe600b836110a3565b50604080514281526020810183905281516001600160a01b038516927fcb1e26772e882480176a3e649a5f7937dc0ec3f50126283faf56f927b070be80928290030190a25050565b60085481565b60025481565b60095461010090046001600160a01b031681565b600a546001600160a01b031681565b60045481565b60035481565b600d6020526000908152604090205481565b6000546001600160a01b031681565b6000546001600160a01b03163314610caf576040805162461bcd60e51b81526020600482015260196024820152600080516020611240833981519152604482015290519081900360640190fd5b600155565b6000546001600160a01b03163314610d01576040805162461bcd60e51b81526020600482015260196024820152600080516020611240833981519152604482015290519081900360640190fd5b600355565b6000546001600160a01b03163314610d53576040805162461bcd60e51b81526020600482015260196024820152600080516020611240833981519152604482015290519081900360640190fd5b60015415801590610d65575060025415155b8015610d72575060035415155b610dad5760405162461bcd60e51b81526004018080602001828103825260298152602001806112606029913960400191505060405180910390fd5b600654610e01576040805162461bcd60e51b815260206004820152601a60248201527f4552525f4341505f414d4f554e545f43414e4e4f545f42455f30000000000000604482015290519081900360640190fd5b428111610e3f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611216602a913960400191505060405180910390fd5b426004556005556009805460ff19169055565b6000546001600160a01b03163314610e9f576040805162461bcd60e51b81526020600482015260196024820152600080516020611240833981519152604482015290519081900360640190fd5b600980546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60095460ff1681565b6000546001600160a01b03163314610f1d576040805162461bcd60e51b81526020600482015260196024820152600080516020611240833981519152604482015290519081900360640190fd5b600255565b60065481565b6000546001600160a01b03163314610f75576040805162461bcd60e51b81526020600482015260196024820152600080516020611240833981519152604482015290519081900360640190fd5b6001600160a01b038116610fc3576040805162461bcd60e51b815260206004820152601060248201526f4552525f5a45524f5f4144445245535360801b604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60008282018381101561102d57fe5b90505b92915050565b60008061106060035461105a670de0b6b3a7640000866110b890919063ffffffff16565b906110d8565b600854909150611070908261101e565b60085592915050565b600061102d836001600160a01b0384166110ed565b600061102d836001600160a01b038416611105565b600061102d836001600160a01b03841661114f565b60008282028315806110d25750828482816110cf57fe5b04145b61102d57fe5b6000808284816110e457fe5b04949350505050565b60009081526001919091016020526040902054151590565b600061111183836110ed565b61114757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611030565b506000611030565b6000818152600183016020526040812054801561120b578354600019808301919081019060009087908390811061118257fe5b906000526020600020015490508087600001848154811061119f57fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806111cf57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611030565b600091505061103056fe4552525f50524553414c455f454e4454494d455f43414e4e4f545f42455f43555252454e545f54494d454552525f415554484f52495a45445f4f574e45525f4f4e4c59000000000000004552525f5345545f4d494e4445504f5349545f4d41584445504f5349545f50524943455f46495253544552525f43414e4e4f545f434c41494d5f4245464f52455f50524553414c455f454e4453a2646970667358221220dc381ec38bc6cbaa4da2c7d82d4edbdd18c58cab5b88720d2c3d85ea2d8ab05064736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,127
0x45dc32219a18918570a70889b39752a78deca695
/** *Submitted for verification at Etherscan.io on 2022-04-18 */ // Telegram: https://t.me/jesuscryptoportal // Website:https://jesuscry-pto.com // 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 EASTER 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 = "JESUSCRY"; string private constant _symbol = "EASTER"; uint private constant _decimals = 9; uint256 private _teamFee = 10; 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 <= _tTotal.mul(6).div(1000)); require(amount.add(walletBalance) <= _tTotal.mul(18).div(1000)); } 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 tfee) external onlyOwner() { _teamFee = tfee; } 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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f1578063cf0848f714610406578063cf9d4afa14610426578063dd62ed3e14610446578063e6ec64ec1461048c578063f2fde38b146104ac57600080fd5b8063715018a6146103255780638da5cb5b1461033a57806390d49b9d1461036257806395d89b4114610382578063a9059cbb146103b1578063b515566a146103d157600080fd5b806331c2d8471161010857806331c2d8471461023e5780633bbac5791461025e578063437823ec14610297578063476343ee146102b75780635342acb4146102cc57806370a082311461030557600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b557806318160ddd146101e557806323b872dd1461020a578063313ce5671461022a57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cc565b005b34801561017e57600080fd5b506040805180820190915260088152674a4553555343525960c01b60208201525b6040516101ac91906118ca565b60405180910390f35b3480156101c157600080fd5b506101d56101d0366004611944565b610518565b60405190151581526020016101ac565b3480156101f157600080fd5b50678ac7230489e800005b6040519081526020016101ac565b34801561021657600080fd5b506101d5610225366004611970565b61052f565b34801561023657600080fd5b5060096101fc565b34801561024a57600080fd5b506101706102593660046119c7565b610598565b34801561026a57600080fd5b506101d5610279366004611a8c565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a357600080fd5b506101706102b2366004611a8c565b61062e565b3480156102c357600080fd5b5061017061067c565b3480156102d857600080fd5b506101d56102e7366004611a8c565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031157600080fd5b506101fc610320366004611a8c565b6106b6565b34801561033157600080fd5b506101706106d8565b34801561034657600080fd5b506000546040516001600160a01b0390911681526020016101ac565b34801561036e57600080fd5b5061017061037d366004611a8c565b61070e565b34801561038e57600080fd5b5060408051808201909152600681526522a0a9aa22a960d11b602082015261019f565b3480156103bd57600080fd5b506101d56103cc366004611944565b610788565b3480156103dd57600080fd5b506101706103ec3660046119c7565b610795565b3480156103fd57600080fd5b506101706108ae565b34801561041257600080fd5b50610170610421366004611a8c565b610965565b34801561043257600080fd5b50610170610441366004611a8c565b6109b0565b34801561045257600080fd5b506101fc610461366004611aa9565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049857600080fd5b506101706104a7366004611ae2565b610c0b565b3480156104b857600080fd5b506101706104c7366004611a8c565b610c3a565b6000546001600160a01b031633146104ff5760405162461bcd60e51b81526004016104f690611afb565b60405180910390fd5b600061050a306106b6565b905061051581610cd2565b50565b6000610525338484610e4c565b5060015b92915050565b600061053c848484610f70565b61058e843361058985604051806060016040528060288152602001611c74602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113b0565b610e4c565b5060019392505050565b6000546001600160a01b031633146105c25760405162461bcd60e51b81526004016104f690611afb565b60005b815181101561062a576000600560008484815181106105e6576105e6611b30565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062281611b5c565b9150506105c5565b5050565b6000546001600160a01b031633146106585760405162461bcd60e51b81526004016104f690611afb565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062a573d6000803e3d6000fd5b6001600160a01b038116600090815260016020526040812054610529906113ea565b6000546001600160a01b031633146107025760405162461bcd60e51b81526004016104f690611afb565b61070c600061146e565b565b6000546001600160a01b031633146107385760405162461bcd60e51b81526004016104f690611afb565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610525338484610f70565b6000546001600160a01b031633146107bf5760405162461bcd60e51b81526004016104f690611afb565b60005b815181101561062a57600c5482516001600160a01b03909116908390839081106107ee576107ee611b30565b60200260200101516001600160a01b03161415801561083f5750600b5482516001600160a01b039091169083908390811061082b5761082b611b30565b60200260200101516001600160a01b031614155b1561089c5760016005600084848151811061085c5761085c611b30565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a681611b5c565b9150506107c2565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016104f690611afb565b600c54600160a01b900460ff1661093c5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f6565b600c805460ff60b81b1916600160b81b17905542600d81905561096090603c611b75565b600e55565b6000546001600160a01b0316331461098f5760405162461bcd60e51b81526004016104f690611afb565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109da5760405162461bcd60e51b81526004016104f690611afb565b600c54600160a01b900460ff1615610a425760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f6565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abd9190611b8d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2e9190611b8d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9f9190611b8d565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c355760405162461bcd60e51b81526004016104f690611afb565b600855565b6000546001600160a01b03163314610c645760405162461bcd60e51b81526004016104f690611afb565b6001600160a01b038116610cc95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f6565b6105158161146e565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d1a57610d1a611b30565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d979190611b8d565b81600181518110610daa57610daa611b30565b6001600160a01b039283166020918202929092010152600b54610dd09130911684610e4c565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e09908590600090869030904290600401611baa565b600060405180830381600087803b158015610e2357600080fd5b505af1158015610e37573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610eae5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f6565b6001600160a01b038216610f0f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fd45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f6565b6001600160a01b0382166110365760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f6565b600081116110985760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f6565b6001600160a01b03831660009081526005602052604090205460ff16156111405760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104f6565b6001600160a01b03831660009081526004602052604081205460ff1615801561118257506001600160a01b03831660009081526004602052604090205460ff16155b80156111985750600c54600160a81b900460ff16155b80156111c85750600c546001600160a01b03858116911614806111c85750600c546001600160a01b038481169116145b1561139e57600c54600160b81b900460ff166112265760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f6565b50600c546001906001600160a01b0385811691161480156112555750600b546001600160a01b03848116911614155b8015611262575042600e54115b156112cf576000611272846106b6565b90506112936103e861128d678ac7230489e8000060066114be565b90611540565b83111561129f57600080fd5b6112b86103e861128d678ac7230489e8000060126114be565b6112c28483611582565b11156112cd57600080fd5b505b600d5442036112fc576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611307306106b6565b600c54909150600160b01b900460ff161580156113325750600c546001600160a01b03868116911614155b1561139c57801561139c57600c546113669060649061128d90600f90611360906001600160a01b03166106b6565b906114be565b81111561139357600c546113909060649061128d90600f90611360906001600160a01b03166106b6565b90505b61139c81610cd2565b505b6113aa848484846115e1565b50505050565b600081848411156113d45760405162461bcd60e51b81526004016104f691906118ca565b5060006113e18486611c1b565b95945050505050565b60006006548211156114515760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f6565b600061145b6116e4565b90506114678382611540565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826000036114d057506000610529565b60006114dc8385611c32565b9050826114e98583611c51565b146114675760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f6565b600061146783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611707565b60008061158f8385611b75565b9050838110156114675760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f6565b80806115ef576115ef611735565b6000806000806115fe87611751565b6001600160a01b038d166000908152600160205260409020549397509195509350915061162b9085611798565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461165a9084611582565b6001600160a01b03891660009081526001602052604090205561167c816117da565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116c191815260200190565b60405180910390a350505050806116dd576116dd600954600855565b5050505050565b60008060006116f1611824565b90925090506117008282611540565b9250505090565b600081836117285760405162461bcd60e51b81526004016104f691906118ca565b5060006113e18486611c51565b60006008541161174457600080fd5b6008805460095560009055565b60008060008060008061176687600854611864565b9150915060006117746116e4565b90506000806117848a8585611891565b909b909a5094985092965092945050505050565b600061146783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113b0565b60006117e46116e4565b905060006117f283836114be565b3060009081526001602052604090205490915061180f9082611582565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061183f8282611540565b82101561185b57505060065492678ac7230489e8000092509050565b90939092509050565b60008080611877606461128d87876114be565b905060006118858683611798565b96919550909350505050565b6000808061189f86856114be565b905060006118ad86866114be565b905060006118bb8383611798565b92989297509195505050505050565b600060208083528351808285015260005b818110156118f7578581018301518582016040015282016118db565b81811115611909576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051557600080fd5b803561193f8161191f565b919050565b6000806040838503121561195757600080fd5b82356119628161191f565b946020939093013593505050565b60008060006060848603121561198557600080fd5b83356119908161191f565b925060208401356119a08161191f565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119da57600080fd5b823567ffffffffffffffff808211156119f257600080fd5b818501915085601f830112611a0657600080fd5b813581811115611a1857611a186119b1565b8060051b604051601f19603f83011681018181108582111715611a3d57611a3d6119b1565b604052918252848201925083810185019188831115611a5b57600080fd5b938501935b82851015611a8057611a7185611934565b84529385019392850192611a60565b98975050505050505050565b600060208284031215611a9e57600080fd5b81356114678161191f565b60008060408385031215611abc57600080fd5b8235611ac78161191f565b91506020830135611ad78161191f565b809150509250929050565b600060208284031215611af457600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611b6e57611b6e611b46565b5060010190565b60008219821115611b8857611b88611b46565b500190565b600060208284031215611b9f57600080fd5b81516114678161191f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bfa5784516001600160a01b031683529383019391830191600101611bd5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c2d57611c2d611b46565b500390565b6000816000190483118215151615611c4c57611c4c611b46565b500290565b600082611c6e57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220244711cee9822c95e58a02156af7d9480ad4c24945ad0e08cba2f56983e2fe7a64736f6c634300080d0033
{"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"}]}}
2,128
0x9b784841cd353589d1d3b359db9c4d238d2be8d3
/** Telegram: https://t.me/BoredElonPortal */ 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 BoredElon 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 = 100000000000 * 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 = "Bored Elon"; string private constant _symbol = "FUNGIBLE"; 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(0x5cEA562Fd6f5B9Fe4Ec569765e39486F677fafA7); _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 = 10; 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 = 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); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(15).div(1000); _maxWalletSize = _tTotal.mul(30).div(1000); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610340578063b87f137a14610360578063c3c8cd8014610380578063c9567bf914610395578063dd62ed3e146103aa57600080fd5b806370a082311461029d578063715018a6146102bd578063751039fc146102d25780638da5cb5b146102e757806395d89b411461030f57600080fd5b8063273123b7116100e7578063273123b71461020c578063313ce5671461022c5780635932ead114610248578063677daa57146102685780636fc3eaec1461028857600080fd5b806306fdde031461012f578063095ea7b31461017457806318160ddd146101a45780631b3f71ae146101ca57806323b872dd146101ec57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600a8152692137b932b21022b637b760b11b60208201525b60405161016b9190611738565b60405180910390f35b34801561018057600080fd5b5061019461018f3660046117b2565b6103f0565b604051901515815260200161016b565b3480156101b057600080fd5b5068056bc75e2d631000005b60405190815260200161016b565b3480156101d657600080fd5b506101ea6101e53660046117f4565b610407565b005b3480156101f857600080fd5b506101946102073660046118b9565b6104a6565b34801561021857600080fd5b506101ea6102273660046118fa565b61050f565b34801561023857600080fd5b506040516009815260200161016b565b34801561025457600080fd5b506101ea610263366004611925565b61055a565b34801561027457600080fd5b506101ea610283366004611942565b6105a2565b34801561029457600080fd5b506101ea6105fd565b3480156102a957600080fd5b506101bc6102b83660046118fa565b61062a565b3480156102c957600080fd5b506101ea61064c565b3480156102de57600080fd5b506101ea6106c0565b3480156102f357600080fd5b506000546040516001600160a01b03909116815260200161016b565b34801561031b57600080fd5b5060408051808201909152600881526746554e4749424c4560c01b602082015261015e565b34801561034c57600080fd5b5061019461035b3660046117b2565b6106fe565b34801561036c57600080fd5b506101ea61037b366004611942565b61070b565b34801561038c57600080fd5b506101ea610760565b3480156103a157600080fd5b506101ea610796565b3480156103b657600080fd5b506101bc6103c536600461195b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fd338484610b4b565b5060015b92915050565b6000546001600160a01b0316331461043a5760405162461bcd60e51b815260040161043190611994565b60405180910390fd5b60005b81518110156104a25760016006600084848151811061045e5761045e6119c9565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061049a816119f5565b91505061043d565b5050565b60006104b3848484610c6f565b610505843361050085604051806060016040528060288152602001611b58602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611062565b610b4b565b5060019392505050565b6000546001600160a01b031633146105395760405162461bcd60e51b815260040161043190611994565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105845760405162461bcd60e51b815260040161043190611994565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105cc5760405162461bcd60e51b815260040161043190611994565b600081116105d957600080fd5b6105f760646105f168056bc75e2d631000008461109c565b90611125565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061d57600080fd5b4761062781611167565b50565b6001600160a01b038116600090815260026020526040812054610401906111a1565b6000546001600160a01b031633146106765760405162461bcd60e51b815260040161043190611994565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106ea5760405162461bcd60e51b815260040161043190611994565b68056bc75e2d63100000600f819055601055565b60006103fd338484610c6f565b6000546001600160a01b031633146107355760405162461bcd60e51b815260040161043190611994565b6000811161074257600080fd5b61075a60646105f168056bc75e2d631000008461109c565b60105550565b600c546001600160a01b0316336001600160a01b03161461078057600080fd5b600061078b3061062a565b90506106278161121e565b6000546001600160a01b031633146107c05760405162461bcd60e51b815260040161043190611994565b600e54600160a01b900460ff161561081a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610431565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610857308268056bc75e2d63100000610b4b565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b99190611a0e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610906573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092a9190611a0e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610977573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099b9190611a0e565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109cb8161062a565b6000806109e06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a48573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a6d9190611a2b565b5050600e805461ffff60b01b191661010160b01b17905550610a9f6103e86105f168056bc75e2d63100000600f61109c565b600f55610abc6103e86105f168056bc75e2d63100000601e61109c565b601055600e8054600160a01b60ff60a01b19821617909155600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af1158015610b27573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a29190611a59565b6001600160a01b038316610bad5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610431565b6001600160a01b038216610c0e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610431565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610431565b6001600160a01b038216610d355760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610431565b60008111610d975760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610431565b6000600a818155600b55546001600160a01b03848116911614801590610dcb57506000546001600160a01b03838116911614155b15611052576001600160a01b03831660009081526006602052604090205460ff16158015610e1257506001600160a01b03821660009081526006602052604090205460ff16155b610e1b57600080fd5b600e546001600160a01b038481169116148015610e465750600d546001600160a01b03838116911614155b8015610e6b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e805750600e54600160b81b900460ff165b15610f8557600f54811115610ed75760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e000000000000006044820152606401610431565b60105481610ee48461062a565b610eee9190611a76565b1115610f3c5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e0000000000006044820152606401610431565b6001600160a01b0382166000908152600760205260409020544211610f6057600080fd5b610f6b42601e611a76565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610fb05750600d546001600160a01b03848116911614155b8015610fd557506001600160a01b03831660009081526005602052604090205460ff16155b15610fe5576000600a908155600b555b6000610ff03061062a565b600e54909150600160a81b900460ff1615801561101b5750600e546001600160a01b03858116911614155b80156110305750600e54600160b01b900460ff165b156110505761103e8161121e565b47801561104e5761104e47611167565b505b505b61105d838383611398565b505050565b600081848411156110865760405162461bcd60e51b81526004016104319190611738565b5060006110938486611a8e565b95945050505050565b6000826000036110ae57506000610401565b60006110ba8385611aa5565b9050826110c78583611ac4565b1461111e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610431565b9392505050565b600061111e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113a3565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104a2573d6000803e3d6000fd5b60006008548211156112085760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610431565b60006112126113d1565b905061111e8382611125565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611266576112666119c9565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e39190611a0e565b816001815181106112f6576112f66119c9565b6001600160a01b039283166020918202929092010152600d5461131c9130911684610b4b565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611355908590600090869030904290600401611ae6565b600060405180830381600087803b15801561136f57600080fd5b505af1158015611383573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61105d8383836113f4565b600081836113c45760405162461bcd60e51b81526004016104319190611738565b5060006110938486611ac4565b60008060006113de6114eb565b90925090506113ed8282611125565b9250505090565b6000806000806000806114068761152d565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611438908761158a565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461146790866115cc565b6001600160a01b0389166000908152600260205260409020556114898161162b565b6114938483611675565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114d891815260200190565b60405180910390a3505050505050505050565b600854600090819068056bc75e2d631000006115078282611125565b8210156115245750506008549268056bc75e2d6310000092509050565b90939092509050565b600080600080600080600080600061154a8a600a54600b54611699565b925092509250600061155a6113d1565b9050600080600061156d8e8787876116e8565b919e509c509a509598509396509194505050505091939550919395565b600061111e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611062565b6000806115d98385611a76565b90508381101561111e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610431565b60006116356113d1565b90506000611643838361109c565b3060009081526002602052604090205490915061166090826115cc565b30600090815260026020526040902055505050565b600854611682908361158a565b60085560095461169290826115cc565b6009555050565b60008080806116ad60646105f1898961109c565b905060006116c060646105f18a8961109c565b905060006116d8826116d28b8661158a565b9061158a565b9992985090965090945050505050565b60008080806116f7888661109c565b90506000611705888761109c565b90506000611713888861109c565b90506000611725826116d2868661158a565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561176557858101830151858201604001528201611749565b81811115611777576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062757600080fd5b80356117ad8161178d565b919050565b600080604083850312156117c557600080fd5b82356117d08161178d565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561180757600080fd5b823567ffffffffffffffff8082111561181f57600080fd5b818501915085601f83011261183357600080fd5b813581811115611845576118456117de565b8060051b604051601f19603f8301168101818110858211171561186a5761186a6117de565b60405291825284820192508381018501918883111561188857600080fd5b938501935b828510156118ad5761189e856117a2565b8452938501939285019261188d565b98975050505050505050565b6000806000606084860312156118ce57600080fd5b83356118d98161178d565b925060208401356118e98161178d565b929592945050506040919091013590565b60006020828403121561190c57600080fd5b813561111e8161178d565b801515811461062757600080fd5b60006020828403121561193757600080fd5b813561111e81611917565b60006020828403121561195457600080fd5b5035919050565b6000806040838503121561196e57600080fd5b82356119798161178d565b915060208301356119898161178d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611a0757611a076119df565b5060010190565b600060208284031215611a2057600080fd5b815161111e8161178d565b600080600060608486031215611a4057600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a6b57600080fd5b815161111e81611917565b60008219821115611a8957611a896119df565b500190565b600082821015611aa057611aa06119df565b500390565b6000816000190483118215151615611abf57611abf6119df565b500290565b600082611ae157634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b365784516001600160a01b031683529383019391830191600101611b11565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220520e05c5ff725238fb8edd17673decdd3a643b9826266f8eec6102160e060b0564736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,129
0x6892c1ec9187c6a7fcaad5e6d95944506b674afa
/** *Submitted for verification at Etherscan.io on 2021-07-01 */ /** *Submitted for verification at Etherscan.io on 2021-06-22 */ /** *Submitted for verification at Etherscan.io on 2021-06-19 */ /* 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 BRRRD 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"BABY RRR DOGE" ; string private constant _symbol = unicode"BRRRD"; 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(1)).div(10); _teamFee = (_impactFee.mul(9)).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 = 1; _teamFee = 9; 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 + (30 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 = 10000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (240 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600d81526020017f424142592052525220444f474500000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4252525244000000000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff02191690831515021790555060f042610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b505050678ac7230489e8000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60016009819055506009600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b601e4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960018461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660098461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220152a810b1849f609bcfb10b6c5765b2343b5334b848e99448f1f4606edfd4b3864736f6c63430008040033
{"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"}]}}
2,130
0xd7da6ab5442cb6fc7421812c8c984d39065e3276
// DOJIWORLD (DOJI) changes crypto market. //Telegram: https://t.me/dojiworld // 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 WildDoji is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Wild Doji"; string private constant _symbol = "WDoji"; 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 startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 3000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600981526020017f57696c6420446f6a690000000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506729a2241af62c00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f57446f6a69000000000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b603c42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b60016008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200d79d02e929b0263bd142ebe8440a6f8fec62aa97bbfa35600dbc2adf79b000264736f6c63430008040033
{"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"}]}}
2,131
0x9dd11966d74b477a001808976db9e708add2ddfc
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { require(_address != address(0)); _; } modifier notThisAddress(address _address) { require(_address != address(this)); _; } modifier notNullOrThisAddress(address _address) { require(_address != address(0)); require(_address != address(this)); _; } modifier notSameAddresses(address _address1, address _address2) { if (_address1 != _address2) _; } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { // Require that sender is the assigned destructor require(destructor() == msg.sender); // Disable self-destruction selfDestructionDisabled = true; // Emit event emit SelfDestructionDisabledEvent(msg.sender); } /// @notice Destroy this contract function triggerSelfDestruction() public { // Require that sender is the assigned destructor require(destructor() == msg.sender); // Require that self-destruction has not been disabled require(!selfDestructionDisabled); // Emit event emit TriggerSelfDestructionEvent(msg.sender); // Self-destruct and reward destructor selfdestruct(msg.sender); } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { deployer = _deployer; operator = _deployer; } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { return deployer; } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { if (newDeployer != deployer) { // Set new deployer address oldDeployer = deployer; deployer = newDeployer; // Emit event emit SetDeployerEvent(oldDeployer, newDeployer); } } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { if (newOperator != operator) { // Set new operator address oldOperator = operator; operator = newOperator; // Emit event emit SetOperatorEvent(oldOperator, newOperator); } } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { return msg.sender == deployer; } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { return msg.sender == operator; } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { return isDeployer() || isOperator(); } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { require(isDeployer()); _; } modifier notDeployer() { require(!isDeployer()); _; } modifier onlyOperator() { require(isOperator()); _; } modifier notOperator() { require(!isOperator()); _; } modifier onlyDeployerOrOperator() { require(isDeployerOrOperator()); _; } modifier notDeployerOrOperator() { require(!isDeployerOrOperator()); _; } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title MonetaryTypesLib * @dev Monetary data types */ library MonetaryTypesLib { // // Structures // ----------------------------------------------------------------------------------------------------------------- struct Currency { address ct; uint256 id; } struct Figure { int256 amount; Currency currency; } struct NoncedAmount { uint256 nonce; int256 amount; } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title NahmiiTypesLib * @dev Data types of general nahmii character */ library NahmiiTypesLib { // // Enums // ----------------------------------------------------------------------------------------------------------------- enum ChallengePhase {Dispute, Closed} // // Structures // ----------------------------------------------------------------------------------------------------------------- struct OriginFigure { uint256 originId; MonetaryTypesLib.Figure figure; } struct IntendedConjugateCurrency { MonetaryTypesLib.Currency intended; MonetaryTypesLib.Currency conjugate; } struct SingleFigureTotalOriginFigures { MonetaryTypesLib.Figure single; OriginFigure[] total; } struct TotalOriginFigures { OriginFigure[] total; } struct CurrentPreviousInt256 { int256 current; int256 previous; } struct SingleTotalInt256 { int256 single; int256 total; } struct IntendedConjugateCurrentPreviousInt256 { CurrentPreviousInt256 intended; CurrentPreviousInt256 conjugate; } struct IntendedConjugateSingleTotalInt256 { SingleTotalInt256 intended; SingleTotalInt256 conjugate; } struct WalletOperatorHashes { bytes32 wallet; bytes32 operator; } struct Signature { bytes32 r; bytes32 s; uint8 v; } struct Seal { bytes32 hash; Signature signature; } struct WalletOperatorSeal { Seal wallet; Seal operator; } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title PaymentTypesLib * @dev Data types centered around payment */ library PaymentTypesLib { // // Enums // ----------------------------------------------------------------------------------------------------------------- enum PaymentPartyRole {Sender, Recipient} // // Structures // ----------------------------------------------------------------------------------------------------------------- struct PaymentSenderParty { uint256 nonce; address wallet; NahmiiTypesLib.CurrentPreviousInt256 balances; NahmiiTypesLib.SingleFigureTotalOriginFigures fees; string data; } struct PaymentRecipientParty { uint256 nonce; address wallet; NahmiiTypesLib.CurrentPreviousInt256 balances; NahmiiTypesLib.TotalOriginFigures fees; } struct Operator { uint256 id; string data; } struct Payment { int256 amount; MonetaryTypesLib.Currency currency; PaymentSenderParty sender; PaymentRecipientParty recipient; // Positive transfer is always in direction from sender to recipient NahmiiTypesLib.SingleTotalInt256 transfers; NahmiiTypesLib.WalletOperatorSeal seals; uint256 blockNumber; Operator operator; } // // Functions // ----------------------------------------------------------------------------------------------------------------- function PAYMENT_KIND() public pure returns (string memory) { return "payment"; } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title PaymentHasher * @notice Contract that hashes types related to payment */ contract PaymentHasher is Ownable { // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- function hashPaymentAsWallet(PaymentTypesLib.Payment memory payment) public pure returns (bytes32) { bytes32 amountCurrencyHash = hashPaymentAmountCurrency(payment); bytes32 senderHash = hashPaymentSenderPartyAsWallet(payment.sender); bytes32 recipientHash = hashAddress(payment.recipient.wallet); return keccak256(abi.encodePacked(amountCurrencyHash, senderHash, recipientHash)); } function hashPaymentAsOperator(PaymentTypesLib.Payment memory payment) public pure returns (bytes32) { bytes32 walletSignatureHash = hashSignature(payment.seals.wallet.signature); bytes32 senderHash = hashPaymentSenderPartyAsOperator(payment.sender); bytes32 recipientHash = hashPaymentRecipientPartyAsOperator(payment.recipient); bytes32 transfersHash = hashSingleTotalInt256(payment.transfers); bytes32 operatorHash = hashString(payment.operator.data); return keccak256(abi.encodePacked( walletSignatureHash, senderHash, recipientHash, transfersHash, operatorHash )); } function hashPaymentAmountCurrency(PaymentTypesLib.Payment memory payment) public pure returns (bytes32) { return keccak256(abi.encodePacked( payment.amount, payment.currency.ct, payment.currency.id )); } function hashPaymentSenderPartyAsWallet( PaymentTypesLib.PaymentSenderParty memory paymentSenderParty) public pure returns (bytes32) { return keccak256(abi.encodePacked( paymentSenderParty.wallet, paymentSenderParty.data )); } function hashPaymentSenderPartyAsOperator( PaymentTypesLib.PaymentSenderParty memory paymentSenderParty) public pure returns (bytes32) { bytes32 rootHash = hashUint256(paymentSenderParty.nonce); bytes32 balancesHash = hashCurrentPreviousInt256(paymentSenderParty.balances); bytes32 singleFeeHash = hashFigure(paymentSenderParty.fees.single); bytes32 totalFeesHash = hashOriginFigures(paymentSenderParty.fees.total); return keccak256(abi.encodePacked( rootHash, balancesHash, singleFeeHash, totalFeesHash )); } function hashPaymentRecipientPartyAsOperator( PaymentTypesLib.PaymentRecipientParty memory paymentRecipientParty) public pure returns (bytes32) { bytes32 rootHash = hashUint256(paymentRecipientParty.nonce); bytes32 balancesHash = hashCurrentPreviousInt256(paymentRecipientParty.balances); bytes32 totalFeesHash = hashOriginFigures(paymentRecipientParty.fees.total); return keccak256(abi.encodePacked( rootHash, balancesHash, totalFeesHash )); } function hashCurrentPreviousInt256( NahmiiTypesLib.CurrentPreviousInt256 memory currentPreviousInt256) public pure returns (bytes32) { return keccak256(abi.encodePacked( currentPreviousInt256.current, currentPreviousInt256.previous )); } function hashSingleTotalInt256( NahmiiTypesLib.SingleTotalInt256 memory singleTotalInt256) public pure returns (bytes32) { return keccak256(abi.encodePacked( singleTotalInt256.single, singleTotalInt256.total )); } function hashFigure(MonetaryTypesLib.Figure memory figure) public pure returns (bytes32) { return keccak256(abi.encodePacked( figure.amount, figure.currency.ct, figure.currency.id )); } function hashOriginFigures(NahmiiTypesLib.OriginFigure[] memory originFigures) public pure returns (bytes32) { bytes32 hash; for (uint256 i = 0; i < originFigures.length; i++) { hash = keccak256(abi.encodePacked( hash, originFigures[i].originId, originFigures[i].figure.amount, originFigures[i].figure.currency.ct, originFigures[i].figure.currency.id ) ); } return hash; } function hashUint256(uint256 _uint256) public pure returns (bytes32) { return keccak256(abi.encodePacked(_uint256)); } function hashString(string memory _string) public pure returns (bytes32) { return keccak256(abi.encodePacked(_string)); } function hashAddress(address _address) public pure returns (bytes32) { return keccak256(abi.encodePacked(_address)); } function hashSignature(NahmiiTypesLib.Signature memory signature) public pure returns (bytes32) { return keccak256(abi.encodePacked( signature.v, signature.r, signature.s )); } }
0x608060405234801561001057600080fd5b50600436106101125760003560e01c806303b381a41461011757806315c74fe71461014057806320838c66146101535780632738a112146101665780632f013a0014610170578063312aa825146101855780633aa5fe59146101985780634476d23b146101ab578063570ca735146101c057806370327ea1146101c8578063766954b4146101d057806396214735146101e3578063a2724843146101f6578063b3ab15fb14610209578063bb10d1791461021c578063d39d31741461022f578063d5f3948814610242578063dc072b951461024a578063dd27efe21461024a578063f988ea121461025d578063fd9292ea14610270578063fff4bcc61461027e575b600080fd5b61012a610125366004610fc2565b610291565b6040516101379190611322565b60405180910390f35b61012a61014e366004610f70565b610316565b61012a610161366004610fc2565b610355565b61016e610372565b005b6101786103d8565b6040516101379190611314565b61012a61019336600461102a565b6103e1565b61012a6101a6366004610ec4565b610404565b6101b3610417565b60405161013791906112dd565b6101b361042b565b61016e61043a565b61012a6101de366004610f1e565b61049d565b61016e6101f1366004610ec4565b6104b0565b61012a610204366004610ff6565b610570565b61016e610217366004610ec4565b6105d9565b61012a61022a366004610ff6565b61067c565b61012a61023d366004611048565b610719565b6101b361072c565b61012a610258366004610f52565b610740565b61012a61026b366004610eea565b61075d565b61012a61014e366004610ff6565b61012a61028c366004610f8e565b61081d565b6000806102a18360000151610719565b905060006102b28460400151610740565b905060006102c7856060015160000151610316565b905060006102dc86606001516020015161075d565b9050838383836040516020016102f5949392919061115a565b60405160208183030381529060405280519060200120945050505050919050565b8051602080830151805190820151604051600094610338949093929101611247565b604051602081830303815290604052805190602001209050919050565b600081602001518260800151604051602001610338929190611107565b3361037b610417565b6001600160a01b03161461038e57600080fd5b60005460ff161561039e57600080fd5b7f787a5d936e74f4b564b9153575886059829c78cd9927b1be5e0d976b317ef736336040516103cd91906112eb565b60405180910390a133ff5b60005460ff1681565b6000816040015182600001518360200151604051602001610338939291906112c1565b60008160405160200161033891906110f2565b60005461010090046001600160a01b031690565b6001546001600160a01b031681565b33610443610417565b6001600160a01b03161461045657600080fd5b6000805460ff191660011790556040517fd5a2a04a775c741c2ca0dc46ea7ce4835190e1aaf1ca018def0e82568ec33616906104939033906112eb565b60405180910390a1565b6000816040516020016103389190611299565b6104b8610853565b6104c157600080fd5b806001600160a01b0381166104d557600080fd5b6001600160a01b0381163014156104eb57600080fd5b6000546001600160a01b03838116610100909204161461056c57600080546001600160a01b03848116610100908102610100600160a81b03198416179093556040519290910416907f977e5fa58e458501775e0008d275006294c5249e3c08d1d0e3a9f3acad14f6e49061056290839086906112f9565b60405180910390a1505b5050565b60008061057c83610316565b9050600061058d8460400151610355565b905060006105a2856060015160200151610404565b90508282826040516020016105b993929190611123565b604051602081830303815290604052805190602001209350505050919050565b6105e1610869565b6105ea57600080fd5b806001600160a01b0381166105fe57600080fd5b6001600160a01b03811630141561061457600080fd5b6001546001600160a01b0383811691161461056c57600180546001600160a01b038481166001600160a01b03198316179092556040519116907f9f611b789425d0d5b90b920f1b2852907dd865c80074a30b1629aaa041d1812c9061056290839086906112f9565b6000806106948360a0015160000151602001516103e1565b905060006106a58460400151610291565b905060006106b6856060015161081d565b905060006106c78660800151610740565b905060006106dc8760e001516020015161049d565b905084848484846040516020016106f79594939291906111a2565b6040516020818303038152906040528051906020012095505050505050919050565b60008160405160200161033891906112ac565b60005461010090046001600160a01b031681565b600081600001518260200151604051602001610338929190611273565b600080805b8351811015610816578184828151811061077857fe5b60200260200101516000015185838151811061079057fe5b602002602001015160200151600001518684815181106107ac57fe5b60200260200101516020015160200151600001518785815181106107cc57fe5b60200260200101516020015160200151602001516040516020016107f49594939291906111fb565b60408051601f1981840301815291905280516020909101209150600101610762565b5092915050565b60008061082d8360000151610719565b9050600061083e8460400151610740565b905060006105a285606001516000015161075d565b60005461010090046001600160a01b0316331490565b6001546001600160a01b0316331490565b80356108858161143b565b92915050565b600082601f83011261089c57600080fd5b81356108af6108aa82611356565b611330565b915081818352602084019350602081019050838560808402820111156108d457600080fd5b60005b8381101561090257816108ea8882610ad6565b845250602090920191608091909101906001016108d7565b5050505092915050565b600082601f83011261091d57600080fd5b813561092b6108aa82611356565b9150818183526020840193506020810190508385608084028201111561095057600080fd5b60005b8381101561090257816109668882610ad6565b84525060209092019160809190910190600101610953565b803561088581611452565b600082601f83011261099a57600080fd5b81356109a86108aa82611376565b915080825260208301602083018583830111156109c457600080fd5b6109cf8382846113dc565b50505092915050565b6000604082840312156109ea57600080fd5b6109f46040611330565b90506000610a02848461087a565b8252506020610a138484830161097e565b60208301525092915050565b600060408284031215610a3157600080fd5b610a3b6040611330565b90506000610a02848461097e565b600060608284031215610a5b57600080fd5b610a656040611330565b90506000610a73848461097e565b8252506020610a13848483016109d8565b600060408284031215610a9657600080fd5b610aa06040611330565b90506000610aae848461097e565b82525060208201356001600160401b03811115610aca57600080fd5b610a1384828501610989565b600060808284031215610ae857600080fd5b610af26040611330565b90506000610b00848461097e565b8252506020610a1384848301610a49565b600060a08284031215610b2357600080fd5b610b2d6080611330565b90506000610b3b848461097e565b8252506020610b4c8484830161087a565b6020830152506040610b6084828501610a1f565b60408301525060808201356001600160401b03811115610b7f57600080fd5b610b8b84828501610e34565b60608301525092915050565b600060c08284031215610ba957600080fd5b610bb360a0611330565b90506000610bc1848461097e565b8252506020610bd28484830161087a565b6020830152506040610be684828501610a1f565b60408301525060808201356001600160401b03811115610c0557600080fd5b610c1184828501610de2565b60608301525060a08201356001600160401b03811115610c3057600080fd5b610c3c84828501610989565b60808301525092915050565b60006102208284031215610c5b57600080fd5b610c66610100611330565b90506000610c74848461097e565b8252506020610c85848483016109d8565b60208301525060608201356001600160401b03811115610ca457600080fd5b610cb084828501610b97565b60408301525060808201356001600160401b03811115610ccf57600080fd5b610cdb84828501610b11565b60608301525060a0610cef84828501610a1f565b60808301525060e0610d0384828501610e7d565b60a0830152506101e0610d188482850161097e565b60c0830152506102008201356001600160401b03811115610d3857600080fd5b610d4484828501610a84565b60e08301525092915050565b600060808284031215610d6257600080fd5b610d6c6040611330565b90506000610d7a848461097e565b8252506020610a13848483015b600060608284031215610d9957600080fd5b610da36060611330565b90506000610db1848461097e565b8252506020610dc28484830161097e565b6020830152506040610dd684828501610eb9565b60408301525092915050565b600060808284031215610df457600080fd5b610dfe6040611330565b90506000610e0c8484610a49565b82525060608201356001600160401b03811115610e2857600080fd5b610a138482850161088b565b600060208284031215610e4657600080fd5b610e506020611330565b905081356001600160401b03811115610e6857600080fd5b610e748482850161088b565b82525092915050565b60006101008284031215610e9057600080fd5b610e9a6040611330565b90506000610ea88484610d50565b8252506080610a1384848301610d50565b80356108858161145b565b600060208284031215610ed657600080fd5b6000610ee2848461087a565b949350505050565b600060208284031215610efc57600080fd5b81356001600160401b03811115610f1257600080fd5b610ee28482850161090c565b600060208284031215610f3057600080fd5b81356001600160401b03811115610f4657600080fd5b610ee284828501610989565b600060408284031215610f6457600080fd5b6000610ee28484610a1f565b600060608284031215610f8257600080fd5b6000610ee28484610a49565b600060208284031215610fa057600080fd5b81356001600160401b03811115610fb657600080fd5b610ee284828501610b11565b600060208284031215610fd457600080fd5b81356001600160401b03811115610fea57600080fd5b610ee284828501610b97565b60006020828403121561100857600080fd5b81356001600160401b0381111561101e57600080fd5b610ee284828501610c48565b60006060828403121561103c57600080fd5b6000610ee28484610d87565b60006020828403121561105a57600080fd5b6000610ee2848461097e565b61106f816113cb565b82525050565b61106f816113a6565b61106f61108a826113a6565b611418565b61106f816113b1565b61106f816113b6565b61106f6110ad826113b6565b6113b6565b60006110bd8261139d565b6110c781856113a1565b93506110d78185602086016113e8565b9290920192915050565b61106f6110ed826113c5565b611429565b60006110fe828461107e565b50601401919050565b6000611113828561107e565b601482019150610ee282846110b2565b600061112f82866110a1565b60208201915061113f82856110a1565b60208201915061114f82846110a1565b506020019392505050565b600061116682876110a1565b60208201915061117682866110a1565b60208201915061118682856110a1565b60208201915061119682846110a1565b50602001949350505050565b60006111ae82886110a1565b6020820191506111be82876110a1565b6020820191506111ce82866110a1565b6020820191506111de82856110a1565b6020820191506111ee82846110a1565b5060200195945050505050565b600061120782886110a1565b60208201915061121782876110a1565b60208201915061122782866110a1565b602082019150611237828561107e565b6014820191506111ee82846110a1565b600061125382866110a1565b602082019150611263828561107e565b60148201915061114f82846110a1565b600061127f82856110a1565b60208201915061128f82846110a1565b5060200192915050565b60006112a582846110b2565b9392505050565b60006112b882846110a1565b50602001919050565b60006112cd82866110e1565b60018201915061113f82856110a1565b602081016108858284611075565b602081016108858284611066565b604081016113078285611075565b6112a56020830184611075565b60208101610885828461108f565b602081016108858284611098565b6040518181016001600160401b038111828210171561134e57600080fd5b604052919050565b60006001600160401b0382111561136c57600080fd5b5060209081020190565b60006001600160401b0382111561138c57600080fd5b506020601f91909101601f19160190565b5190565b919050565b6000610885826113b9565b151590565b90565b6001600160a01b031690565b60ff1690565b6000610885826000610885826113a6565b82818337506000910152565b60005b838110156114035781810151838201526020016113eb565b83811115611412576000848401525b50505050565b600061088582600061088582611435565b60006108858260f81b90565b60601b90565b611444816113a6565b811461144f57600080fd5b50565b611444816113b6565b611444816113c556fea365627a7a72305820af9a34f8b026db7e8fd67fcfc4dd4ec69ffc8ce49cec62662120fdf620f4156b6c6578706572696d656e74616cf564736f6c63430005090040
{"success": true, "error": null, "results": {}}
2,132
0x3343196788076f00f27efa08b1f6f191eeb350c3
// 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 Kingcliff 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 = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Kingcliff"; string private constant _symbol = unicode"Kingcliff"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 9; uint256 private _feeRate = 10; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private buyLimitEnd; uint private holdingCapPercent = 2; 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) { _FeeAddress = FeeAddress; _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 tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } if (to != uniswapV2Pair && to != address(this)) require(balanceOf(to) + amount <= _getMaxHolding(), "Max holding cap breached."); // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _teamFee = 9; 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 + (9 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { _teamFee = 19; if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } 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); } 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 = 10000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (180 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); } function _getMaxHolding() internal view returns (uint256) { return (totalSupply() * holdingCapPercent) / 100; } function _setMaxHolding(uint8 percent) external { require(percent > 0, "Max holding cap cannot be less than 1"); holdingCapPercent = percent; } }
0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a914610457578063c3c8cd8014610494578063c9567bf9146104ab578063db92dbb6146104c2578063dd62ed3e146104ed578063e8078d941461052a5761014b565b806370a0823114610345578063715018a6146103825780638da5cb5b1461039957806395d89b41146103c4578063a9059cbb146103ef578063a985ceef1461042c5761014b565b8063313ce56711610108578063313ce5671461024b57806345596e2e14610276578063522644df1461029f5780635932ead1146102c857806368a3a6a5146102f15780636fc3eaec1461032e5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e357806327f3a72a146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610541565b6040516101729190613083565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612b32565b61057e565b6040516101af9190613068565b60405180910390f35b3480156101c457600080fd5b506101cd61059c565b6040516101da91906132a5565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612ae3565b6105ac565b6040516102179190613068565b60405180910390f35b34801561022c57600080fd5b50610235610685565b60405161024291906132a5565b60405180910390f35b34801561025757600080fd5b50610260610695565b60405161026d919061331a565b60405180910390f35b34801561028257600080fd5b5061029d60048036038101906102989190612bc0565b61069e565b005b3480156102ab57600080fd5b506102c660048036038101906102c19190612c38565b610785565b005b3480156102d457600080fd5b506102ef60048036038101906102ea9190612b6e565b6107d8565b005b3480156102fd57600080fd5b5061031860048036038101906103139190612a55565b6108d0565b60405161032591906132a5565b60405180910390f35b34801561033a57600080fd5b50610343610927565b005b34801561035157600080fd5b5061036c60048036038101906103679190612a55565b610999565b60405161037991906132a5565b60405180910390f35b34801561038e57600080fd5b506103976109ea565b005b3480156103a557600080fd5b506103ae610b3d565b6040516103bb9190612f9a565b60405180910390f35b3480156103d057600080fd5b506103d9610b66565b6040516103e69190613083565b60405180910390f35b3480156103fb57600080fd5b5061041660048036038101906104119190612b32565b610ba3565b6040516104239190613068565b60405180910390f35b34801561043857600080fd5b50610441610bc1565b60405161044e9190613068565b60405180910390f35b34801561046357600080fd5b5061047e60048036038101906104799190612a55565b610bd8565b60405161048b91906132a5565b60405180910390f35b3480156104a057600080fd5b506104a9610c2f565b005b3480156104b757600080fd5b506104c0610ca9565b005b3480156104ce57600080fd5b506104d7610d6e565b6040516104e491906132a5565b60405180910390f35b3480156104f957600080fd5b50610514600480360381019061050f9190612aa7565b610da0565b60405161052191906132a5565b60405180910390f35b34801561053657600080fd5b5061053f610e27565b005b60606040518060400160405280600981526020017f4b696e67636c6966660000000000000000000000000000000000000000000000815250905090565b600061059261058b611337565b848461133f565b6001905092915050565b6000670de0b6b3a7640000905090565b60006105b984848461150a565b61067a846105c5611337565b61067585604051806060016040528060288152602001613a1160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061062b611337565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3b9092919063ffffffff16565b61133f565b600190509392505050565b600061069030610999565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106df611337565b73ffffffffffffffffffffffffffffffffffffffff16146106ff57600080fd5b60338110610742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073990613165565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161077a91906132a5565b60405180910390a150565b60008160ff16116107cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c290613285565b60405180910390fd5b8060ff1660158190555050565b6107e0611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610864906131c5565b60405180910390fd5b80601360156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601360159054906101000a900460ff166040516108c59190613068565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610920919061346b565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610968611337565b73ffffffffffffffffffffffffffffffffffffffff161461098857600080fd5b600047905061099681611e9f565b50565b60006109e3600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f0b565b9050919050565b6109f2611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906131c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4b696e67636c6966660000000000000000000000000000000000000000000000815250905090565b6000610bb7610bb0611337565b848461150a565b6001905092915050565b6000601360159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610c28919061346b565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c70611337565b73ffffffffffffffffffffffffffffffffffffffff1614610c9057600080fd5b6000610c9b30610999565b9050610ca681611f79565b50565b610cb1611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d35906131c5565b60405180910390fd5b6001601360146101000a81548160ff02191690831515021790555060b442610d66919061338a565b601481905550565b6000610d9b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e2f611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb3906131c5565b60405180910390fd5b601360149054906101000a900460ff1615610f0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0390613245565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f9b30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a764000061133f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fe157600080fd5b505afa158015610ff5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110199190612a7e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561107b57600080fd5b505afa15801561108f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b39190612a7e565b6040518363ffffffff1660e01b81526004016110d0929190612fb5565b602060405180830381600087803b1580156110ea57600080fd5b505af11580156110fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111229190612a7e565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111ab30610999565b6000806111b6610b3d565b426040518863ffffffff1660e01b81526004016111d896959493929190613007565b6060604051808303818588803b1580156111f157600080fd5b505af1158015611205573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061122a9190612be9565b505050662386f26fc1000060108190555042600d81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e1929190612fde565b602060405180830381600087803b1580156112fb57600080fd5b505af115801561130f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113339190612b97565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a690613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561141f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611416906130e5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114fd91906132a5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190613205565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e1906130a5565b60405180910390fd5b6000811161162d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611624906131e5565b60405180910390fd5b611635610b3d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116a35750611673610b3d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d7857601360159054906101000a900460ff16156117a957600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166117a8576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561183357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561189657611840612273565b8161184a84610999565b611854919061338a565b1115611895576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188c90613105565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119415750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119975750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b6457601360149054906101000a900460ff166119eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e290613265565b60405180910390fd5b6009600a81905550601360159054906101000a900460ff1615611afa57426014541115611af957601054811115611a2157600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611aa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9c90613125565b60405180910390fd5b602d42611ab2919061338a565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601360159054906101000a900460ff1615611b6357600942611b1c919061338a565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611b6f30610999565b9050601360169054906101000a900460ff16158015611bdc5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf45750601360149054906101000a900460ff165b15611d76576013600a81905550601360159054906101000a900460ff1615611c9b5742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9190613185565b60405180910390fd5b5b6000811115611d5c57611cf66064611ce8600b54611cda601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b61229b90919063ffffffff16565b61231690919063ffffffff16565b811115611d5257611d4f6064611d41600b54611d33601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b61229b90919063ffffffff16565b61231690919063ffffffff16565b90505b611d5b81611f79565b5b60004790506000811115611d7457611d7347611e9f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e1f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611e2957600090505b611e3584848484612360565b50505050565b6000838311158290611e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7a9190613083565b60405180910390fd5b5060008385611e92919061346b565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611f07573d6000803e3d6000fd5b5050565b6000600754821115611f52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f49906130c5565b60405180910390fd5b6000611f5c61238d565b9050611f71818461231690919063ffffffff16565b915050919050565b6001601360166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611fd7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120055781602001602082028036833780820191505090505b5090503081600081518110612043577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156120e557600080fd5b505afa1580156120f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211d9190612a7e565b81600181518110612157577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121be30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461133f565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122229594939291906132c0565b600060405180830381600087803b15801561223c57600080fd5b505af1158015612250573d6000803e3d6000fd5b50505050506000601360166101000a81548160ff02191690831515021790555050565b6000606460155461228261059c565b61228c9190613411565b61229691906133e0565b905090565b6000808314156122ae5760009050612310565b600082846122bc9190613411565b90508284826122cb91906133e0565b1461230b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612302906131a5565b60405180910390fd5b809150505b92915050565b600061235883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123b8565b905092915050565b8061236e5761236d61241b565b5b61237984848461245e565b8061238757612386612629565b5b50505050565b600080600061239a61263d565b915091506123b1818361231690919063ffffffff16565b9250505090565b600080831182906123ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f69190613083565b60405180910390fd5b506000838561240e91906133e0565b9050809150509392505050565b600060095414801561242f57506000600a54145b156124395761245c565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b6000806000806000806124708761269c565b9550955095509550955095506124ce86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125af816127ac565b6125b98483612869565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161261691906132a5565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000670de0b6b3a76400009050612671670de0b6b3a764000060075461231690919063ffffffff16565b82101561268f57600754670de0b6b3a7640000935093505050612698565b81819350935050505b9091565b60008060008060008060008060006126b98a600954600a546128a3565b92509250925060006126c961238d565b905060008060006126dc8e878787612939565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061274683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e3b565b905092915050565b600080828461275d919061338a565b9050838110156127a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279990613145565b60405180910390fd5b8091505092915050565b60006127b661238d565b905060006127cd828461229b90919063ffffffff16565b905061282181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61287e8260075461270490919063ffffffff16565b6007819055506128998160085461274e90919063ffffffff16565b6008819055505050565b6000806000806128cf60646128c1888a61229b90919063ffffffff16565b61231690919063ffffffff16565b905060006128f960646128eb888b61229b90919063ffffffff16565b61231690919063ffffffff16565b9050600061292282612914858c61270490919063ffffffff16565b61270490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612952858961229b90919063ffffffff16565b90506000612969868961229b90919063ffffffff16565b90506000612980878961229b90919063ffffffff16565b905060006129a98261299b858761270490919063ffffffff16565b61270490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000813590506129d1816139b4565b92915050565b6000815190506129e6816139b4565b92915050565b6000813590506129fb816139cb565b92915050565b600081519050612a10816139cb565b92915050565b600081359050612a25816139e2565b92915050565b600081519050612a3a816139e2565b92915050565b600081359050612a4f816139f9565b92915050565b600060208284031215612a6757600080fd5b6000612a75848285016129c2565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016129d7565b91505092915050565b60008060408385031215612aba57600080fd5b6000612ac8858286016129c2565b9250506020612ad9858286016129c2565b9150509250929050565b600080600060608486031215612af857600080fd5b6000612b06868287016129c2565b9350506020612b17868287016129c2565b9250506040612b2886828701612a16565b9150509250925092565b60008060408385031215612b4557600080fd5b6000612b53858286016129c2565b9250506020612b6485828601612a16565b9150509250929050565b600060208284031215612b8057600080fd5b6000612b8e848285016129ec565b91505092915050565b600060208284031215612ba957600080fd5b6000612bb784828501612a01565b91505092915050565b600060208284031215612bd257600080fd5b6000612be084828501612a16565b91505092915050565b600080600060608486031215612bfe57600080fd5b6000612c0c86828701612a2b565b9350506020612c1d86828701612a2b565b9250506040612c2e86828701612a2b565b9150509250925092565b600060208284031215612c4a57600080fd5b6000612c5884828501612a40565b91505092915050565b6000612c6d8383612c79565b60208301905092915050565b612c828161349f565b82525050565b612c918161349f565b82525050565b6000612ca282613345565b612cac8185613368565b9350612cb783613335565b8060005b83811015612ce8578151612ccf8882612c61565b9750612cda8361335b565b925050600181019050612cbb565b5085935050505092915050565b612cfe816134b1565b82525050565b612d0d816134f4565b82525050565b6000612d1e82613350565b612d288185613379565b9350612d38818560208601613506565b612d4181613597565b840191505092915050565b6000612d59602383613379565b9150612d64826135a8565b604082019050919050565b6000612d7c602a83613379565b9150612d87826135f7565b604082019050919050565b6000612d9f602283613379565b9150612daa82613646565b604082019050919050565b6000612dc2601983613379565b9150612dcd82613695565b602082019050919050565b6000612de5602283613379565b9150612df0826136be565b604082019050919050565b6000612e08601b83613379565b9150612e138261370d565b602082019050919050565b6000612e2b601583613379565b9150612e3682613736565b602082019050919050565b6000612e4e602383613379565b9150612e598261375f565b604082019050919050565b6000612e71602183613379565b9150612e7c826137ae565b604082019050919050565b6000612e94602083613379565b9150612e9f826137fd565b602082019050919050565b6000612eb7602983613379565b9150612ec282613826565b604082019050919050565b6000612eda602583613379565b9150612ee582613875565b604082019050919050565b6000612efd602483613379565b9150612f08826138c4565b604082019050919050565b6000612f20601783613379565b9150612f2b82613913565b602082019050919050565b6000612f43601883613379565b9150612f4e8261393c565b602082019050919050565b6000612f66602583613379565b9150612f7182613965565b604082019050919050565b612f85816134dd565b82525050565b612f94816134e7565b82525050565b6000602082019050612faf6000830184612c88565b92915050565b6000604082019050612fca6000830185612c88565b612fd76020830184612c88565b9392505050565b6000604082019050612ff36000830185612c88565b6130006020830184612f7c565b9392505050565b600060c08201905061301c6000830189612c88565b6130296020830188612f7c565b6130366040830187612d04565b6130436060830186612d04565b6130506080830185612c88565b61305d60a0830184612f7c565b979650505050505050565b600060208201905061307d6000830184612cf5565b92915050565b6000602082019050818103600083015261309d8184612d13565b905092915050565b600060208201905081810360008301526130be81612d4c565b9050919050565b600060208201905081810360008301526130de81612d6f565b9050919050565b600060208201905081810360008301526130fe81612d92565b9050919050565b6000602082019050818103600083015261311e81612db5565b9050919050565b6000602082019050818103600083015261313e81612dd8565b9050919050565b6000602082019050818103600083015261315e81612dfb565b9050919050565b6000602082019050818103600083015261317e81612e1e565b9050919050565b6000602082019050818103600083015261319e81612e41565b9050919050565b600060208201905081810360008301526131be81612e64565b9050919050565b600060208201905081810360008301526131de81612e87565b9050919050565b600060208201905081810360008301526131fe81612eaa565b9050919050565b6000602082019050818103600083015261321e81612ecd565b9050919050565b6000602082019050818103600083015261323e81612ef0565b9050919050565b6000602082019050818103600083015261325e81612f13565b9050919050565b6000602082019050818103600083015261327e81612f36565b9050919050565b6000602082019050818103600083015261329e81612f59565b9050919050565b60006020820190506132ba6000830184612f7c565b92915050565b600060a0820190506132d56000830188612f7c565b6132e26020830187612d04565b81810360408301526132f48186612c97565b90506133036060830185612c88565b6133106080830184612f7c565b9695505050505050565b600060208201905061332f6000830184612f8b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613395826134dd565b91506133a0836134dd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133d5576133d4613539565b5b828201905092915050565b60006133eb826134dd565b91506133f6836134dd565b92508261340657613405613568565b5b828204905092915050565b600061341c826134dd565b9150613427836134dd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134605761345f613539565b5b828202905092915050565b6000613476826134dd565b9150613481836134dd565b92508282101561349457613493613539565b5b828203905092915050565b60006134aa826134bd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134ff826134dd565b9050919050565b60005b83811015613524578082015181840152602081019050613509565b83811115613533576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4d617820686f6c64696e67206361702062726561636865642e00000000000000600082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b7f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460008201527f68616e2031000000000000000000000000000000000000000000000000000000602082015250565b6139bd8161349f565b81146139c857600080fd5b50565b6139d4816134b1565b81146139df57600080fd5b50565b6139eb816134dd565b81146139f657600080fd5b50565b613a02816134e7565b8114613a0d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200640cd886024bb0c43eb636dafc045203d6c9b1dafda9325b043ad283ad4573e64736f6c63430008040033
{"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"}]}}
2,133
0xa0b3a79cf7d4d1203b9d7b702755c18b4c5524cc
// SPDX-License-Identifier: MIT 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; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _setOwner(_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 { _setOwner(address(0)); } 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); } } 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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (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 ) internal 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); } } } } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } interface IERC1155Receiver is IERC165 { function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); } interface IERC1155 is IERC165 { event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); event ApprovalForAll(address indexed account, address indexed operator, bool approved); event URI(string value, uint256 indexed id); function balanceOf(address account, uint256 id) external view returns (uint256); function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); function setApprovalForAll(address operator, bool approved) external; function isApprovedForAll(address account, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; } interface IERC1155MetadataURI is IERC1155 { function uri(uint256 id) external view returns (string memory); } contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; mapping(uint256 => mapping(address => uint256)) private _balances; mapping(address => mapping(address => bool)) private _operatorApprovals; string private _uri; constructor(string memory uri_) { _setURI(uri_); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } function uri(uint256) public view virtual override returns (string memory) { return _uri; } function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not an owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not an owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } function _setURI(string memory newuri) internal virtual { _uri = newuri; } function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); } function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); } function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } } contract M101Allstars is ERC1155, Ownable { uint constant MAX_ALLSTARS = 50; struct Allstar{ uint common_price; uint holders_price; uint max_supply; uint total_supply; string uri; bool active; } mapping (uint => Allstar) private allstars; M101 public constant M101CONTRACT = M101(0x10A0cF0Fd3B9b2d575D78130B29d61252313423E); constructor() public ERC1155("") { } function addAllstar(uint _id, uint _common_price, uint _holders_price, uint _max_supply, string memory _uri) public onlyOwner { require(_id < MAX_ALLSTARS, "Quantity limit reached"); require(getMaxSupply(_id) == 0, "Token is already exist"); allstars[_id].common_price = _common_price; allstars[_id].holders_price = _holders_price; allstars[_id].max_supply = _max_supply; allstars[_id].uri = _uri; } function active(uint _id, bool _active) public onlyOwner { require(getMaxSupply(_id) != 0, "Token does not exist"); allstars[_id].active = _active; } function getPrice(uint _id, address _to) public view returns(uint256){ require(getMaxSupply(_id) != 0, "Token does not exist"); uint256 _price; if (M101CONTRACT.balanceOf(_to) != 0){ _price = allstars[_id].holders_price; } else { _price = allstars[_id].common_price; } return _price; } function getMaxSupply(uint _id) public view returns(uint256){ return allstars[_id].max_supply; } function getTotalSupply(uint _id) public view returns(uint256){ require(getMaxSupply(_id) != 0, "Token does not exist"); return allstars[_id].total_supply; } function isActive(uint _id) public view returns(bool){ require(getMaxSupply(_id) != 0, "Token does not exist"); return allstars[_id].active; } function mint(address _to, uint _count, uint _id) public payable { require(getTotalSupply(_id) + _count <= getMaxSupply(_id), "Total supply limit reached or token does not exist"); if (msg.sender != owner()){ require(isActive(_id), "Sale has not started"); require(balanceOf(_to, _id) == 0, "Address already hold this token"); require(_count == 1, "Max 1 token"); require(msg.value == getPrice(_id, _to) * _count, "the Value is lower then the Price"); } _mint(_to, _id, _count, ""); allstars[_id].total_supply += _count; } function uri(uint256 _id) public view virtual override returns (string memory) { return allstars[_id].uri; } function withdrawAll() public payable onlyOwner { require(payable(msg.sender).send(address(this).balance)); } } interface M101{ function balanceOf(address owner) external view returns (uint256 balance); }
0x60806040526004361061011e5760003560e01c8063853828b6116100a0578063daa2a43511610064578063daa2a4351461033c578063e985e9c51461035c578063f242432a146103a5578063f2fde38b146103c5578063faf5f6cc146103e557600080fd5b8063853828b61461029a5780638da5cb5b146102a257806392ab723e146102d4578063a22cb465146102f4578063bdf6ce611461031457600080fd5b80632eb2c2d6116100e75780632eb2c2d6146101e85780634e1273f4146102085780635e495d7414610235578063715018a61461026557806382afd23b1461027a57600080fd5b8062fdd58e1461012357806301ffc9a7146101565780630e89341c14610186578063156e29f6146101b35780632b57cfbb146101c8575b600080fd5b34801561012f57600080fd5b5061014361013e366004611937565b610405565b6040519081526020015b60405180910390f35b34801561016257600080fd5b50610176610171366004611a65565b61049c565b604051901515815260200161014d565b34801561019257600080fd5b506101a66101a1366004611a9f565b6104ee565b60405161014d9190611cee565b6101c66101c1366004611961565b610596565b005b3480156101d457600080fd5b506101436101e3366004611ad1565b6107cb565b3480156101f457600080fd5b506101c66102033660046117fe565b6108bc565b34801561021457600080fd5b50610228610223366004611994565b610956565b60405161014d9190611cad565b34801561024157600080fd5b50610143610250366004611a9f565b60009081526004602052604090206002015490565b34801561027157600080fd5b506101c6610a80565b34801561028657600080fd5b50610176610295366004611a9f565b610ab6565b6101c6610afd565b3480156102ae57600080fd5b506003546001600160a01b03165b6040516001600160a01b03909116815260200161014d565b3480156102e057600080fd5b506101436102ef366004611a9f565b610b4b565b34801561030057600080fd5b506101c661030f36600461190d565b610b8f565b34801561032057600080fd5b506102bc7310a0cf0fd3b9b2d575d78130b29d61252313423e81565b34801561034857600080fd5b506101c6610357366004611af4565b610b9e565b34801561036857600080fd5b506101766103773660046117cb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b3480156103b157600080fd5b506101c66103c03660046118a8565b610c19565b3480156103d157600080fd5b506101c66103e03660046117b0565b610ca3565b3480156103f157600080fd5b506101c6610400366004611b17565b610d3e565b60006001600160a01b0383166104765760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b14806104cd57506001600160e01b031982166303a24d0760e21b145b806104e857506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060046000838152602001908152602001600020600401805461051190611e96565b80601f016020809104026020016040519081016040528092919081815260200182805461053d90611e96565b801561058a5780601f1061055f5761010080835404028352916020019161058a565b820191906000526020600020905b81548152906001019060200180831161056d57829003601f168201915b50505050509050919050565b600081815260046020526040902060020154826105b283610b4b565b6105bc9190611e5f565b11156106255760405162461bcd60e51b815260206004820152603260248201527f546f74616c20737570706c79206c696d69742072656163686564206f7220746f6044820152711ad95b88191bd95cc81b9bdd08195e1a5cdd60721b606482015260840161046d565b6003546001600160a01b031633146107855761064081610ab6565b6106835760405162461bcd60e51b815260206004820152601460248201527314d85b19481a185cc81b9bdd081cdd185c9d195960621b604482015260640161046d565b61068d8382610405565b156106da5760405162461bcd60e51b815260206004820152601f60248201527f4164647265737320616c726561647920686f6c64207468697320746f6b656e00604482015260640161046d565b816001146107185760405162461bcd60e51b815260206004820152600b60248201526a26b0bc1018903a37b5b2b760a91b604482015260640161046d565b8161072382856107cb565b61072d9190611e77565b34146107855760405162461bcd60e51b815260206004820152602160248201527f7468652056616c7565206973206c6f776572207468656e2074686520507269636044820152606560f81b606482015260840161046d565b6107a083828460405180602001604052806000815250610e47565b600081815260046020526040812060030180548492906107c1908490611e5f565b9091555050505050565b6000828152600460205260408120600201546107f95760405162461bcd60e51b815260040161046d90611d49565b6040516370a0823160e01b81526001600160a01b03831660048201526000907310a0cf0fd3b9b2d575d78130b29d61252313423e906370a082319060240160206040518083038186803b15801561084f57600080fd5b505afa158015610863573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108879190611ab8565b156108a457506000838152600460205260409020600101546108b5565b506000838152600460205260409020545b9392505050565b6001600160a01b0385163314806108d857506108d88533610377565b6109425760405162461bcd60e51b815260206004820152603560248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f7420604482015274185b881bdddb995c881b9bdc88185c1c1c9bdd9959605a1b606482015260840161046d565b61094f8585858585610f51565b5050505050565b606081518351146109bb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161046d565b6000835167ffffffffffffffff8111156109d7576109d7611f45565b604051908082528060200260200182016040528015610a00578160200160208202803683370190505b50905060005b8451811015610a7857610a4b858281518110610a2457610a24611f2f565b6020026020010151858381518110610a3e57610a3e611f2f565b6020026020010151610405565b828281518110610a5d57610a5d611f2f565b6020908102919091010152610a7181611efe565b9050610a06565b509392505050565b6003546001600160a01b03163314610aaa5760405162461bcd60e51b815260040161046d90611e06565b610ab46000611126565b565b600081815260046020526040812060020154610ae45760405162461bcd60e51b815260040161046d90611d49565b5060009081526004602052604090206005015460ff1690565b6003546001600160a01b03163314610b275760405162461bcd60e51b815260040161046d90611e06565b60405133904780156108fc02916000818181858888f19350505050610ab457600080fd5b600081815260046020526040812060020154610b795760405162461bcd60e51b815260040161046d90611d49565b5060009081526004602052604090206003015490565b610b9a338383611178565b5050565b6003546001600160a01b03163314610bc85760405162461bcd60e51b815260040161046d90611e06565b600082815260046020526040902060020154610bf65760405162461bcd60e51b815260040161046d90611d49565b600091825260046020526040909120600501805460ff1916911515919091179055565b6001600160a01b038516331480610c355750610c358533610377565b610c965760405162461bcd60e51b815260206004820152602c60248201527f455243313135353a2063616c6c6572206973206e6f7420616e206f776e65722060448201526b1b9bdc88185c1c1c9bdd995960a21b606482015260840161046d565b61094f8585858585611259565b6003546001600160a01b03163314610ccd5760405162461bcd60e51b815260040161046d90611e06565b6001600160a01b038116610d325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161046d565b610d3b81611126565b50565b6003546001600160a01b03163314610d685760405162461bcd60e51b815260040161046d90611e06565b60328510610db15760405162461bcd60e51b8152602060048201526016602482015275145d585b9d1a5d1e481b1a5b5a5d081c995858da195960521b604482015260640161046d565b60008581526004602052604090206002015415610e095760405162461bcd60e51b8152602060048201526016602482015275151bdad95b881a5cc8185b1c9958591e48195e1a5cdd60521b604482015260640161046d565b600085815260046020818152604090922086815560018101869055600281018590558351610e3f939190920191908401906115f6565b505050505050565b6001600160a01b038416610ea75760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161046d565b33610ec181600087610eb888611376565b61094f88611376565b6000848152602081815260408083206001600160a01b038916845290915281208054859290610ef1908490611e5f565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461094f816000878787876113c1565b8151835114610fb35760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b606482015260840161046d565b6001600160a01b038416610fd95760405162461bcd60e51b815260040161046d90611d77565b3360005b84518110156110c0576000858281518110610ffa57610ffa611f2f565b60200260200101519050600085838151811061101857611018611f2f565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156110685760405162461bcd60e51b815260040161046d90611dbc565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906110a5908490611e5f565b92505081905550505050806110b990611efe565b9050610fdd565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611110929190611cc0565b60405180910390a4610e3f81878787878761152c565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156111ec5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161046d565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03841661127f5760405162461bcd60e51b815260040161046d90611d77565b3361128f818787610eb888611376565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156112d05760405162461bcd60e51b815260040161046d90611dbc565b6000858152602081815260408083206001600160a01b038b811685529252808320878503905590881682528120805486929061130d908490611e5f565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461136d8288888888886113c1565b50505050505050565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106113b0576113b0611f2f565b602090810291909101015292915050565b6001600160a01b0384163b15610e3f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906114059089908990889088908890600401611c68565b602060405180830381600087803b15801561141f57600080fd5b505af192505050801561144f575060408051601f3d908101601f1916820190925261144c91810190611a82565b60015b6114fc5761145b611f5b565b806308c379a014156114955750611470611f77565b8061147b5750611497565b8060405162461bcd60e51b815260040161046d9190611cee565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606482015260840161046d565b6001600160e01b0319811663f23a6e6160e01b1461136d5760405162461bcd60e51b815260040161046d90611d01565b6001600160a01b0384163b15610e3f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906115709089908990889088908890600401611c0a565b602060405180830381600087803b15801561158a57600080fd5b505af19250505080156115ba575060408051601f3d908101601f191682019092526115b791810190611a82565b60015b6115c65761145b611f5b565b6001600160e01b0319811663bc197c8160e01b1461136d5760405162461bcd60e51b815260040161046d90611d01565b82805461160290611e96565b90600052602060002090601f016020900481019282611624576000855561166a565b82601f1061163d57805160ff191683800117855561166a565b8280016001018555821561166a579182015b8281111561166a57825182559160200191906001019061164f565b5061167692915061167a565b5090565b5b80821115611676576000815560010161167b565b600067ffffffffffffffff8311156116a9576116a9611f45565b6040516116c0601f8501601f191660200182611ed1565b8091508381528484840111156116d557600080fd5b83836020830137600060208583010152509392505050565b80356001600160a01b038116811461170457600080fd5b919050565b600082601f83011261171a57600080fd5b8135602061172782611e3b565b6040516117348282611ed1565b8381528281019150858301600585901b8701840188101561175457600080fd5b60005b8581101561177357813584529284019290840190600101611757565b5090979650505050505050565b8035801515811461170457600080fd5b600082601f8301126117a157600080fd5b6108b58383356020850161168f565b6000602082840312156117c257600080fd5b6108b5826116ed565b600080604083850312156117de57600080fd5b6117e7836116ed565b91506117f5602084016116ed565b90509250929050565b600080600080600060a0868803121561181657600080fd5b61181f866116ed565b945061182d602087016116ed565b9350604086013567ffffffffffffffff8082111561184a57600080fd5b61185689838a01611709565b9450606088013591508082111561186c57600080fd5b61187889838a01611709565b9350608088013591508082111561188e57600080fd5b5061189b88828901611790565b9150509295509295909350565b600080600080600060a086880312156118c057600080fd5b6118c9866116ed565b94506118d7602087016116ed565b93506040860135925060608601359150608086013567ffffffffffffffff81111561190157600080fd5b61189b88828901611790565b6000806040838503121561192057600080fd5b611929836116ed565b91506117f560208401611780565b6000806040838503121561194a57600080fd5b611953836116ed565b946020939093013593505050565b60008060006060848603121561197657600080fd5b61197f846116ed565b95602085013595506040909401359392505050565b600080604083850312156119a757600080fd5b823567ffffffffffffffff808211156119bf57600080fd5b818501915085601f8301126119d357600080fd5b813560206119e082611e3b565b6040516119ed8282611ed1565b8381528281019150858301600585901b870184018b1015611a0d57600080fd5b600096505b84871015611a3757611a23816116ed565b835260019690960195918301918301611a12565b5096505086013592505080821115611a4e57600080fd5b50611a5b85828601611709565b9150509250929050565b600060208284031215611a7757600080fd5b81356108b581612001565b600060208284031215611a9457600080fd5b81516108b581612001565b600060208284031215611ab157600080fd5b5035919050565b600060208284031215611aca57600080fd5b5051919050565b60008060408385031215611ae457600080fd5b823591506117f5602084016116ed565b60008060408385031215611b0757600080fd5b823591506117f560208401611780565b600080600080600060a08688031215611b2f57600080fd5b85359450602086013593506040860135925060608601359150608086013567ffffffffffffffff811115611b6257600080fd5b8601601f81018813611b7357600080fd5b61189b8882356020840161168f565b600081518084526020808501945080840160005b83811015611bb257815187529582019590820190600101611b96565b509495945050505050565b6000815180845260005b81811015611be357602081850181015186830182015201611bc7565b81811115611bf5576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0386811682528516602082015260a060408201819052600090611c3690830186611b82565b8281036060840152611c488186611b82565b90508281036080840152611c5c8185611bbd565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090611ca290830184611bbd565b979650505050505050565b6020815260006108b56020830184611b82565b604081526000611cd36040830185611b82565b8281036020840152611ce58185611b82565b95945050505050565b6020815260006108b56020830184611bbd565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b602080825260149082015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600067ffffffffffffffff821115611e5557611e55611f45565b5060051b60200190565b60008219821115611e7257611e72611f19565b500190565b6000816000190483118215151615611e9157611e91611f19565b500290565b600181811c90821680611eaa57607f821691505b60208210811415611ecb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f1916810167ffffffffffffffff81118282101715611ef757611ef7611f45565b6040525050565b6000600019821415611f1257611f12611f19565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115611f745760046000803e5060005160e01c5b90565b600060443d1015611f855790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611fb557505050505090565b8285019150815181811115611fcd5750505050505090565b843d8701016020828501011115611fe75750505050505090565b611ff660208286010187611ed1565b509095945050505050565b6001600160e01b031981168114610d3b57600080fdfea2646970667358221220cc4a9543132e1cca839c77b2ad942ec9881eeebd06136a83230aa1e77b98e9c864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
2,134
0xd19e2462f37835a39503917F5556cB76Fa8Bfa7a
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; //pragma experimental ABIEncoderV2; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ contract SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function safeMul(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 safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function safeAdd(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } //------------------------------------------------------------------------------------- /* * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ abstract contract ERC20 { uint public totalSupply; function balanceOf(address who) public virtual view returns (uint); function allowance(address owner, address spender) public virtual view returns (uint); function transfer(address to, uint value) public virtual returns (bool ok); function transferFrom(address from, address to, uint value) public virtual returns (bool ok); function approve(address spender, uint value) public virtual returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } abstract contract ERC223 is ERC20 { function transfer(address to, uint value, bytes memory data) public virtual returns (bool ok); function transferFrom(address from, address to, uint value, bytes memory data) public virtual returns (bool ok); } /* Base class contracts willing to accept ERC223 token transfers must conform to. Sender: msg.sender to the token contract, the address originating the token transfer. - For user originated transfers sender will be equal to tx.origin - For contract originated transfers, tx.origin will be the user that made the tx that produced the transfer. Origin: the origin address from whose balance the tokens are sent - For transfer(), origin = msg.sender - For transferFrom() origin = _from to token contract Value is the amount of tokens sent Data is arbitrary data sent with the token transfer. Simulates ether tx.data From, origin and value shouldn't be trusted unless the token contract is trusted. If sender == tx.origin, it is safe to trust it regardless of the token. */ abstract contract ERC223Receiver { function tokenFallback(address _sender, address _origin, uint _value, bytes memory _data) public virtual returns (bool ok); } abstract contract Standard223Receiver is ERC223Receiver { function supportsToken(address token) public virtual view returns (bool); } //------------------------------------------------------------------------------------- //Implementation contract IMETACoin223Token_13 is ERC20, ERC223, Standard223Receiver, SafeMath { mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; string public name; //fancy name: eg Simon Bucks uint8 public decimals; //How many decimals to show. string public symbol; //An identifier: eg SBX address /*public*/ contrInitiator; address /*public*/ thisContract; bool /*public*/ isTokenSupport; mapping(address => bool) isSendingLocked; bool isAllTransfersLocked; uint oneTransferLimit; uint oneDayTransferLimit; struct TransferInfo { //address sender; //maybe use in the future //address from; //no need because all this is kept in transferInfo[_from] //address to; //maybe use in the future uint256 value; uint time; } struct TransferInfos { mapping (uint => TransferInfo) ti; uint tc; } mapping (address => TransferInfos) transferInfo; event SetIsSendingLocked(address _from, bool _lock); event SetIsAllTransfersLocked(bool _lock); //------------------------------------------------------------------------------------- //from ExampleToken constructor(/*uint initialBalance*/) { decimals = 4; // Amount of decimals for display purposes name = "IMETA Coin"; // Set the name for display purposes symbol = 'IMC'; // Set the symbol for display purposes uint initialBalance = (10 ** uint256(decimals)) * 10000*1000*1000; balances[msg.sender] = initialBalance; totalSupply = initialBalance; contrInitiator = msg.sender; thisContract =address(this); isTokenSupport = false; isAllTransfersLocked = true; oneTransferLimit = (10 ** uint256(decimals)) * 10000*1000*1001; // to simulate no limit oneDayTransferLimit = (10 ** uint256(decimals)) * 10000*1000*1001; // to simulate no limit // Ideally call token fallback here too } //------------------------------------------------------------------------------------- //from StandardToken function super_transfer(address _to, uint _value) /*public*/ internal returns (bool success) { require(!isSendingLocked[msg.sender]); require(_value <= oneTransferLimit); require(balances[msg.sender] >= _value); if(msg.sender == contrInitiator) { //no restricton } else { require(!isAllTransfersLocked); require(safeAdd(getLast24hSendingValue(msg.sender), _value) <= oneDayTransferLimit); } balances[msg.sender] = safeSub(balances[msg.sender], _value); balances[_to] = safeAdd(balances[_to], _value); uint tc=transferInfo[msg.sender].tc; transferInfo[msg.sender].ti[tc].value = _value; transferInfo[msg.sender].ti[tc].time = block.timestamp; transferInfo[msg.sender].tc = safeAdd(transferInfo[msg.sender].tc, 1); emit Transfer(msg.sender, _to, _value); return true; } function super_transferFrom(address _from, address _to, uint _value) /*public*/ internal returns (bool success) { require(!isSendingLocked[_from]); require(_value <= oneTransferLimit); require(balances[_from] >= _value); if(msg.sender == contrInitiator && _from == thisContract) { // no restriction } else { require(!isAllTransfersLocked); require(safeAdd(getLast24hSendingValue(_from), _value) <= oneDayTransferLimit); uint loc_allowance = allowed[_from][msg.sender]; require(loc_allowance >= _value); allowed[_from][msg.sender] = safeSub(loc_allowance, _value); } balances[_from] = safeSub(balances[_from], _value); balances[_to] = safeAdd(balances[_to], _value); uint tc=transferInfo[_from].tc; transferInfo[_from].ti[tc].value = _value; transferInfo[_from].ti[tc].time = block.timestamp; transferInfo[_from].tc = safeAdd(transferInfo[_from].tc, 1); emit Transfer(_from, _to, _value); return true; } function balanceOf(address _owner) public override view returns (uint balance) { return balances[_owner]; } function approve(address _spender, uint _value) public override returns (bool success) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public override view returns (uint remaining) { return allowed[_owner][_spender]; } //------------------------------------------------------------------------------------- //from Standard223Token //function that is called when a user or another contract wants to transfer funds function transfer(address _to, uint _value, bytes memory _data) public override returns (bool success) { //filtering if the target is a contract with bytecode inside it if (!super_transfer(_to, _value)) assert(false); // do a normal token transfer if (isContract(_to)) { if(!contractFallback(msg.sender, _to, _value, _data)) assert(false); } return true; } function transferFrom(address _from, address _to, uint _value, bytes memory _data) public override returns (bool success) { if (!super_transferFrom(_from, _to, _value)) assert(false); // do a normal token transfer if (isContract(_to)) { if(!contractFallback(_from, _to, _value, _data)) assert(false); } return true; } function transfer(address _to, uint _value) public override returns (bool success) { return transfer(_to, _value, new bytes(0)); } function transferFrom(address _from, address _to, uint _value) public override returns (bool success) { return transferFrom(_from, _to, _value, new bytes(0)); } //function that is called when transaction target is a contract function contractFallback(address _origin, address _to, uint _value, bytes memory _data) private returns (bool success) { ERC223Receiver reciever = ERC223Receiver(_to); return reciever.tokenFallback(msg.sender, _origin, _value, _data); } //assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { // retrieve the size of the code on target address, this needs assembly uint length; assembly { length := extcodesize(_addr) } return length > 0; } //------------------------------------------------------------------------------------- //from Standard223Receiver Tkn tkn; struct Tkn { address addr; address sender; address origin; uint256 value; bytes data; bytes4 sig; } function tokenFallback(address _sender, address _origin, uint _value, bytes memory _data) public override returns (bool ok) { if (!supportsToken(msg.sender)) return false; // Problem: This will do a sstore which is expensive gas wise. Find a way to keep it in memory. tkn = Tkn(msg.sender, _sender, _origin, _value, _data, getSig(_data)); __isTokenFallback = true; // if (!address(this).delegatecall(_data)) return false; (bool success, bytes memory response) = address(this).delegatecall(_data); response = response; //!!!!! will it work? if(!success) return false; // avoid doing an overwrite to .token, which would be more expensive // makes accessing .tkn values outside tokenPayable functions unsafe __isTokenFallback = false; return true; } function getSig(bytes memory _data) private pure returns (bytes4 sig) { uint l = _data.length < 4 ? _data.length : 4; for (uint i = 0; i < l; i++) { sig = bytes4(uint32(uint32(sig) + uint8(_data[i]) * (2 ** (8 * (l - 1 - i))))); } } bool __isTokenFallback; modifier mod_tokenPayable() { if (!__isTokenFallback) assert(false); _; //_ is a special character used in modifiers } //function supportsToken(address token) public pure returns (bool); //moved up //------------------------------------------------------------------------------------- //from ExampleReceiver /* //we do not use dedicated function to receive Token in contract associated account function foo( //uint i ) tokenPayable public { emit LogTokenPayable(1, tkn.addr, tkn.sender, tkn.value); } */ function tokenPayable() external mod_tokenPayable() { emit LogTokenPayable(0, tkn.addr, tkn.sender, tkn.value); } function supportsToken(address token) public override view returns (bool) { //do not need to to anything with that token address? //if (token == 0) { //attila addition if (token != thisContract) { //attila addition, support only our own token, not others' token return false; } if(!isTokenSupport) { //attila addition return false; } return true; } event LogTokenPayable(uint i, address token, address sender, uint value); //------------------------------------------------------------------------------------- // My extensions /* function enableTokenSupport(bool _tokenSupport) public returns (bool success) { if(msg.sender == contrInitiator) { isTokenSupport = _tokenSupport; return true; } else { return false; } } */ function setIsAllTransfersLocked(bool _lock) public { require(msg.sender == contrInitiator); isAllTransfersLocked = _lock; emit SetIsAllTransfersLocked(_lock); } function setIsSendingLocked(address _from, bool _lock) public { require(msg.sender == contrInitiator); isSendingLocked[_from] = _lock; emit SetIsSendingLocked(_from, _lock); } function getIsAllTransfersLocked() public view returns (bool ok) { return isAllTransfersLocked; } function getIsSendingLocked(address _from ) public view returns (bool ok) { return isSendingLocked[_from]; } /* function getTransferInfoCount(address _from) public view returns (uint count) { return transferInfo[_from].tc; } */ /* // use experimental feature function getTransferInfo(address _from, uint index) public view returns (TransferInfo ti) { return transferInfo[_from].ti[index]; } */ /* function getTransferInfoTime(address _from, uint index) public view returns (uint time) { return transferInfo[_from].ti[index].time; } */ /* function getTransferInfoValue(address _from, uint index) public view returns (uint value) { return transferInfo[_from].ti[index].value; } */ function getLast24hSendingValue(address _from) public view returns (uint totVal) { totVal = 0; //declared above; uint tc = transferInfo[_from].tc; if(tc > 0) { for(uint i = tc-1 ; i >= 0 ; i--) { // if(block.timestamp - transferInfo[_from].ti[i].time < 10 minutes) { // if(block.timestamp - transferInfo[_from].ti[i].time < 1 hours) { if(block.timestamp - transferInfo[_from].ti[i].time < 1 days) { totVal = safeAdd(totVal, transferInfo[_from].ti[i].value ); } else { break; } } } } function airdropIndividual(address[] memory _recipients, uint256[] memory _values, uint256 _elemCount, uint _totalValue) public returns (bool success) { require(_recipients.length == _elemCount); require(_values.length == _elemCount); require(_elemCount <= 50); uint256 totalValue = 0; for(uint i = 0; i< _recipients.length; i++) { totalValue = safeAdd(totalValue, _values[i]); } require(totalValue == _totalValue); for(uint i = 0; i< _recipients.length; i++) { transfer(_recipients[i], _values[i]); } return true; } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80636172f071116100ad578063ab67aa5811610071578063ab67aa581461029b578063be45fd62146102ae578063cfea751f146102c1578063dd62ed3e146102cc578063dfe8bf641461030557600080fd5b80636172f0711461022f57806365cd36861461024457806370a082311461025757806395d89b4114610280578063a9059cbb1461028857600080fd5b806323b872dd116100f457806323b872dd146101ab5780632b6b7c69146101be578063313ce567146101d15780634c123019146101f05780635c622c091461020357600080fd5b8063061f76501461013157806306fdde0314610159578063095ea7b31461016e578063125041091461018157806318160ddd146101a2575b600080fd5b61014461013f366004611043565b61030d565b60405190151581526020015b60405180910390f35b61016161034e565b6040516101509190611379565b61014461017c36600461116c565b6103dc565b61019461018f366004611043565b610449565b604051908152602001610150565b61019460005481565b6101446101b9366004611091565b61050c565b6101446101cc3660046111ed565b610533565b6004546101de9060ff1681565b60405160ff9091168152602001610150565b6101446101fe3660046110cd565b610616565b610144610211366004611043565b6001600160a01b031660009081526008602052604090205460ff1690565b61024261023d3660046112c4565b6107a0565b005b610242610252366004611135565b6107fe565b610194610265366004611043565b6001600160a01b031660009081526001602052604090205490565b610161610878565b61014461029636600461116c565b610885565b6101446102a93660046110cd565b6108a9565b6101446102bc366004611196565b6108ec565b60095460ff16610144565b6101946102da36600461105e565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b61024261092d565b6007546000906001600160a01b0383811691161461032d57506000919050565b600754600160a01b900460ff1661034657506000919050565b506001919050565b6003805461035b90611561565b80601f016020809104026020016040519081016040528092919081815260200182805461038790611561565b80156103d45780601f106103a9576101008083540402835291602001916103d4565b820191906000526020600020905b8154815290600101906020018083116103b757829003601f168201915b505050505081565b3360008181526002602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104379086815260200190565b60405180910390a35060015b92915050565b6001600160a01b0381166000908152600c60205260408120600101548015610506576000610478600183611503565b90505b6001600160a01b0384166000908152600c6020908152604080832084845290915290206001015462015180906104b19042611503565b10156104ed576001600160a01b0384166000908152600c602090815260408083208484529091529020546104e690849061099a565b92506104f2565b610504565b806104fc8161154a565b91505061047b565b505b50919050565b6040805160008082526020820190925261052b908590859085906108a9565b949350505050565b60008285511461054257600080fd5b8284511461054f57600080fd5b603283111561055d57600080fd5b6000805b86518110156105a15761058d82878381518110610580576105806115dd565b602002602001015161099a565b91508061059981611596565b915050610561565b508281146105ae57600080fd5b60005b8651811015610609576105f68782815181106105cf576105cf6115dd565b60200260200101518783815181106105e9576105e96115dd565b6020026020010151610885565b508061060181611596565b9150506105b1565b5060019695505050505050565b60006106213361030d565b61062d5750600061052b565b6040518060c00160405280336001600160a01b03168152602001866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200161067a846109b8565b6001600160e01b03191690528051600d80546001600160a01b03199081166001600160a01b03938416178255602080850151600e805484169186169190911790556040850151600f8054909316941693909317905560608301516010556080830151805191926106f09260119290910190610eac565b5060a091909101516005909101805463ffffffff191660e09290921c9190911790556013805460ff191660011790556040516000908190309061073490869061132a565b600060405180830381855af49150503d806000811461076f576040519150601f19603f3d011682016040523d82523d6000602084013e610774565b606091505b5091509150816107895760009250505061052b565b50506013805460ff19169055506001949350505050565b6006546001600160a01b031633146107b757600080fd5b6009805460ff19168215159081179091556040519081527f496fea9afdf007a7bf7959a6a84779821251106856fdab84d828e6ebe76dcbfe9060200160405180910390a150565b6006546001600160a01b0316331461081557600080fd5b6001600160a01b038216600081815260086020908152604091829020805460ff19168515159081179091558251938452908301527f4eb3ab22e0067719f1735d8d83b196fa76f280e566939b08a8fd52131e67cdaf910160405180910390a15050565b6005805461035b90611561565b604080516000808252602082019092526108a290849084906108ec565b9392505050565b60006108b6858585610a50565b6108c2576108c26115b1565b833b156108e1576108d585858585610c79565b6108e1576108e16115b1565b506001949350505050565b60006108f88484610d0c565b610904576109046115b1565b833b156109235761091733858585610c79565b610923576109236115b1565b5060019392505050565b60135460ff1661093f5761093f6115b1565b600d54600e5460105460408051600081526001600160a01b03948516602082015293909216838301526060830152517ff2437bb3d950b968625757c8878714de92924bf3f774677a83c75a8cb34abd7d9181900360800190a1565b60006109a682846113e1565b905082811015610443576104436115b1565b60008060048351106109cb5760046109ce565b82515b905060005b8181101561050457806109e7600184611503565b6109f19190611503565b6109fc9060086114e4565b610a0790600261143c565b848281518110610a1957610a196115dd565b0160200151610a2b919060f81c6114e4565b610a399060e085901c6113e1565b60e01b925080610a4881611596565b9150506109d3565b6001600160a01b03831660009081526008602052604081205460ff1615610a7657600080fd5b600a54821115610a8557600080fd5b6001600160a01b038416600090815260016020526040902054821115610aaa57600080fd5b6006546001600160a01b031633148015610ad157506007546001600160a01b038581169116145b15610adb57610b6c565b60095460ff1615610aeb57600080fd5b600b54610b00610afa86610449565b8461099a565b1115610b0b57600080fd5b6001600160a01b038416600090815260026020908152604080832033845290915290205482811015610b3c57600080fd5b610b468184610e90565b6001600160a01b0386166000908152600260209081526040808320338452909152902055505b6001600160a01b038416600090815260016020526040902054610b8f9083610e90565b6001600160a01b038086166000908152600160205260408082209390935590851681522054610bbe908361099a565b6001600160a01b03808516600090815260016020818152604080842095909555928816808352600c8085528584208084018054808752918752968520898155429085015591909352919092529154610c159161099a565b6001600160a01b038681166000818152600c602090815260409182902060010194909455518681529187169290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3506001949350505050565b604051634c12301960e01b815260009084906001600160a01b03821690634c12301990610cb09033908a9089908990600401611346565b602060405180830381600087803b158015610cca57600080fd5b505af1158015610cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0291906112e1565b9695505050505050565b3360009081526008602052604081205460ff1615610d2957600080fd5b600a54821115610d3857600080fd5b33600090815260016020526040902054821115610d5457600080fd5b6006546001600160a01b0316331415610d6c57610d96565b60095460ff1615610d7c57600080fd5b600b54610d8b610afa33610449565b1115610d9657600080fd5b33600090815260016020526040902054610db09083610e90565b33600090815260016020526040808220929092556001600160a01b03851681522054610ddc908361099a565b6001600160a01b03841660009081526001602081815260408084209490945533808452600c808352858520808501805480885291855296862089815542908601559190945292905291549091610e32919061099a565b336000818152600c602090815260409182902060010193909355518581526001600160a01b038716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35060019392505050565b600082821115610ea257610ea26115b1565b6108a28284611503565b828054610eb890611561565b90600052602060002090601f016020900481019282610eda5760008555610f20565b82601f10610ef357805160ff1916838001178555610f20565b82800160010185558215610f20579182015b82811115610f20578251825591602001919060010190610f05565b50610f2c929150610f30565b5090565b5b80821115610f2c5760008155600101610f31565b80356001600160a01b0381168114610f5c57600080fd5b919050565b600082601f830112610f7257600080fd5b81356020610f87610f82836113bd565b61138c565b80838252828201915082860187848660051b8901011115610fa757600080fd5b60005b85811015610fc657813584529284019290840190600101610faa565b5090979650505050505050565b600082601f830112610fe457600080fd5b813567ffffffffffffffff811115610ffe57610ffe6115f3565b611011601f8201601f191660200161138c565b81815284602083860101111561102657600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561105557600080fd5b6108a282610f45565b6000806040838503121561107157600080fd5b61107a83610f45565b915061108860208401610f45565b90509250929050565b6000806000606084860312156110a657600080fd5b6110af84610f45565b92506110bd60208501610f45565b9150604084013590509250925092565b600080600080608085870312156110e357600080fd5b6110ec85610f45565b93506110fa60208601610f45565b925060408501359150606085013567ffffffffffffffff81111561111d57600080fd5b61112987828801610fd3565b91505092959194509250565b6000806040838503121561114857600080fd5b61115183610f45565b9150602083013561116181611609565b809150509250929050565b6000806040838503121561117f57600080fd5b61118883610f45565b946020939093013593505050565b6000806000606084860312156111ab57600080fd5b6111b484610f45565b925060208401359150604084013567ffffffffffffffff8111156111d757600080fd5b6111e386828701610fd3565b9150509250925092565b6000806000806080858703121561120357600080fd5b843567ffffffffffffffff8082111561121b57600080fd5b818701915087601f83011261122f57600080fd5b8135602061123f610f82836113bd565b8083825282820191508286018c848660051b890101111561125f57600080fd5b600096505b848710156112895761127581610f45565b835260019690960195918301918301611264565b50985050880135925050808211156112a057600080fd5b506112ad87828801610f61565b949794965050505060408301359260600135919050565b6000602082840312156112d657600080fd5b81356108a281611609565b6000602082840312156112f357600080fd5b81516108a281611609565b6000815180845261131681602086016020860161151a565b601f01601f19169290920160200192915050565b6000825161133c81846020870161151a565b9190910192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610d02908301846112fe565b6020815260006108a260208301846112fe565b604051601f8201601f1916810167ffffffffffffffff811182821017156113b5576113b56115f3565b604052919050565b600067ffffffffffffffff8211156113d7576113d76115f3565b5060051b60200190565b600082198211156113f4576113f46115c7565b500190565b600181815b8085111561143457816000190482111561141a5761141a6115c7565b8085161561142757918102915b93841c93908002906113fe565b509250929050565b60006108a2838360008261145257506001610443565b8161145f57506000610443565b8160018114611475576002811461147f5761149b565b6001915050610443565b60ff841115611490576114906115c7565b50506001821b610443565b5060208310610133831016604e8410600b84101617156114be575081810a610443565b6114c883836113f9565b80600019048211156114dc576114dc6115c7565b029392505050565b60008160001904831182151516156114fe576114fe6115c7565b500290565b600082821015611515576115156115c7565b500390565b60005b8381101561153557818101518382015260200161151d565b83811115611544576000848401525b50505050565b600081611559576115596115c7565b506000190190565b600181811c9082168061157557607f821691505b6020821081141561050657634e487b7160e01b600052602260045260246000fd5b60006000198214156115aa576115aa6115c7565b5060010190565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461161757600080fd5b5056fea26469706673582212207d8d6b791ebf34e53d818659e5bfcf7415240eb565dd1a4f2daea1484297282d64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
2,135
0x24d1acdbafc9b4cc6be1d156bf36cc07bc035c42
/** *Submitted for verification at Etherscan.io on 2021-12-14 */ pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); 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; } } 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 IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract Horizon is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 4500000000000*10**18; string public _name = "HORIZON"; string public _symbol= "HORIZON"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0xa353f28300C40a6954E8248D614a82048663E1eF); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner, block.timestamp ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 500000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += 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); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c064f964e68233a76f520000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea2646970667358221220f06b1091302fc2a8623337de5888a82dfb428056eb320fbb05805d0146b6500364736f6c634300080a0033
{"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"}]}}
2,136
0x8f885982473e2453afdcf4de89ac26dd280b7830
pragma solidity ^0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @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; } } contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; // how many token units a buyer gets per wei uint256 public rate; // amount of raised money in wei uint256 public weiRaised; /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) { require(_startTime >= now); require(_endTime >= _startTime); require(_rate > 0); require(_wallet != 0x0); token = createTokenContract(); startTime = _startTime; endTime = _endTime; rate = _rate; wallet = _wallet; } // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (MintableToken) { return new MintableToken(); } // fallback function can be used to buy tokens function () payable { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) payable { require(beneficiary != 0x0); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); // update state weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal constant returns (bool) { bool withinPeriod = now >= startTime && now <= endTime; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase; } // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { return now > endTime; } } contract CappedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public cap; function CappedCrowdsale(uint256 _cap) { require(_cap > 0); cap = _cap; } // overriding Crowdsale#validPurchase to add extra cap logic // @return true if investors can buy at the moment function validPurchase() internal constant returns (bool) { bool withinCap = weiRaised.add(msg.value) <= cap; return super.validPurchase() && withinCap; } // overriding Crowdsale#hasEnded to add cap logic // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { bool capReached = weiRaised >= cap; return super.hasEnded() || capReached; } } contract WithdrawVault is Ownable { using SafeMath for uint256; mapping (address => uint256) public deposited; address public wallet; function WithdrawVault(address _wallet) { require(_wallet != 0x0); wallet = _wallet; } function deposit(address investor) onlyOwner payable { deposited[investor] = deposited[investor].add(msg.value); } function close() onlyOwner { wallet.transfer(this.balance); } } 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 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); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { require(_to != address(0)); var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } 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 MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(0x0, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract FinalizableCrowdsale is Crowdsale, Ownable { using SafeMath for uint256; bool public isFinalized = false; event Finalized(); /** * @dev Must be called after crowdsale ends, to do some extra finalization * work. Calls the contract's finalization function. */ function finalize() onlyOwner { require(!isFinalized); require(hasEnded()); finalization(); Finalized(); isFinalized = true; } /** * @dev Can be overriden to add finalization logic. The overriding function * should call super.finalization() to ensure the chain of finalization is * executed entirely. */ function finalization() internal { } } contract RefundVault is Ownable { using SafeMath for uint256; enum State { Active, Refunding, Closed } mapping (address => uint256) public deposited; address public wallet; State public state; event Closed(); event RefundsEnabled(); event Refunded(address indexed beneficiary, uint256 weiAmount); function RefundVault(address _wallet) { require(_wallet != 0x0); wallet = _wallet; state = State.Active; } function deposit(address investor) onlyOwner payable { deposited[investor] = deposited[investor].add(msg.value); } function close() onlyOwner { require(state == State.Active); state = State.Closed; Closed(); wallet.transfer(this.balance); } function enableRefunds() onlyOwner { require(state == State.Active); state = State.Refunding; RefundsEnabled(); } function refund(address investor) { require(state == State.Refunding); uint256 depositedValue = deposited[investor]; deposited[investor] = 0; investor.transfer(depositedValue); Refunded(investor, depositedValue); } } 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 PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract TokenRecipient { function tokenFallback(address sender, uint256 _value, bytes _extraData) returns (bool) {} } contract Werbecoin is MintableToken, BurnableToken, PausableToken { string public constant name = "Werbecoin"; string public constant symbol = "WERBE"; uint8 public constant decimals =0; function Werbecoin() { } // -------------------------------------------------------- function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { bool result = super.transferFrom(_from, _to, _value); return result; } mapping (address => bool) stopReceive; function setStopReceive(bool stop) { stopReceive[msg.sender] = stop; } function getStopReceive() constant public returns (bool) { return stopReceive[msg.sender]; } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { require(!stopReceive[_to]); bool result = super.transfer(_to, _value); return result; } function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { bool result = super.mint(_to, _amount); return result; } function burn(uint256 _value) public { super.burn(_value); } function pause() onlyOwner whenNotPaused public { super.pause(); } function unpause() onlyOwner whenPaused public { super.unpause(); } function transferAndCall(address _recipient, uint256 _amount, bytes _data) { require(_recipient != address(0)); require(_amount <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_recipient] = balances[_recipient].add(_amount); require(TokenRecipient(_recipient).tokenFallback(msg.sender, _amount, _data)); Transfer(msg.sender, _recipient, _amount); } }
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461013757806306fdde0314610160578063095ea7b3146101ea57806318160ddd1461020e57806323b872dd14610235578063313ce5671461025f5780633f4ba83a1461028a5780634000aea0146102a157806340c10f191461030a57806342966c681461032e5780635c975abb14610346578063620346c61461035b578063661884631461037557806370a08231146103995780637ab21613146103ba5780637d64bcb4146103cf5780638456cb59146103e45780638da5cb5b146103f957806395d89b411461042a578063a9059cbb1461043f578063d73dd62314610463578063dd62ed3e14610487578063f2fde38b146104ae575b600080fd5b34801561014357600080fd5b5061014c6104cf565b604080519115158252519081900360200190f35b34801561016c57600080fd5b506101756104f0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101af578181015183820152602001610197565b50505050905090810190601f1680156101dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f657600080fd5b5061014c600160a060020a0360043516602435610527565b34801561021a57600080fd5b50610223610552565b60408051918252519081900360200190f35b34801561024157600080fd5b5061014c600160a060020a0360043581169060243516604435610558565b34801561026b57600080fd5b50610274610588565b6040805160ff9092168252519081900360200190f35b34801561029657600080fd5b5061029f61058d565b005b3480156102ad57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261029f948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506105c69650505050505050565b34801561031657600080fd5b5061014c600160a060020a036004351660243561079c565b34801561033a57600080fd5b5061029f6004356107f2565b34801561035257600080fd5b5061014c6107fe565b34801561036757600080fd5b5061029f600435151561080e565b34801561038157600080fd5b5061014c600160a060020a036004351660243561082e565b3480156103a557600080fd5b50610223600160a060020a0360043516610852565b3480156103c657600080fd5b5061014c61086d565b3480156103db57600080fd5b5061014c610883565b3480156103f057600080fd5b5061029f610901565b34801561040557600080fd5b5061040e610937565b60408051600160a060020a039092168252519081900360200190f35b34801561043657600080fd5b50610175610946565b34801561044b57600080fd5b5061014c600160a060020a036004351660243561097d565b34801561046f57600080fd5b5061014c600160a060020a03600435166024356109c9565b34801561049357600080fd5b50610223600160a060020a03600435811690602435166109ed565b3480156104ba57600080fd5b5061029f600160a060020a0360043516610a18565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051808201909152600981527f5765726265636f696e0000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561054157600080fd5b61054b8383610a73565b9392505050565b60005481565b600354600090819060a860020a900460ff161561057457600080fd5b61057f858585610b15565b95945050505050565b600081565b600354600160a060020a031633146105a457600080fd5b60035460a860020a900460ff1615156105bc57600080fd5b6105c4610b3a565b565b600160a060020a03831615156105db57600080fd5b336000908152600160205260409020548211156105f757600080fd5b33600090815260016020526040902054610617908363ffffffff610bb316565b3360009081526001602052604080822092909255600160a060020a03851681522054610649908363ffffffff610bc516565b600160a060020a03841660008181526001602090815260408083209490945592517fc0ee0b8a000000000000000000000000000000000000000000000000000000008152336004820181815260248301889052606060448401908152875160648501528751959663c0ee0b8a9693958a958a956084909101928601918190849084905b838110156106e45781810151838201526020016106cc565b50505050905090810190601f1680156107115780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b15801561073257600080fd5b505af1158015610746573d6000803e3d6000fd5b505050506040513d602081101561075c57600080fd5b5051151561076957600080fd5b604080518381529051600160a060020a0385169133916000805160206111688339815191529181900360200190a3505050565b6003546000908190600160a060020a031633146107b857600080fd5b60035474010000000000000000000000000000000000000000900460ff16156107e057600080fd5b6107ea8484610bd4565b949350505050565b6107fb81610cde565b50565b60035460a860020a900460ff1681565b336000908152600460205260409020805460ff1916911515919091179055565b60035460009060a860020a900460ff161561084857600080fd5b61054b8383610d77565b600160a060020a031660009081526001602052604090205490565b3360009081526004602052604090205460ff1690565b600354600090600160a060020a0316331461089d57600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a0316331461091857600080fd5b60035460a860020a900460ff161561092f57600080fd5b6105c4610e67565b600354600160a060020a031681565b60408051808201909152600581527f5745524245000000000000000000000000000000000000000000000000000000602082015281565b600354600090819060a860020a900460ff161561099957600080fd5b600160a060020a03841660009081526004602052604090205460ff16156109bf57600080fd5b6107ea8484610ee5565b60035460009060a860020a900460ff16156109e357600080fd5b61054b8383610f09565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610a2f57600080fd5b600160a060020a0381161515610a4457600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000811580610aa35750336000908152600260209081526040808320600160a060020a0387168452909152902054155b1515610aae57600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60035460009060a860020a900460ff1615610b2f57600080fd5b6107ea848484610fa2565b600354600160a060020a03163314610b5157600080fd5b60035460a860020a900460ff161515610b6957600080fd5b6003805475ff000000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600082821115610bbf57fe5b50900390565b60008282018381101561054b57fe5b600354600090600160a060020a03163314610bee57600080fd5b60035474010000000000000000000000000000000000000000900460ff1615610c1657600080fd5b600054610c29908363ffffffff610bc516565b6000908155600160a060020a038416815260016020526040902054610c54908363ffffffff610bc516565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206111688339815191529181900360200190a350600192915050565b6000808211610cec57600080fd5b5033600081815260016020526040902054610d0d908363ffffffff610bb316565b600160a060020a03821660009081526001602052604081209190915554610d3a908363ffffffff610bb316565b60009081556040518391600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59190a35050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610dcc57336000908152600260209081526040808320600160a060020a0388168452909152812055610e01565b610ddc818463ffffffff610bb316565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600354600160a060020a03163314610e7e57600080fd5b60035460a860020a900460ff1615610e9557600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b60035460009060a860020a900460ff1615610eff57600080fd5b61054b83836110b2565b336000908152600260209081526040808320600160a060020a0386168452909152812054610f3d908363ffffffff610bc516565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600080600160a060020a0384161515610fba57600080fd5b50600160a060020a03841660008181526002602090815260408083203384528252808320549383526001909152902054610ffa908463ffffffff610bb316565b600160a060020a03808716600090815260016020526040808220939093559086168152205461102f908463ffffffff610bc516565b600160a060020a038516600090815260016020526040902055611058818463ffffffff610bb316565b600160a060020a0380871660008181526002602090815260408083203384528252918290209490945580518781529051928816939192600080516020611168833981519152929181900390910190a3506001949350505050565b6000600160a060020a03831615156110c957600080fd5b336000908152600160205260409020546110e9908363ffffffff610bb316565b3360009081526001602052604080822092909255600160a060020a0385168152205461111b908363ffffffff610bc516565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233926000805160206111688339815191529281900390910190a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058202e6b53dfe8f318fde9281d598e421a2abe4102e22ff7735f2283fb16466103fe0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,137
0x5c6E9D8d4761dbd964e2029d46fAbCd180aa2E5d
/** *Submitted for verification at Etherscan.io on 2021-11-03 */ /* "MEET THE ZOMBIE CAT : a cat with nothing to lose coming back from the dead to reach the moon and beyond." Website : https://www.zombiecat.land/ TG : https://t.me/ZombieCatPortal */ /** * * * * 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 ZombieCat 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 = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Zombie Cat"; string private constant _symbol = unicode"ZCAT"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 7; 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 = false; bool private _noTaxMode = false; bool private inSwap = false; uint256 private walletLimitDuration; struct User { uint256 buyCD; 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 _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(5).div(100)); // 5% limit for 1h } } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ 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 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); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; walletLimitDuration = block.timestamp + (60 minutes); } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _FeeAddress); require(team <= 7); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _FeeAddress); require(tax <= 1); _taxFee = tax; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f7146104fb578063db92dbb614610524578063dd62ed3e1461054f578063e6ec64ec1461058c57610171565b8063c3c8cd80146104a4578063c4081a4c146104bb578063c9567bf9146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806395d89b4114610413578063a9059cbb1461043e578063b515566a1461047b57610171565b8063313ce56711610123578063313ce5671461029a5780633bbac579146102c5578063437823ec146103025780634b740b161461032b5780635d098b38146103545780636fc3eaec1461037d57610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806323b872dd14610209578063273123b71461024657806327f3a72a1461026f57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105b5565b6040516101989190613331565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612e77565b6105f2565b6040516101d59190613316565b60405180910390f35b3480156101ea57600080fd5b506101f3610610565b60405161020091906134b3565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612e28565b610621565b60405161023d9190613316565b60405180910390f35b34801561025257600080fd5b5061026d60048036038101906102689190612d71565b6106fa565b005b34801561027b57600080fd5b506102846107ea565b60405161029191906134b3565b60405180910390f35b3480156102a657600080fd5b506102af6107fa565b6040516102bc9190613528565b60405180910390f35b3480156102d157600080fd5b506102ec60048036038101906102e79190612d71565b610803565b6040516102f99190613316565b60405180910390f35b34801561030e57600080fd5b5061032960048036038101906103249190612dc3565b610859565b005b34801561033757600080fd5b50610352600480360381019061034d9190612ef4565b610915565b005b34801561036057600080fd5b5061037b60048036038101906103769190612dc3565b610993565b005b34801561038957600080fd5b50610392610b0a565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612d71565b610b7c565b6040516103c891906134b3565b60405180910390f35b3480156103dd57600080fd5b506103e6610bcd565b005b3480156103f457600080fd5b506103fd610d20565b60405161040a9190613248565b60405180910390f35b34801561041f57600080fd5b50610428610d49565b6040516104359190613331565b60405180910390f35b34801561044a57600080fd5b5061046560048036038101906104609190612e77565b610d86565b6040516104729190613316565b60405180910390f35b34801561048757600080fd5b506104a2600480360381019061049d9190612eb3565b610da4565b005b3480156104b057600080fd5b506104b9611026565b005b3480156104c757600080fd5b506104e260048036038101906104dd9190612f46565b6110a0565b005b3480156104f057600080fd5b506104f9611119565b005b34801561050757600080fd5b50610522600480360381019061051d9190612dc3565b611644565b005b34801561053057600080fd5b50610539611700565b60405161054691906134b3565b60405180910390f35b34801561055b57600080fd5b5061057660048036038101906105719190612dec565b611732565b60405161058391906134b3565b60405180910390f35b34801561059857600080fd5b506105b360048036038101906105ae9190612f46565b6117b9565b005b60606040518060400160405280600a81526020017f5a6f6d6269652043617400000000000000000000000000000000000000000000815250905090565b60006106066105ff611832565b848461183a565b6001905092915050565b6000683635c9adc5dea00000905090565b600061062e848484611a05565b6106ef8461063a611832565b6106ea85604051806060016040528060288152602001613bec60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106a0611832565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120579092919063ffffffff16565b61183a565b600190509392505050565b610702611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610786906133f3565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006107f530610b7c565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661089a611832565b73ffffffffffffffffffffffffffffffffffffffff16146108ba57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610956611832565b73ffffffffffffffffffffffffffffffffffffffff161461097657600080fd5b80601060156101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d4611832565b73ffffffffffffffffffffffffffffffffffffffff16146109f457600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4b611832565b73ffffffffffffffffffffffffffffffffffffffff1614610b6b57600080fd5b6000479050610b79816120bb565b50565b6000610bc6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121b6565b9050919050565b610bd5611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c59906133f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5a43415400000000000000000000000000000000000000000000000000000000815250905090565b6000610d9a610d93611832565b8484611a05565b6001905092915050565b610dac611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e30906133f3565b60405180910390fd5b60005b815181101561102257601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610eb7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610f715750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f50577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561100f57600160066000848481518110610fb5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061101a906137db565b915050610e3c565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611067611832565b73ffffffffffffffffffffffffffffffffffffffff161461108757600080fd5b600061109230610b7c565b905061109d81612224565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e1611832565b73ffffffffffffffffffffffffffffffffffffffff161461110157600080fd5b600181111561110f57600080fd5b8060098190555050565b611121611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a5906133f3565b60405180910390fd5b601060149054906101000a900460ff16156111fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f590613473565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061128e30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061183a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156112d457600080fd5b505afa1580156112e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130c9190612d9a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561136e57600080fd5b505afa158015611382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a69190612d9a565b6040518363ffffffff1660e01b81526004016113c3929190613263565b602060405180830381600087803b1580156113dd57600080fd5b505af11580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114159190612d9a565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061149e30610b7c565b6000806114a9610d20565b426040518863ffffffff1660e01b81526004016114cb969594939291906132b5565b6060604051808303818588803b1580156114e457600080fd5b505af11580156114f8573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061151d9190612f6f565b505050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016115bf92919061328c565b602060405180830381600087803b1580156115d957600080fd5b505af11580156115ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116119190612f1d565b506001601060146101000a81548160ff021916908315150217905550610e104261163b91906135e9565b60118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611685611832565b73ffffffffffffffffffffffffffffffffffffffff16146116a557600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061172d601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117fa611832565b73ffffffffffffffffffffffffffffffffffffffff161461181a57600080fd5b600781111561182857600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a190613453565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561191a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191190613393565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119f891906134b3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6c90613433565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ae5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611adc90613353565b60405180910390fd5b60008111611b28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1f90613413565b60405180910390fd5b611b30610d20565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b9e5750611b6e610d20565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7d57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c475750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611c5057600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611cfb5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e0d57601060149054906101000a900460ff16611da5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9c90613493565b60405180910390fd5b426011541115611e0c576000611dba83610b7c565b9050611dec6064611dde6005683635c9adc5dea0000061251e90919063ffffffff16565b61259990919063ffffffff16565b611dff82846125e390919063ffffffff16565b1115611e0a57600080fd5b505b5b6000611e1830610b7c565b9050601060169054906101000a900460ff16158015611e855750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e9d5750601060149054906101000a900460ff165b15611f7b576000811115611f6157611efc6064611eee6005611ee0601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61251e90919063ffffffff16565b61259990919063ffffffff16565b811115611f5757611f546064611f466005611f38601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61251e90919063ffffffff16565b61259990919063ffffffff16565b90505b611f6081612224565b5b60004790506000811115611f7957611f78476120bb565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120245750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061203b5750601060159054906101000a900460ff165b1561204557600090505b61205184848484612641565b50505050565b600083831115829061209f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120969190613331565b60405180910390fd5b50600083856120ae91906136ca565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61210b60028461259990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612136573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61218760028461259990919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121b2573d6000803e3d6000fd5b5050565b60006007548211156121fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f490613373565b60405180910390fd5b600061220761266e565b905061221c818461259990919063ffffffff16565b915050919050565b6001601060166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612282577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122b05781602001602082028036833780820191505090505b50905030816000815181106122ee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561239057600080fd5b505afa1580156123a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123c89190612d9a565b81600181518110612402577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061246930600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461183a565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124cd9594939291906134ce565b600060405180830381600087803b1580156124e757600080fd5b505af11580156124fb573d6000803e3d6000fd5b50505050506000601060166101000a81548160ff02191690831515021790555050565b6000808314156125315760009050612593565b6000828461253f9190613670565b905082848261254e919061363f565b1461258e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612585906133d3565b60405180910390fd5b809150505b92915050565b60006125db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612699565b905092915050565b60008082846125f291906135e9565b905083811015612637576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262e906133b3565b60405180910390fd5b8091505092915050565b8061264f5761264e6126fc565b5b61265a84848461273f565b806126685761266761290a565b5b50505050565b600080600061267b61291e565b91509150612692818361259990919063ffffffff16565b9250505090565b600080831182906126e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126d79190613331565b60405180910390fd5b50600083856126ef919061363f565b9050809150509392505050565b600060095414801561271057506000600a54145b1561271a5761273d565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b60008060008060008061275187612980565b9550955095509550955095506127af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129e890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061284485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125e390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061289081612a32565b61289a8483612aef565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128f791906134b3565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612954683635c9adc5dea0000060075461259990919063ffffffff16565b82101561297357600754683635c9adc5dea0000093509350505061297c565b81819350935050505b9091565b600080600080600080600080600061299d8a600954600a54612b29565b92509250925060006129ad61266e565b905060008060006129c08e878787612bbf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a2a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612057565b905092915050565b6000612a3c61266e565b90506000612a53828461251e90919063ffffffff16565b9050612aa781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125e390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b04826007546129e890919063ffffffff16565b600781905550612b1f816008546125e390919063ffffffff16565b6008819055505050565b600080600080612b556064612b47888a61251e90919063ffffffff16565b61259990919063ffffffff16565b90506000612b7f6064612b71888b61251e90919063ffffffff16565b61259990919063ffffffff16565b90506000612ba882612b9a858c6129e890919063ffffffff16565b6129e890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bd8858961251e90919063ffffffff16565b90506000612bef868961251e90919063ffffffff16565b90506000612c06878961251e90919063ffffffff16565b90506000612c2f82612c2185876129e890919063ffffffff16565b6129e890919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612c5b612c5684613568565b613543565b90508083825260208201905082856020860282011115612c7a57600080fd5b60005b85811015612caa5781612c908882612cb4565b845260208401935060208301925050600181019050612c7d565b5050509392505050565b600081359050612cc381613b8f565b92915050565b600081519050612cd881613b8f565b92915050565b600081359050612ced81613ba6565b92915050565b600082601f830112612d0457600080fd5b8135612d14848260208601612c48565b91505092915050565b600081359050612d2c81613bbd565b92915050565b600081519050612d4181613bbd565b92915050565b600081359050612d5681613bd4565b92915050565b600081519050612d6b81613bd4565b92915050565b600060208284031215612d8357600080fd5b6000612d9184828501612cb4565b91505092915050565b600060208284031215612dac57600080fd5b6000612dba84828501612cc9565b91505092915050565b600060208284031215612dd557600080fd5b6000612de384828501612cde565b91505092915050565b60008060408385031215612dff57600080fd5b6000612e0d85828601612cb4565b9250506020612e1e85828601612cb4565b9150509250929050565b600080600060608486031215612e3d57600080fd5b6000612e4b86828701612cb4565b9350506020612e5c86828701612cb4565b9250506040612e6d86828701612d47565b9150509250925092565b60008060408385031215612e8a57600080fd5b6000612e9885828601612cb4565b9250506020612ea985828601612d47565b9150509250929050565b600060208284031215612ec557600080fd5b600082013567ffffffffffffffff811115612edf57600080fd5b612eeb84828501612cf3565b91505092915050565b600060208284031215612f0657600080fd5b6000612f1484828501612d1d565b91505092915050565b600060208284031215612f2f57600080fd5b6000612f3d84828501612d32565b91505092915050565b600060208284031215612f5857600080fd5b6000612f6684828501612d47565b91505092915050565b600080600060608486031215612f8457600080fd5b6000612f9286828701612d5c565b9350506020612fa386828701612d5c565b9250506040612fb486828701612d5c565b9150509250925092565b6000612fca8383612fd6565b60208301905092915050565b612fdf816136fe565b82525050565b612fee816136fe565b82525050565b6000612fff826135a4565b61300981856135c7565b935061301483613594565b8060005b8381101561304557815161302c8882612fbe565b9750613037836135ba565b925050600181019050613018565b5085935050505092915050565b61305b81613722565b82525050565b61306a81613765565b82525050565b600061307b826135af565b61308581856135d8565b9350613095818560208601613777565b61309e816138b1565b840191505092915050565b60006130b66023836135d8565b91506130c1826138c2565b604082019050919050565b60006130d9602a836135d8565b91506130e482613911565b604082019050919050565b60006130fc6022836135d8565b915061310782613960565b604082019050919050565b600061311f601b836135d8565b915061312a826139af565b602082019050919050565b60006131426021836135d8565b915061314d826139d8565b604082019050919050565b60006131656020836135d8565b915061317082613a27565b602082019050919050565b60006131886029836135d8565b915061319382613a50565b604082019050919050565b60006131ab6025836135d8565b91506131b682613a9f565b604082019050919050565b60006131ce6024836135d8565b91506131d982613aee565b604082019050919050565b60006131f16017836135d8565b91506131fc82613b3d565b602082019050919050565b60006132146018836135d8565b915061321f82613b66565b602082019050919050565b6132338161374e565b82525050565b61324281613758565b82525050565b600060208201905061325d6000830184612fe5565b92915050565b60006040820190506132786000830185612fe5565b6132856020830184612fe5565b9392505050565b60006040820190506132a16000830185612fe5565b6132ae602083018461322a565b9392505050565b600060c0820190506132ca6000830189612fe5565b6132d7602083018861322a565b6132e46040830187613061565b6132f16060830186613061565b6132fe6080830185612fe5565b61330b60a083018461322a565b979650505050505050565b600060208201905061332b6000830184613052565b92915050565b6000602082019050818103600083015261334b8184613070565b905092915050565b6000602082019050818103600083015261336c816130a9565b9050919050565b6000602082019050818103600083015261338c816130cc565b9050919050565b600060208201905081810360008301526133ac816130ef565b9050919050565b600060208201905081810360008301526133cc81613112565b9050919050565b600060208201905081810360008301526133ec81613135565b9050919050565b6000602082019050818103600083015261340c81613158565b9050919050565b6000602082019050818103600083015261342c8161317b565b9050919050565b6000602082019050818103600083015261344c8161319e565b9050919050565b6000602082019050818103600083015261346c816131c1565b9050919050565b6000602082019050818103600083015261348c816131e4565b9050919050565b600060208201905081810360008301526134ac81613207565b9050919050565b60006020820190506134c8600083018461322a565b92915050565b600060a0820190506134e3600083018861322a565b6134f06020830187613061565b81810360408301526135028186612ff4565b90506135116060830185612fe5565b61351e608083018461322a565b9695505050505050565b600060208201905061353d6000830184613239565b92915050565b600061354d61355e565b905061355982826137aa565b919050565b6000604051905090565b600067ffffffffffffffff82111561358357613582613882565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006135f48261374e565b91506135ff8361374e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561363457613633613824565b5b828201905092915050565b600061364a8261374e565b91506136558361374e565b92508261366557613664613853565b5b828204905092915050565b600061367b8261374e565b91506136868361374e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136bf576136be613824565b5b828202905092915050565b60006136d58261374e565b91506136e08361374e565b9250828210156136f3576136f2613824565b5b828203905092915050565b60006137098261372e565b9050919050565b600061371b8261372e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006137708261374e565b9050919050565b60005b8381101561379557808201518184015260208101905061377a565b838111156137a4576000848401525b50505050565b6137b3826138b1565b810181811067ffffffffffffffff821117156137d2576137d1613882565b5b80604052505050565b60006137e68261374e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561381957613818613824565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613b98816136fe565b8114613ba357600080fd5b50565b613baf81613710565b8114613bba57600080fd5b50565b613bc681613722565b8114613bd157600080fd5b50565b613bdd8161374e565b8114613be857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204a288050c63daa47b5f100c039d56a2dbe4e9f96686eb6f49b64ba282e15422764736f6c63430008040033
{"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"}]}}
2,138
0x4173c32628ecaed1211cc7a4d01a894e8f7f5c54
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; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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 EscobarcoinToken is StandardToken { using SafeMath for uint256; string public name = "EscobarcoinToken"; string public symbol = "ESCO"; uint256 public decimals = 18; uint256 public totalSupply = 250000000 * (uint256(10) ** decimals); //uint256 public rate = 9000; //rate per ether uint256 public totalRaised; // total ether raised (in wei) uint256 public startTimestamp; // timestamp after which ICO will start uint256 public durationSeconds = 4 * 7 * 24 * 60 * 60; // 4 weeks uint256 public minCap; // the ICO ether goal (in wei) uint256 public maxCap; // the ICO ether max cap (in wei) /** * Address which will receive raised funds * and owns the total supply of tokens */ address public fundsWallet; function EscobarcoinToken() { fundsWallet = 0x1EC478936a49278c8754021927a2ab0018594D40; startTimestamp = 1526817600; minCap = 1667 * (uint256(10) ** decimals); maxCap = 16667 * (uint256(10) ** decimals); // initially assign all tokens to the fundsWallet balances[fundsWallet] = totalSupply; Transfer(0x0, fundsWallet, totalSupply); } function() isIcoOpen payable { totalRaised = totalRaised.add(msg.value); uint256 tokenAmount = calculateTokenAmount(msg.value); balances[fundsWallet] = balances[fundsWallet].sub(tokenAmount); balances[msg.sender] = balances[msg.sender].add(tokenAmount); Transfer(fundsWallet, msg.sender, tokenAmount); // immediately transfer ether to fundsWallet fundsWallet.transfer(msg.value); } function calculateTokenAmount(uint256 weiAmount) constant returns(uint256) { // standard rate: 1 ETH : 9000 ESP uint256 tokenAmount = weiAmount.mul(9000); if (now <= startTimestamp + 7 days) { // +50% bonus during first week return tokenAmount.mul(150).div(100); } else if (now <= startTimestamp + 14 days) { // +20% bonus during second week return tokenAmount.mul(120).div(100); } else if (now <= startTimestamp + 21 days) { // +15% bonus during third week return tokenAmount.mul(115).div(100); } else if (now <= startTimestamp + 28 days) { // +10% bonus during final week return tokenAmount.mul(110).div(100); } else { // +10% bonus during final week return tokenAmount.mul(110).div(100); } } function transfer(address _to, uint _value) isIcoFinished returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) isIcoFinished returns (bool) { return super.transferFrom(_from, _to, _value); } modifier isIcoOpen() { require(now >= startTimestamp); require(now <= (startTimestamp + durationSeconds) || totalRaised < minCap); require(totalRaised <= maxCap); _; } modifier isIcoFinished() { require(now >= startTimestamp); require(totalRaised >= maxCap || (now >= (startTimestamp + durationSeconds) && totalRaised >= minCap)); _; } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146103c8578063095ea7b31461045857806318160ddd146104bd5780632194f3a2146104e857806323548b8b1461053f57806323b872dd1461056a578063313ce567146105ef5780633fa615b01461061a578063661884631461064557806370a08231146106aa57806395d89b41146107015780639acba2af14610791578063a24bcf46146107bc578063a9059cbb146107fd578063c5c4744c14610862578063d73dd6231461088d578063dd62ed3e146108f2578063e6fd48bc14610969575b6000600854421015151561010f57600080fd5b60095460085401421115806101275750600a54600754105b151561013257600080fd5b600b546007541115151561014557600080fd5b61015a3460075461099490919063ffffffff16565b600781905550610169346109b0565b90506101de81600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610af290919063ffffffff16565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610293816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461099490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156103c4573d6000803e3d6000fd5b5050005b3480156103d457600080fd5b506103dd610b0b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041d578082015181840152602081019050610402565b50505050905090810190601f16801561044a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561046457600080fd5b506104a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba9565b604051808215151515815260200191505060405180910390f35b3480156104c957600080fd5b506104d2610c9b565b6040518082815260200191505060405180910390f35b3480156104f457600080fd5b506104fd610ca1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054b57600080fd5b50610554610cc7565b6040518082815260200191505060405180910390f35b34801561057657600080fd5b506105d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ccd565b604051808215151515815260200191505060405180910390f35b3480156105fb57600080fd5b50610604610d28565b6040518082815260200191505060405180910390f35b34801561062657600080fd5b5061062f610d2e565b6040518082815260200191505060405180910390f35b34801561065157600080fd5b50610690600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d34565b604051808215151515815260200191505060405180910390f35b3480156106b657600080fd5b506106eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc5565b6040518082815260200191505060405180910390f35b34801561070d57600080fd5b5061071661100d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075657808201518184015260208101905061073b565b50505050905090810190601f1680156107835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079d57600080fd5b506107a66110ab565b6040518082815260200191505060405180910390f35b3480156107c857600080fd5b506107e7600480360381019080803590602001909291905050506109b0565b6040518082815260200191505060405180910390f35b34801561080957600080fd5b50610848600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b1565b604051808215151515815260200191505060405180910390f35b34801561086e57600080fd5b5061087761110a565b6040518082815260200191505060405180910390f35b34801561089957600080fd5b506108d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611110565b604051808215151515815260200191505060405180910390f35b3480156108fe57600080fd5b50610953600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061130c565b6040518082815260200191505060405180910390f35b34801561097557600080fd5b5061097e611393565b6040518082815260200191505060405180910390f35b600081830190508281101515156109a757fe5b80905092915050565b6000806109c86123288461139990919063ffffffff16565b905062093a806008540142111515610a0857610a0160646109f360968461139990919063ffffffff16565b6113d190919063ffffffff16565b9150610aec565b621275006008540142111515610a4657610a3f6064610a3160788461139990919063ffffffff16565b6113d190919063ffffffff16565b9150610aec565b621baf806008540142111515610a8457610a7d6064610a6f60738461139990919063ffffffff16565b6113d190919063ffffffff16565b9150610aec565b6224ea006008540142111515610ac257610abb6064610aad606e8461139990919063ffffffff16565b6113d190919063ffffffff16565b9150610aec565b610ae96064610adb606e8461139990919063ffffffff16565b6113d190919063ffffffff16565b91505b50919050565b6000828211151515610b0057fe5b818303905092915050565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ba15780601f10610b7657610100808354040283529160200191610ba1565b820191906000526020600020905b815481529060010190602001808311610b8457829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b5481565b60006008544210151515610ce057600080fd5b600b54600754101580610d095750600954600854014210158015610d085750600a5460075410155b5b1515610d1457600080fd5b610d1f8484846113e7565b90509392505050565b60055481565b600a5481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e45576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ed9565b610e588382610af290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110a35780601f10611078576101008083540402835291602001916110a3565b820191906000526020600020905b81548152906001019060200180831161108657829003601f168201915b505050505081565b60095481565b600060085442101515156110c457600080fd5b600b546007541015806110ed57506009546008540142101580156110ec5750600a5460075410155b5b15156110f857600080fd5b61110283836117a1565b905092915050565b60075481565b60006111a182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461099490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60085481565b6000808314156113ac57600090506113cb565b81830290508183828115156113bd57fe5b041415156113c757fe5b8090505b92915050565b600081838115156113de57fe5b04905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561142457600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561147157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114fc57600080fd5b61154d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610af290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115e0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461099490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116b182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610af290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156117de57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561182b57600080fd5b61187c826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610af290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061190f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461099490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820ed700a1ad56ae2f9c77fe427f8f4a3bb21e860a9bc9623c49b15fc5556ac49df0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
2,139
0xbb6a2327216c6bfc0d67cee6e8ee49e85998fd07
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; abstract contract IDFSRegistry { function getAddr(bytes32 _id) public view virtual returns (address); function addNewContract( bytes32 _id, address _contractAddr, uint256 _waitPeriod ) public virtual; function startContractChange(bytes32 _id, address _newContractAddr) public virtual; function approveContractChange(bytes32 _id) public virtual; function cancelContractChange(bytes32 _id) public virtual; function changeWaitPeriod(bytes32 _id, uint256 _newWaitPeriod) public virtual; } interface IERC20 { function totalSupply() external view returns (uint256 supply); function balanceOf(address _owner) external view returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom( address _from, address _to, uint256 _value ) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) external view returns (uint256 remaining); function decimals() external view returns (uint256 digits); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: weiValue}(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library 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 Deprecated. This function has issues similar to the ones found in * {ERC20-approve}, and its usage is discouraged. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { _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"); } } } /// @title AdminAuth Handles owner/admin priviligies over smart contracts contract AdminAuth { using SafeERC20 for IERC20; address public owner; address public admin; modifier onlyOwner() { require(owner == msg.sender, "msg.sender not owner"); _; } modifier onlyAdmin() { require(admin == msg.sender, "msg.sender not admin"); _; } constructor() { owner = msg.sender; admin = 0x25eFA336886C74eA8E282ac466BdCd0199f85BB9; } /// @notice Admin is set by owner first time, after that admin is super role and has permission to change owner /// @param _admin Address of multisig that becomes admin function setAdmin(address _admin) public onlyOwner { require(admin == address(0), "admin is already set"); admin = _admin; } /// @notice Admin is able to set new admin /// @param _admin Address of multisig that becomes new admin function changeAdmin(address _admin) public onlyAdmin { admin = _admin; } /// @notice Admin is able to change owner /// @param _owner Address of new owner function changeOwner(address _owner) public onlyAdmin { owner = _owner; } /// @notice withdraw stuck funds function withdrawStuckFunds(address _token, address _receiver, uint256 _amount) public onlyOwner { if (_token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) { payable(_receiver).transfer(_amount); } else { IERC20(_token).safeTransfer(_receiver, _amount); } } /// @notice Destroy the contract function kill() public onlyAdmin { selfdestruct(payable(owner)); } } abstract contract IProxyRegistry { function proxies(address _owner) public virtual view returns (address); function build(address) public virtual returns (address); } abstract contract IDSProxy { // function execute(bytes memory _code, bytes memory _data) // public // payable // virtual // returns (address, bytes32); function execute(address _target, bytes memory _data) public payable virtual returns (bytes32); function setCache(address _cacheAddr) public payable virtual returns (bool); function owner() public view virtual returns (address); } /// @title Checks Mcd registry and replaces the proxy addr if owner changed contract DFSProxyRegistry is AdminAuth { IProxyRegistry public mcdRegistry = IProxyRegistry(0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4); mapping(address => address) public changedOwners; /// @notice Changes the proxy that is returned for the user /// @dev Used when the user changed DSProxy ownership himself function changeMcdOwner(address _user, address _proxy) public onlyOwner { if (IDSProxy(_proxy).owner() == _user) { changedOwners[_user] = _proxy; } } /// @notice Returns the proxy address associated with the user account /// @dev If user changed ownership of Dsproxy admin can hardcode replacement function getMcdProxy(address _user) public view returns (address) { address proxyAddr = mcdRegistry.proxies(_user); // if check changed proxies if (changedOwners[_user] != address(0)) { return changedOwners[_user]; } return proxyAddr; } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638f283970116100715780638f28397014610156578063a6f9dae11461017c578063bce673f3146101a2578063c579d490146101aa578063cd4cc05a146101e0578063f851a44014610206576100a9565b806301240eef146100ae57806341c0e1b5146100f0578063704b6c02146100fa5780638684cf1e146101205780638da5cb5b1461014e575b600080fd5b6100d4600480360360208110156100c457600080fd5b50356001600160a01b031661020e565b604080516001600160a01b039092168252519081900360200190f35b6100f8610229565b005b6100f86004803603602081101561011057600080fd5b50356001600160a01b031661028d565b6100f86004803603604081101561013657600080fd5b506001600160a01b038135811691602001351661035a565b6100d4610461565b6100f86004803603602081101561016c57600080fd5b50356001600160a01b0316610470565b6100f86004803603602081101561019257600080fd5b50356001600160a01b03166104c6565b6100d461053e565b6100f8600480360360608110156101c057600080fd5b506001600160a01b0381358116916020810135909116906040013561054d565b6100d4600480360360208110156101f657600080fd5b50356001600160a01b031661061d565b6100d46106e5565b6003602052600090815260409020546001600160a01b031681565b6001546001600160a01b0316331461027f576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1030b236b4b760611b604482015290519081900360640190fd5b6000546001600160a01b0316ff5b6000546001600160a01b031633146102e3576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1037bbb732b960611b604482015290519081900360640190fd5b6001546001600160a01b031615610338576040805162461bcd60e51b815260206004820152601460248201527318591b5a5b881a5cc8185b1c9958591e481cd95d60621b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146103b0576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1037bbb732b960611b604482015290519081900360640190fd5b816001600160a01b0316816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103f357600080fd5b505afa158015610407573d6000803e3d6000fd5b505050506040513d602081101561041d57600080fd5b50516001600160a01b0316141561045d576001600160a01b03828116600090815260036020526040902080546001600160a01b0319169183169190911790555b5050565b6000546001600160a01b031681565b6001546001600160a01b03163314610338576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1030b236b4b760611b604482015290519081900360640190fd5b6001546001600160a01b0316331461051c576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1030b236b4b760611b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b6000546001600160a01b031633146105a3576040805162461bcd60e51b815260206004820152601460248201527336b9b39739b2b73232b9103737ba1037bbb732b960611b604482015290519081900360640190fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0384161415610604576040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156105fe573d6000803e3d6000fd5b50610618565b6106186001600160a01b03841683836106f4565b505050565b6002546040805163c455279160e01b81526001600160a01b03848116600483015291516000938493169163c4552791916024808301926020929190829003018186803b15801561066c57600080fd5b505afa158015610680573d6000803e3d6000fd5b505050506040513d602081101561069657600080fd5b50516001600160a01b0384811660009081526003602052604090205491925016156106dd5750506001600160a01b03808216600090815260036020526040902054166106e0565b90505b919050565b6001546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526106189084906060610796826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166107f29092919063ffffffff16565b805190915015610618578080602001905160208110156107b557600080fd5b50516106185760405162461bcd60e51b815260040180806020018281038252602a8152602001806109ee602a913960400191505060405180910390fd5b60606108018484600085610809565b949350505050565b6060610814856109b4565b610865576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106108a45780518252601f199092019160209182019101610885565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610906576040519150601f19603f3d011682016040523d82523d6000602084013e61090b565b606091505b5091509150811561091f5791506108019050565b80511561092f5780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610979578181015183820152602001610961565b50505050905090810190601f1680156109a65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061080157505015159291505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212203205aeff8a21cb6b69dec580b0082d71394e3580006ef6dde069e2303b1ad52c64736f6c63430007050033
{"success": true, "error": null, "results": {}}
2,140
0x54499154ed336adb163bba88feb461102dff456d
/** *Submitted for verification at Etherscan.io on 2021-03-21 */ pragma solidity ^0.6.0; // SPDX-License-Identifier: UNLICENSED /** * @title SafeMath * @dev Math operations with safety checks that throw on error * */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function ceil(uint a, uint m) internal pure returns (uint r) { return (a + m - 1) / m * m; } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- abstract contract ERC20Interface { function totalSupply() public virtual view returns (uint); function balanceOf(address tokenOwner) public virtual view returns (uint256 balance); function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining); function transfer(address to, uint256 tokens) public virtual returns (bool success); function approve(address spender, uint256 tokens) public virtual returns (bool success); function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success); event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); } // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address payable public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address payable _newOwner) public onlyOwner { owner = _newOwner; emit OwnershipTransferred(msg.sender, _newOwner); } } contract HedgeHog is ERC20Interface, Owned { using SafeMath for uint256; string public symbol = "HHOG"; string public name = "HedgeHog"; uint256 public decimals = 18; uint256 _totalSupply = 1e9 * 10 ** (decimals); // 1,000,000,000 mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor (address owner) public { owner = 0x5E220057920Dcc7826AB5e5EB5Cf4Bb41C6CD902; balances[address(owner)] = 1000000000 * 10 ** (18); // 1,000,000,000 emit Transfer(address(0), address(owner), 1000000000 * 10 ** (18)); } /** ERC20Interface function's implementation **/ function totalSupply() public override view returns (uint256){ return _totalSupply; } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public override view returns (uint256 balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account // ------------------------------------------------------------------------ function approve(address spender, uint256 tokens) public override returns (bool success){ allowed[msg.sender][spender] = tokens; emit Approval(msg.sender,spender,tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public override view returns (uint256 remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint256 tokens) public override returns (bool success) { // prevent transfer to 0x0, use burn instead require(address(to) != address(0)); require(balances[msg.sender] >= tokens ); require(balances[to] + tokens >= balances[to]); balances[msg.sender] = balances[msg.sender].sub(tokens); uint256 deduction = deductionsToApply(tokens); applyDeductions(deduction); balances[to] = balances[to].add(tokens.sub(deduction)); emit Transfer(msg.sender, to, tokens.sub(deduction)); return true; } // ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){ require(tokens <= allowed[from][msg.sender]); //check allowance require(balances[from] >= tokens); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); uint256 deduction = deductionsToApply(tokens); applyDeductions(deduction); balances[to] = balances[to].add(tokens.sub(deduction)); emit Transfer(from, to, tokens.sub(tokens)); return true; } function _transfer(address to, uint256 tokens, bool rewards) internal returns(bool){ // prevent transfer to 0x0, use burn instead require(address(to) != address(0)); require(balances[address(this)] >= tokens ); require(balances[to] + tokens >= balances[to]); balances[address(this)] = balances[address(this)].sub(tokens); uint256 deduction = 0; if(!rewards){ deduction = deductionsToApply(tokens); applyDeductions(deduction); } balances[to] = balances[to].add(tokens.sub(deduction)); emit Transfer(address(this),to,tokens.sub(deduction)); return true; } function deductionsToApply(uint256 tokens) private view returns(uint256){ uint256 deduction = 0; uint256 minSupply = 100000 * 10 ** (18); if(_totalSupply > minSupply){ deduction = onePercent(tokens).mul(5); // 5% transaction cost if(_totalSupply.sub(deduction) < minSupply) deduction = _totalSupply.sub(minSupply); } return deduction; } function applyDeductions(uint256 deduction) private{ if(stakedCoins == 0){ burnTokens(deduction); } else{ burnTokens(deduction.div(2)); disburse(deduction.div(2)); } } // ------------------------------------------------------------------------ // Burn the ``value` amount of tokens from the `account` // ------------------------------------------------------------------------ function burnTokens(uint256 value) internal{ require(_totalSupply >= value); // burn only unsold tokens _totalSupply = _totalSupply.sub(value); emit Transfer(msg.sender, address(0), value); } // ------------------------------------------------------------------------ // Calculates onePercent of the uint256 amount sent // ------------------------------------------------------------------------ function onePercent(uint256 _tokens) internal pure returns (uint256){ uint256 roundValue = _tokens.ceil(100); uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2)); return onePercentofTokens; } /********************************STAKING CONTRACT**********************************/ uint256 deployTime; uint256 private totalDividentPoints; uint256 private unclaimedDividendPoints; uint256 pointMultiplier = 1000000000000000000; uint256 public stakedCoins; uint256 public totalStakes; uint256 public totalRewardsClaimed; bool public stakingOpen; struct Account { uint256 balance; uint256 lastDividentPoints; uint256 timeInvest; uint256 lastClaimed; uint256 rewardsClaimed; uint256 pending; } mapping(address => Account) accounts; function openStaking() external onlyOwner{ require(!stakingOpen, "staking already open"); stakingOpen = true; } function STAKE(uint256 _tokens) external returns(bool){ require(stakingOpen, "staking is close"); require(transfer(address(this), _tokens), "In sufficient tokens in user wallet"); uint256 owing = dividendsOwing(msg.sender); if(owing > 0) // early stakes accounts[msg.sender].pending = owing; uint256 deduction = deductionsToApply(_tokens); stakedCoins = stakedCoins.add(_tokens.sub(deduction)); accounts[msg.sender].balance = accounts[msg.sender].balance.add(_tokens.sub(deduction)); accounts[msg.sender].lastDividentPoints = totalDividentPoints; accounts[msg.sender].timeInvest = now; accounts[msg.sender].lastClaimed = now; totalStakes = totalStakes.add(_tokens.sub(deduction)); return true; } function pendingReward(address _user) external view returns(uint256){ uint256 owing = dividendsOwing(_user); return owing; } function dividendsOwing(address investor) internal view returns (uint256){ uint256 newDividendPoints = totalDividentPoints.sub(accounts[investor].lastDividentPoints); return (((accounts[investor].balance).mul(newDividendPoints)).div(pointMultiplier)).add(accounts[investor].pending); } function updateDividend(address investor) internal returns(uint256){ uint256 owing = dividendsOwing(investor); if (owing > 0){ unclaimedDividendPoints = unclaimedDividendPoints.sub(owing); accounts[investor].lastDividentPoints = totalDividentPoints; } return owing; } function activeStake(address _user) external view returns (uint256){ return accounts[_user].balance; } function UNSTAKE() external returns (bool){ require(accounts[msg.sender].balance > 0); uint256 owing = updateDividend(msg.sender); if(owing > 0) // unclaimed reward accounts[msg.sender].pending = owing; stakedCoins = stakedCoins.sub(accounts[msg.sender].balance); require(_transfer(msg.sender, accounts[msg.sender].balance, false)); accounts[msg.sender].balance = 0; return true; } function disburse(uint256 amount) internal{ balances[address(this)] = balances[address(this)].add(amount); uint256 unnormalized = amount.mul(pointMultiplier); totalDividentPoints = totalDividentPoints.add(unnormalized.div(stakedCoins)); unclaimedDividendPoints = unclaimedDividendPoints.add(amount); } function claimReward() external returns(bool){ uint256 owing = updateDividend(msg.sender); require(owing > 0); require(_transfer(msg.sender, owing, true)); accounts[msg.sender].rewardsClaimed = accounts[msg.sender].rewardsClaimed.add(owing); totalRewardsClaimed = totalRewardsClaimed.add(owing); return true; } function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){ return accounts[_user].rewardsClaimed; } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063a34b0f76116100b8578063d0668b3c1161007c578063d0668b3c146105a5578063d3f730fd146105c3578063dc8df3871461061b578063dd62ed3e1461063d578063f2fde38b146106b5578063f40f0f52146106f957610142565b8063a34b0f761461049b578063a9059cbb146104b9578063b88a802f1461051f578063bf9befb114610541578063ca84d5911461055f57610142565b8063387602981161010a57806338760298146102f2578063625817331461031457806370a082311461031e5780638d7ce096146103765780638da5cb5b146103ce57806395d89b411461041857610142565b806306fdde0314610147578063095ea7b3146101ca57806318160ddd1461023057806323b872dd1461024e578063313ce567146102d4575b600080fd5b61014f610751565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107ef565b604051808215151515815260200191505060405180910390f35b6102386108e1565b6040518082815260200191505060405180910390f35b6102ba6004803603606081101561026457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108eb565b604051808215151515815260200191505060405180910390f35b6102dc610ca6565b6040518082815260200191505060405180910390f35b6102fa610cac565b604051808215151515815260200191505060405180910390f35b61031c610cbf565b005b6103606004803603602081101561033457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610db8565b6040518082815260200191505060405180910390f35b6103b86004803603602081101561038c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e01565b6040518082815260200191505060405180910390f35b6103d6610e4d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610420610e72565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610460578082015181840152602081019050610445565b50505050905090810190601f16801561048d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104a3610f10565b6040518082815260200191505060405180910390f35b610505600480360360408110156104cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f16565b604051808215151515815260200191505060405180910390f35b6105276111fe565b604051808215151515815260200191505060405180910390f35b6105496112ec565b6040518082815260200191505060405180910390f35b61058b6004803603602081101561057557600080fd5b81019080803590602001909291905050506112f2565b604051808215151515815260200191505060405180910390f35b6105ad611629565b6040518082815260200191505060405180910390f35b610605600480360360208110156105d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061162f565b6040518082815260200191505060405180910390f35b61062361167b565b604051808215151515815260200191505060405180910390f35b61069f6004803603604081101561065357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061182d565b6040518082815260200191505060405180910390f35b6106f7600480360360208110156106cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118b4565b005b61073b6004803603602081101561070f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119aa565b6040518082815260200191505060405180910390f35b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561097657600080fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156109c257600080fd5b610a1482600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119c190919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ae682600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119c190919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000610b71836119d8565b9050610b7c81611a55565b610be0610b9282856119c190919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aaa90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610c8586876119c190919063ffffffff16565b6040518082815260200191505060405180910390a360019150509392505050565b60035481565b600e60009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d1857600080fd5b600e60009054906101000a900460ff1615610d9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f7374616b696e6720616c7265616479206f70656e00000000000000000000000081525060200191505060405180910390fd5b6001600e60006101000a81548160ff021916908315150217905550565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f085780601f10610edd57610100808354040283529160200191610f08565b820191906000526020600020905b815481529060010190602001808311610eeb57829003601f168201915b505050505081565b600d5481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f5157600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610f9d57600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101561102a57600080fd5b61107c82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119c190919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006110ca836119d8565b90506110d581611a55565b6111396110eb82856119c190919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aaa90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6111de84876119c190919063ffffffff16565b6040518082815260200191505060405180910390a3600191505092915050565b60008061120a33611ac6565b90506000811161121957600080fd5b61122533826001611b4b565b61122e57600080fd5b61128381600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154611aaa90919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055506112de81600d54611aaa90919063ffffffff16565b600d81905550600191505090565b600c5481565b6000600e60009054906101000a900460ff16611376576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f7374616b696e6720697320636c6f73650000000000000000000000000000000081525060200191505060405180910390fd5b6113803083610f16565b6113d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806121ad6023913960400191505060405180910390fd5b60006113e033611e3d565b905060008111156114335780600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501819055505b600061143e846119d8565b905061146761145682866119c190919063ffffffff16565b600b54611aaa90919063ffffffff16565b600b819055506114d461148382866119c190919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611aaa90919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600854600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555042600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555042600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555061161861160782866119c190919063ffffffff16565b600c54611aaa90919063ffffffff16565b600c81905550600192505050919050565b600b5481565b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401549050919050565b600080600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154116116cb57600080fd5b60006116d633611ac6565b905060008111156117295780600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501819055505b611780600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600b546119c190919063ffffffff16565b600b819055506117d433600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546000611b4b565b6117dd57600080fd5b6000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600191505090565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461190d57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b6000806119b683611e3d565b905080915050919050565b6000828211156119cd57fe5b818303905092915050565b60008060009050600069152d02c7e14af68000009050806004541115611a4b57611a146005611a0686611f5e565b611fb290919063ffffffff16565b915080611a2c836004546119c190919063ffffffff16565b1015611a4a57611a47816004546119c190919063ffffffff16565b91505b5b8192505050919050565b6000600b541415611a6e57611a6981611fe9565b611aa7565b611a8a611a8560028361207c90919063ffffffff16565b611fe9565b611aa6611aa160028361207c90919063ffffffff16565b612095565b5b50565b600080828401905083811015611abc57fe5b8091505092915050565b600080611ad283611e3d565b90506000811115611b4257611af2816009546119c190919063ffffffff16565b600981905550600854600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611b8657600080fd5b82600560003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611bd257600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015611c5f57600080fd5b611cb183600560003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119c190919063ffffffff16565b600560003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600080905082611d1357611d07846119d8565b9050611d1281611a55565b5b611d77611d2982866119c190919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aaa90919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611e1c84886119c190919063ffffffff16565b6040518082815260200191505060405180910390a360019150509392505050565b600080611e97600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546008546119c190919063ffffffff16565b9050611f56600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154611f48600a54611f3a85600f60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611fb290919063ffffffff16565b61207c90919063ffffffff16565b611aaa90919063ffffffff16565b915050919050565b600080611f7560648461219190919063ffffffff16565b90506000611fa66002600a0a606402611f98606485611fb290919063ffffffff16565b61207c90919063ffffffff16565b90508092505050919050565b600080831415611fc55760009050611fe3565b6000828402905082848281611fd657fe5b0414611fde57fe5b809150505b92915050565b806004541015611ff857600080fd5b61200d816004546119c190919063ffffffff16565b600481905550600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b60008082848161208857fe5b0490508091505092915050565b6120e781600560003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aaa90919063ffffffff16565b600560003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000612141600a5483611fb290919063ffffffff16565b905061216c61215b600b548361207c90919063ffffffff16565b600854611aaa90919063ffffffff16565b60088190555061218782600954611aaa90919063ffffffff16565b6009819055505050565b60008182600184860103816121a257fe5b040290509291505056fe496e2073756666696369656e7420746f6b656e7320696e20757365722077616c6c6574a26469706673582212200a8b30364728ddfa52639e50bb24665be9db4f731e48706a24d32777ae14295464736f6c63430006000033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
2,141
0x95aa5d2dbd3c16ee3fdea82d5c6ec3e38ce3314f
pragma solidity ^0.5.17; /** * @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 SafeMath * @dev Math operations with safety checks that throw on error * @notice https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ library SafeMath { /** * SafeMath mul function * @dev function for safe multiply, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } /** * SafeMath div funciotn * @dev function for safe devide, throws on overflow. **/ function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } /** * SafeMath sub function * @dev function for safe subtraction, throws on overflow. **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * SafeMath add function * @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 Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/2 */ 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 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 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); } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); event NotPausable(); bool public paused = false; bool public canPause = true; address public saleAgent; function setSaleAgent(address newSaleAgnet) public onlyOwner { saleAgent = newSaleAgnet; } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused || msg.sender == owner || msg.sender == saleAgent); _; } /** * @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 { require(canPause == true); paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { require(paused == true); paused = false; emit Unpause(); } /** * @dev Prevent the token from ever being paused again **/ function notPausable() onlyOwner public{ paused = false; canPause = false; emit NotPausable(); } } contract BlackList is Ownable, BasicToken { /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) /////// function getBlackListStatus(address _maker) external view returns (bool) { return isBlackListed[_maker]; } function getOwner() external view returns (address) { return owner; } mapping (address => bool) public isBlackListed; function addFreeze (address _evilUser) public onlyOwner { isBlackListed[_evilUser] = true; emit AddedBlackList(_evilUser); } function removeFreeze (address _clearedUser) public onlyOwner { isBlackListed[_clearedUser] = false; emit RemovedBlackList(_clearedUser); } function BurnFrozenFunds (address _blackListedUser) public onlyOwner { require(isBlackListed[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); balances[_blackListedUser] = 0; totalSupply_ -= dirtyFunds; emit DestroyedBlackFunds(_blackListedUser, dirtyFunds); } event DestroyedBlackFunds(address _blackListedUser, uint _balance); event AddedBlackList(address _user); event RemovedBlackList(address _user); } /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PXPv2Token is StandardToken, Pausable, BlackList { string public constant name = " PointPay Crypto Banking Token V2 "; string public constant symbol = "PXP"; uint256 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals)); /** * @dev Transfer tokens when not paused **/ function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { require(!isBlackListed[msg.sender]); return super.transfer(_to, _value); } /** * @dev transferFrom function to tansfer tokens when token is not paused **/ function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { require(!isBlackListed[msg.sender]); return super.transferFrom(_from, _to, _value); } /** * @dev approve spender when not paused **/ function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } /** * @dev increaseApproval of spender when not paused **/ function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } /** * @dev decreaseApproval of spender when not paused **/ function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } /** * Pausable Token Constructor * @dev Create and issue tokens to msg.sender. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c806370a08231116100f9578063a9059cbb11610097578063d73dd62311610071578063d73dd623146107ef578063dd62ed3e14610855578063e47d6060146108cd578063f2fde38b14610929576101c4565b8063a9059cbb146106fb578063b1d6a2f014610761578063cf170d55146107ab576101c4565b8063893d20e8116100d3578063893d20e8146105a05780638da5cb5b146105ea57806395d89b4114610634578063a1159838146106b7576101c4565b806370a0823114610534578063715018a61461058c5780638456cb5914610596576101c4565b8063313ce567116101665780634be8b05e116101405780634be8b05e1461044657806359bf1abe146104505780635c975abb146104ac57806366188463146104ce576101c4565b8063313ce567146103fc578063323be1c51461041a5780633f4ba83a1461043c576101c4565b806314133a7c116101a257806314133a7c146102f657806318160ddd1461033a57806323b872dd146103585780632ff2e9dc146103de576101c4565b806306fdde03146101c9578063095ea7b31461024c5780630e25b620146102b2575b600080fd5b6101d161096d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102115780820151818401526020810190506101f6565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102986004803603604081101561026257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610989565b604051808215151515815260200191505060405180910390f35b6102f4600480360360208110156102c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a66565b005b6103386004803603602081101561030c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b7d565b005b610342610c1a565b6040518082815260200191505060405180910390f35b6103c46004803603606081101561036e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c24565b604051808215151515815260200191505060405180910390f35b6103e6610d5a565b6040518082815260200191505060405180910390f35b610404610d68565b6040518082815260200191505060405180910390f35b610422610d6d565b604051808215151515815260200191505060405180910390f35b610444610d80565b005b61044e610e5b565b005b6104926004803603602081101561046657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f18565b604051808215151515815260200191505060405180910390f35b6104b4610f6e565b604051808215151515815260200191505060405180910390f35b61051a600480360360408110156104e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f81565b604051808215151515815260200191505060405180910390f35b6105766004803603602081101561054a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061105e565b6040518082815260200191505060405180910390f35b6105946110a7565b005b61059e6111a7565b005b6105a8611332565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105f261135b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61063c611380565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561067c578082015181840152602081019050610661565b50505050905090810190601f1680156106a95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106f9600480360360208110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113b9565b005b6107476004803603604081101561071157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114d0565b604051808215151515815260200191505060405180910390f35b610769611604565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107ed600480360360208110156107c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061162a565b005b61083b6004803603604081101561080557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117aa565b604051808215151515815260200191505060405180910390f35b6108b76004803603604081101561086b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611887565b6040518082815260200191505060405180910390f35b61090f600480360360208110156108e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061190e565b604051808215151515815260200191505060405180910390f35b61096b6004803603602081101561093f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061192e565b005b6040518060600160405280602281526020016126096022913981565b6000600460009054906101000a900460ff1615806109f357506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610a4b5750600460029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a5457600080fd5b610a5e8383611a7f565b905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610abf57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bd657600080fd5b80600460026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600254905090565b6000600460009054906101000a900460ff161580610c8e57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610ce65750600460029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610cef57600080fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610d4657600080fd5b610d51848484611b71565b90509392505050565b6012600a0a633b9aca000281565b601281565b600460019054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dd957600080fd5b600460009054906101000a900460ff16610df257600080fd5b60011515600460009054906101000a900460ff16151514610e1257600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eb457600080fd5b6000600460006101000a81548160ff0219169083151502179055506000600460016101000a81548160ff0219169083151502179055507faff39f66825d4448497d384dee3f4a3adf00a622960add00806503ae4ccee01c60405160405180910390a1565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600460009054906101000a900460ff1681565b6000600460009054906101000a900460ff161580610feb57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806110435750600460029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61104c57600080fd5b6110568383611f2a565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461110057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461120057600080fd5b600460009054906101000a900460ff16158061126857506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806112c05750600460029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6112c957600080fd5b60011515600460019054906101000a900460ff161515146112e957600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f505850000000000000000000000000000000000000000000000000000000000081525081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461141257600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600460009054906101000a900460ff16158061153a57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806115925750600460029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61159b57600080fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115f257600080fd5b6115fc83836121bb565b905092915050565b600460029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461168357600080fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166116d957600080fd5b60006116e48261105e565b90506000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806002600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000600460009054906101000a900460ff16158061181457506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061186c5750600460029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61187557600080fd5b61187f83836123db565b905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60056020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461198757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119c157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611bac57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115611bf857600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115611c8157600080fd5b611cd382600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d790919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d6882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ee90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e3a82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d790919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561203b576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120cf565b61204e83826125d790919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156121f657600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561224257600080fd5b61229482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ee90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061246c82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ee90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000828211156125e357fe5b818303905092915050565b60008183019050828110156125ff57fe5b8090509291505056fe20506f696e745061792043727970746f2042616e6b696e6720546f6b656e20563220a265627a7a723158204e472ca2436eed28fd0045d7b7d00552f634e0b38af511aa5cdc09fad011ab5764736f6c63430005110032
{"success": true, "error": null, "results": {}}
2,142
0xBaAc9F2dc1c0C7F462daF6c6dD5543D826a6Ed10
/** https://t.me/elonasaerc https://elonasa.io &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. 7&@@@@@@@@@@@@@@@&7 &@@@@@@@@@@# Y@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# 7&@@@@@@@@@@@@@@@&? @@@@@@@@@@@& G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&. ~#@@@@@@@@@@@@@@@@Y. @@@@@@@@@@@& 7&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Y ^B@@@@@@@@@@@@@@@@P. @@@@@@@@@@@& !G&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B7 :P@@@@@@@@@@@@@@@@G: @@@@@@@@@@@& .^7??????????????????????????????????????????????????7~: .#@@@@@@@@@@@@@@@@#~ @@@@@@@@@@@& P@@@@@@@@@@@@@@@@@@&! @@@@@@@@@@@& P@@@@@@@@@@@@@@@@@@@@&? @@@@@@@@@@@& P@@@@@@@@@@@@@@@@@@@@@@@Y. @@@@@@@@@@@& P@@@@@@@@@@@@@@@@@@@@@@@@@P. @@@@@@@@@@@& ...................................................................... P@@@@@@@@@@@@@@@@@@@@@@@@@@@G^ @@@@@@@@@@@& &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@. P@@@@@@@@@@@^Y@@@@@@@@@@@@@@@@#~ @@@@@@@@@@@& 7@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@P P@@@@@@@@@@@. J&@@@@@@@@@@@@@@@&! @@@@@@@@@@@& ?@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@P P@@@@@@@@@@@. 7&@@@@@@@@@@@@@@@&? @@@@@@@@@@@& :G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#~ P@@@@@@@@@@@. ~#@@@@@@@@@@@@@@@@Y. @@@@@@@@@@@& .7G&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&BJ. P@@@@@@@@@@@. ^B@@@@@@@@@@@@@@@@P. @@@@@@@@@@@& ..:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^:.. P@@@@@@@@@@@. :P@@@@@@@@@@@@@@@@B^ @@@@@@@@@@@& P@@@@@@@@@@@. .Y@@@@@@@@@@@@@@@@#~ @@@@@@@@@@@& P@@@@@@@@@@@. ?&@@@@@@@@@@@@@@@&?@@@@@@@@@@@& P@@@@@@@@@@@. 7&@@@@@@@@@@@@@@@@@@@@@@@@@@& P@@@@@@@@@@@. ~#@@@@@@@@@@@@@@@@@@@@@@@@& !777777777777777777777777777777777777777777777777777777777777777777777 P@@@@@@@@@@@. ^B@@@@@@@@@@@@@@@@@@@@@@& &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ P@@@@@@@@@@@. .P@@@@@@@@@@@@@@@@@@@@& ^@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@? P@@@@@@@@@@@. .Y@@@@@@@@@@@@@@@@@@& :&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7 P@@@@@@@@@@@. ?&@@@@@@@@@@@@@@@& 7&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&J. P@@@@@@@@@@@. !&@@@@@@@@@@@@@& :JB&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&BY^ P@@@@@@@@@@@. ~&@@@@@@@@@@@& */ // 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 ELONASA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ELONASA"; string private constant _symbol = "EN"; 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 = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xF09aaa9885501E4ca1697Dc28B55D1D1980a8F63); address payable private _marketingAddress = payable(0xF09aaa9885501E4ca1697Dc28B55D1D1980a8F63); 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610550578063dd62ed3e14610570578063ea1644d5146105b6578063f2fde38b146105d657600080fd5b8063a2a957bb146104cb578063a9059cbb146104eb578063bfd792841461050b578063c3c8cd801461053b57600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b411461048057806398a5c315146104ab57600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461027057806318160ddd146102a857806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024057600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195a565b6105f6565b005b34801561020a57600080fd5b50604080518082019091526007815266454c4f4e41534160c81b60208201525b6040516102379190611a1f565b60405180910390f35b34801561024c57600080fd5b5061026061025b366004611a74565b610695565b6040519015158152602001610237565b34801561027c57600080fd5b50601454610290906001600160a01b031681565b6040516001600160a01b039091168152602001610237565b3480156102b457600080fd5b50670de0b6b3a76400005b604051908152602001610237565b3480156102d957600080fd5b506102606102e8366004611aa0565b6106ac565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610237565b34801561032b57600080fd5b50601554610290906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ae1565b610715565b34801561036b57600080fd5b506101fc61037a366004611b0e565b610760565b34801561038b57600080fd5b506101fc6107a8565b3480156103a057600080fd5b506102bf6103af366004611ae1565b6107f3565b3480156103c057600080fd5b506101fc610815565b3480156103d557600080fd5b506101fc6103e4366004611b29565b610889565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611ae1565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b0316610290565b34801561045657600080fd5b506101fc610465366004611b0e565b6108b8565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b5060408051808201909152600281526122a760f11b602082015261022a565b3480156104b757600080fd5b506101fc6104c6366004611b29565b610900565b3480156104d757600080fd5b506101fc6104e6366004611b42565b61092f565b3480156104f757600080fd5b50610260610506366004611a74565b61096d565b34801561051757600080fd5b50610260610526366004611ae1565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506101fc61097a565b34801561055c57600080fd5b506101fc61056b366004611b74565b6109ce565b34801561057c57600080fd5b506102bf61058b366004611bf8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c257600080fd5b506101fc6105d1366004611b29565b610a6f565b3480156105e257600080fd5b506101fc6105f1366004611ae1565b610a9e565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161062090611c31565b60405180910390fd5b60005b81518110156106915760016010600084848151811061064d5761064d611c66565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068981611c92565b91505061062c565b5050565b60006106a2338484610b88565b5060015b92915050565b60006106b9848484610cac565b61070b843361070685604051806060016040528060288152602001611dac602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111e8565b610b88565b5060019392505050565b6000546001600160a01b0316331461073f5760405162461bcd60e51b815260040161062090611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078a5760405162461bcd60e51b815260040161062090611c31565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107dd57506013546001600160a01b0316336001600160a01b0316145b6107e657600080fd5b476107f081611222565b50565b6001600160a01b0381166000908152600260205260408120546106a69061125c565b6000546001600160a01b0316331461083f5760405162461bcd60e51b815260040161062090611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161062090611c31565b601655565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161062090611c31565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092a5760405162461bcd60e51b815260040161062090611c31565b601855565b6000546001600160a01b031633146109595760405162461bcd60e51b815260040161062090611c31565b600893909355600a91909155600955600b55565b60006106a2338484610cac565b6012546001600160a01b0316336001600160a01b031614806109af57506013546001600160a01b0316336001600160a01b0316145b6109b857600080fd5b60006109c3306107f3565b90506107f0816112e0565b6000546001600160a01b031633146109f85760405162461bcd60e51b815260040161062090611c31565b60005b82811015610a69578160056000868685818110610a1a57610a1a611c66565b9050602002016020810190610a2f9190611ae1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6181611c92565b9150506109fb565b50505050565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161062090611c31565b601755565b6000546001600160a01b03163314610ac85760405162461bcd60e51b815260040161062090611c31565b6001600160a01b038116610b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610620565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bea5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610620565b6001600160a01b038216610c4b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610620565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d105760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610620565b6001600160a01b038216610d725760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610620565b60008111610dd45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610620565b6000546001600160a01b03848116911614801590610e0057506000546001600160a01b03838116911614155b156110e157601554600160a01b900460ff16610e99576000546001600160a01b03848116911614610e995760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610620565b601654811115610eeb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610620565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2d57506001600160a01b03821660009081526010602052604090205460ff16155b610f855760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610620565b6015546001600160a01b0383811691161461100a5760175481610fa7846107f3565b610fb19190611cad565b1061100a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610620565b6000611015306107f3565b60185460165491925082101590821061102e5760165491505b8080156110455750601554600160a81b900460ff16155b801561105f57506015546001600160a01b03868116911614155b80156110745750601554600160b01b900460ff165b801561109957506001600160a01b03851660009081526005602052604090205460ff16155b80156110be57506001600160a01b03841660009081526005602052604090205460ff16155b156110de576110cc826112e0565b4780156110dc576110dc47611222565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112357506001600160a01b03831660009081526005602052604090205460ff165b8061115557506015546001600160a01b0385811691161480159061115557506015546001600160a01b03848116911614155b15611162575060006111dc565b6015546001600160a01b03858116911614801561118d57506014546001600160a01b03848116911614155b1561119f57600854600c55600954600d555b6015546001600160a01b0384811691161480156111ca57506014546001600160a01b03858116911614155b156111dc57600a54600c55600b54600d555b610a6984848484611469565b6000818484111561120c5760405162461bcd60e51b81526004016106209190611a1f565b5060006112198486611cc5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610691573d6000803e3d6000fd5b60006006548211156112c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610620565b60006112cd611497565b90506112d983826114ba565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132857611328611c66565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137c57600080fd5b505afa158015611390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b49190611cdc565b816001815181106113c7576113c7611c66565b6001600160a01b0392831660209182029290920101526014546113ed9130911684610b88565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611426908590600090869030904290600401611cf9565b600060405180830381600087803b15801561144057600080fd5b505af1158015611454573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611476576114766114fc565b61148184848461152a565b80610a6957610a69600e54600c55600f54600d55565b60008060006114a4611621565b90925090506114b382826114ba565b9250505090565b60006112d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611661565b600c5415801561150c5750600d54155b1561151357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153c8761168f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156e90876116ec565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159d908661172e565b6001600160a01b0389166000908152600260205260409020556115bf8161178d565b6115c984836117d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160e91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163c82826114ba565b82101561165857505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116825760405162461bcd60e51b81526004016106209190611a1f565b5060006112198486611d6a565b60008060008060008060008060006116ac8a600c54600d546117fb565b92509250925060006116bc611497565b905060008060006116cf8e878787611850565b919e509c509a509598509396509194505050505091939550919395565b60006112d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e8565b60008061173b8385611cad565b9050838110156112d95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610620565b6000611797611497565b905060006117a583836118a0565b306000908152600260205260409020549091506117c2908261172e565b30600090815260026020526040902055505050565b6006546117e490836116ec565b6006556007546117f4908261172e565b6007555050565b6000808080611815606461180f89896118a0565b906114ba565b90506000611828606461180f8a896118a0565b905060006118408261183a8b866116ec565b906116ec565b9992985090965090945050505050565b600080808061185f88866118a0565b9050600061186d88876118a0565b9050600061187b88886118a0565b9050600061188d8261183a86866116ec565b939b939a50919850919650505050505050565b6000826118af575060006106a6565b60006118bb8385611d8c565b9050826118c88583611d6a565b146112d95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610620565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f057600080fd5b803561195581611935565b919050565b6000602080838503121561196d57600080fd5b823567ffffffffffffffff8082111561198557600080fd5b818501915085601f83011261199957600080fd5b8135818111156119ab576119ab61191f565b8060051b604051601f19603f830116810181811085821117156119d0576119d061191f565b6040529182528482019250838101850191888311156119ee57600080fd5b938501935b82851015611a1357611a048561194a565b845293850193928501926119f3565b98975050505050505050565b600060208083528351808285015260005b81811015611a4c57858101830151858201604001528201611a30565b81811115611a5e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8757600080fd5b8235611a9281611935565b946020939093013593505050565b600080600060608486031215611ab557600080fd5b8335611ac081611935565b92506020840135611ad081611935565b929592945050506040919091013590565b600060208284031215611af357600080fd5b81356112d981611935565b8035801515811461195557600080fd5b600060208284031215611b2057600080fd5b6112d982611afe565b600060208284031215611b3b57600080fd5b5035919050565b60008060008060808587031215611b5857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8957600080fd5b833567ffffffffffffffff80821115611ba157600080fd5b818601915086601f830112611bb557600080fd5b813581811115611bc457600080fd5b8760208260051b8501011115611bd957600080fd5b602092830195509350611bef9186019050611afe565b90509250925092565b60008060408385031215611c0b57600080fd5b8235611c1681611935565b91506020830135611c2681611935565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca657611ca6611c7c565b5060010190565b60008219821115611cc057611cc0611c7c565b500190565b600082821015611cd757611cd7611c7c565b500390565b600060208284031215611cee57600080fd5b81516112d981611935565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d495784516001600160a01b031683529383019391830191600101611d24565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da657611da6611c7c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b83b417fff499d1bec76b0eb2aff888ce564c58acb6267ea4172e38cc912df2b64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,143
0x3b72b2766c0499910345687ee5b16dc859d4a7c8
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /** * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } /** * @title HARITECOIN * @author HARITECOIN * @dev HARITECOIN is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract HARITECOIN is ERC223, Ownable { using SafeMath for uint256; string public name = "HARITECOIN"; string public symbol = "HRT"; uint8 public decimals = 8; uint256 public totalSupply = 50e9 * 1e8; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function HARITECOIN() public { balanceOf[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = amount.mul(1e8); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn&#39;t work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf[owner] >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if(msg.value > 0) owner.transfer(msg.value); balanceOf[owner] = balanceOf[owner].sub(distributeAmount); balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev fallback function */ function() payable public { autoDistribute(); } }
0x6060604052600436106101455763ffffffff60e060020a60003504166305d2035b811461014f57806306fdde0314610176578063095ea7b31461020057806318160ddd1461022257806323b872dd14610247578063313ce5671461026f57806340c10f19146102985780634f25eced146102ba57806364ddc605146102cd57806370a082311461035c5780637d64bcb41461037b5780638da5cb5b1461038e57806394594625146103bd57806395d89b411461040e5780639dc29fac14610421578063a8f11eb914610145578063a9059cbb14610443578063b414d4b614610465578063be45fd6214610484578063c341b9f6146104e9578063cbbe974b1461053c578063d39b1d481461055b578063dd62ed3e14610571578063dd92459414610596578063f0dc417114610625578063f2fde38b146106b4578063f6368f8a146106d3575b61014d61077a565b005b341561015a57600080fd5b6101626108ef565b604051901515815260200160405180910390f35b341561018157600080fd5b6101896108f8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101c55780820151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020b57600080fd5b610162600160a060020a03600435166024356109a0565b341561022d57600080fd5b610235610a0c565b60405190815260200160405180910390f35b341561025257600080fd5b610162600160a060020a0360043581169060243516604435610a12565b341561027a57600080fd5b610282610c21565b60405160ff909116815260200160405180910390f35b34156102a357600080fd5b610162600160a060020a0360043516602435610c2a565b34156102c557600080fd5b610235610d2c565b34156102d857600080fd5b61014d600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d3295505050505050565b341561036757600080fd5b610235600160a060020a0360043516610e8c565b341561038657600080fd5b610162610ea7565b341561039957600080fd5b6103a1610f14565b604051600160a060020a03909116815260200160405180910390f35b34156103c857600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f2392505050565b341561041957600080fd5b6101896111b1565b341561042c57600080fd5b61014d600160a060020a0360043516602435611224565b341561044e57600080fd5b610162600160a060020a036004351660243561130c565b341561047057600080fd5b610162600160a060020a03600435166113e7565b341561048f57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506113fc95505050505050565b34156104f457600080fd5b61014d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114c79050565b341561054757600080fd5b610235600160a060020a03600435166115c9565b341561056657600080fd5b61014d6004356115db565b341561057c57600080fd5b610235600160a060020a03600435811690602435166115fb565b34156105a157600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061162695505050505050565b341561063057600080fd5b6101626004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118d895505050505050565b34156106bf57600080fd5b61014d600160a060020a0360043516611ba6565b34156106de57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c4195505050505050565b60006006541180156107a85750600654600154600160a060020a031660009081526008602052604090205410155b80156107cd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156107f05750600160a060020a0333166000908152600b602052604090205442115b15156107fb57600080fd5b600034111561083857600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561083857600080fd5b600654600154600160a060020a03166000908152600860205260409020546108659163ffffffff611f9916565b600154600160a060020a039081166000908152600860205260408082209390935560065433909216815291909120546108a39163ffffffff611fab16565b600160a060020a03338116600081815260086020526040908190209390935560015460065491939216916000805160206123e683398151915291905190815260200160405180910390a3565b60075460ff1681565b6109006123d3565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b820191906000526020600020905b81548152906001019060200180831161097957829003601f168201915b5050505050905090565b600160a060020a03338116600081815260096020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a03831615801590610a2c5750600082115b8015610a515750600160a060020a038416600090815260086020526040902054829010155b8015610a845750600160a060020a0380851660009081526009602090815260408083203390941683529290522054829010155b8015610aa95750600160a060020a0384166000908152600a602052604090205460ff16155b8015610ace5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610af15750600160a060020a0384166000908152600b602052604090205442115b8015610b145750600160a060020a0383166000908152600b602052604090205442115b1515610b1f57600080fd5b600160a060020a038416600090815260086020526040902054610b48908363ffffffff611f9916565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b7d908363ffffffff611fab16565b600160a060020a03808516600090815260086020908152604080832094909455878316825260098152838220339093168252919091522054610bc5908363ffffffff611f9916565b600160a060020a03808616600081815260096020908152604080832033861684529091529081902093909355908516916000805160206123e68339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60015460009033600160a060020a03908116911614610c4857600080fd5b60075460ff1615610c5857600080fd5b60008211610c6557600080fd5b600554610c78908363ffffffff611fab16565b600555600160a060020a038316600090815260086020526040902054610ca4908363ffffffff611fab16565b600160a060020a0384166000818152600860205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660006000805160206123e68339815191528460405190815260200160405180910390a350600192915050565b60065481565b60015460009033600160a060020a03908116911614610d5057600080fd5b60008351118015610d62575081518351145b1515610d6d57600080fd5b5060005b8251811015610e8757818181518110610d8657fe5b90602001906020020151600b6000858481518110610da057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610dce57600080fd5b818181518110610dda57fe5b90602001906020020151600b6000858481518110610df457fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e2457fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e6457fe5b9060200190602002015160405190815260200160405180910390a2600101610d71565b505050565b600160a060020a031660009081526008602052604090205490565b60015460009033600160a060020a03908116911614610ec557600080fd5b60075460ff1615610ed557600080fd5b6007805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f38575060008551115b8015610f5d5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f805750600160a060020a0333166000908152600b602052604090205442115b1515610f8b57600080fd5b610f9f846305f5e10063ffffffff611fba16565b9350610fb38551859063ffffffff611fba16565b600160a060020a03331660009081526008602052604090205490925082901015610fdc57600080fd5b5060005b845181101561116457848181518110610ff557fe5b90602001906020020151600160a060020a03161580159061104a5750600a600086838151811061102157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561108f5750600b600086838151811061106157fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561109a57600080fd5b6110de84600860008885815181106110ae57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fab16565b600860008784815181106110ee57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061111e57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3600101610fe0565b600160a060020a03331660009081526008602052604090205461118d908363ffffffff611f9916565b33600160a060020a0316600090815260086020526040902055506001949350505050565b6111b96123d3565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b60015433600160a060020a0390811691161461123f57600080fd5b6000811180156112685750600160a060020a038216600090815260086020526040902054819010155b151561127357600080fd5b600160a060020a03821660009081526008602052604090205461129c908263ffffffff611f9916565b600160a060020a0383166000908152600860205260409020556005546112c8908263ffffffff611f9916565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b60006113166123d3565b60008311801561133f5750600160a060020a0333166000908152600a602052604090205460ff16155b80156113645750600160a060020a0384166000908152600a602052604090205460ff16155b80156113875750600160a060020a0333166000908152600b602052604090205442115b80156113aa5750600160a060020a0384166000908152600b602052604090205442115b15156113b557600080fd5b6113be84611fe5565b156113d5576113ce848483611fed565b91506113e0565b6113ce848483612250565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156114265750600160a060020a0333166000908152600a602052604090205460ff16155b801561144b5750600160a060020a0384166000908152600a602052604090205460ff16155b801561146e5750600160a060020a0333166000908152600b602052604090205442115b80156114915750600160a060020a0384166000908152600b602052604090205442115b151561149c57600080fd5b6114a584611fe5565b156114bc576114b5848484611fed565b9050610c1a565b6114b5848484612250565b60015460009033600160a060020a039081169116146114e557600080fd5b60008351116114f357600080fd5b5060005b8251811015610e875782818151811061150c57fe5b90602001906020020151600160a060020a0316151561152a57600080fd5b81600a600085848151811061153b57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061157957fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a26001016114f7565b600b6020526000908152604090205481565b60015433600160a060020a039081169116146115f657600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b600080600080855111801561163c575083518551145b80156116615750600160a060020a0333166000908152600a602052604090205460ff16155b80156116845750600160a060020a0333166000908152600b602052604090205442115b151561168f57600080fd5b5060009050805b84518110156117e15760008482815181106116ad57fe5b906020019060200201511180156116e157508481815181106116cb57fe5b90602001906020020151600160a060020a031615155b80156117215750600a60008683815181106116f857fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156117665750600b600086838151811061173857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561177157600080fd5b61179b6305f5e10085838151811061178557fe5b906020019060200201519063ffffffff611fba16565b8482815181106117a757fe5b602090810290910101526117d78482815181106117c057fe5b90602001906020020151839063ffffffff611fab16565b9150600101611696565b600160a060020a0333166000908152600860205260409020548290101561180757600080fd5b5060005b84518110156111645761183d84828151811061182357fe5b90602001906020020151600860008885815181106110ae57fe5b6008600087848151811061184d57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061187d57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123e68339815191528684815181106118b557fe5b9060200190602002015160405190815260200160405180910390a360010161180b565b6001546000908190819033600160a060020a039081169116146118fa57600080fd5b6000855111801561190c575083518551145b151561191757600080fd5b5060009050805b8451811015611b7d57600084828151811061193557fe5b90602001906020020151118015611969575084818151811061195357fe5b90602001906020020151600160a060020a031615155b80156119a95750600a600086838151811061198057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156119ee5750600b60008683815181106119c057fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156119f957600080fd5b611a0d6305f5e10085838151811061178557fe5b848281518110611a1957fe5b60209081029091010152838181518110611a2f57fe5b9060200190602002015160086000878481518110611a4957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a7857600080fd5b611ad1848281518110611a8757fe5b9060200190602002015160086000888581518110611aa157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611f9916565b60086000878481518110611ae157fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b148482815181106117c057fe5b915033600160a060020a0316858281518110611b2c57fe5b90602001906020020151600160a060020a03166000805160206123e6833981519152868481518110611b5a57fe5b9060200190602002015160405190815260200160405180910390a360010161191e565b600160a060020a03331660009081526008602052604090205461118d908363ffffffff611fab16565b60015433600160a060020a03908116911614611bc157600080fd5b600160a060020a0381161515611bd657600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c6b5750600160a060020a0333166000908152600a602052604090205460ff16155b8015611c905750600160a060020a0385166000908152600a602052604090205460ff16155b8015611cb35750600160a060020a0333166000908152600b602052604090205442115b8015611cd65750600160a060020a0385166000908152600b602052604090205442115b1515611ce157600080fd5b611cea85611fe5565b15611f8357600160a060020a03331660009081526008602052604090205484901015611d1557600080fd5b600160a060020a033316600090815260086020526040902054611d3e908563ffffffff611f9916565b600160a060020a033381166000908152600860205260408082209390935590871681522054611d73908563ffffffff611fab16565b600160a060020a0386166000818152600860205260408082209390935590918490518082805190602001908083835b60208310611dc15780518252601f199092019160209182019101611da2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e52578082015183820152602001611e3a565b50505050905090810190601f168015611e7f5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611ea357fe5b826040518082805190602001908083835b60208310611ed35780518252601f199092019160209182019101611eb4565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3506001611f91565b611f8e858585612250565b90505b949350505050565b600082821115611fa557fe5b50900390565b600082820183811015610c1a57fe5b600080831515611fcd57600091506113e0565b50828202828482811515611fdd57fe5b0414610c1a57fe5b6000903b1190565b600160a060020a03331660009081526008602052604081205481908490101561201557600080fd5b600160a060020a03331660009081526008602052604090205461203e908563ffffffff611f9916565b600160a060020a033381166000908152600860205260408082209390935590871681522054612073908563ffffffff611fab16565b600160a060020a03861660008181526008602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561210c5780820151838201526020016120f4565b50505050905090810190601f1680156121395780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561215957600080fd5b6102c65a03f1151561216a57600080fd5b505050826040518082805190602001908083835b6020831061219d5780518252601f19909201916020918201910161217e565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600860205260408120548390101561227657600080fd5b600160a060020a03331660009081526008602052604090205461229f908463ffffffff611f9916565b600160a060020a0333811660009081526008602052604080822093909355908616815220546122d4908463ffffffff611fab16565b600160a060020a03851660009081526008602052604090819020919091558290518082805190602001908083835b602083106123215780518252601f199092019160209182019101612302565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206123e68339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582072e5d0218f23fd9735352fc5a5d414952c75d5fa1a91280d692af2c7f9de24f40029
{"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"}]}}
2,144
0xd0066c571eae6f36908b076e29bc62a0b31dd56a
pragma solidity ^0.4.20; /* asdasda test test */ contract TestTest { modifier onlyPeopleWithTokens() { require(myTokens() > 0);_; } modifier onlyPeopleWithProfits() { require(myDividends(true) > 0);_;} modifier onlyAdmin(){ address _customerAddress = msg.sender; require(administrator[_customerAddress]); _; } modifier antiEarlyWhale(uint256 _amountOfEthereum){ address _customerAddress = msg.sender; if( onlyAdminsFriends && ((totalEthereumBalance() - _amountOfEthereum) <= adminsFriendQuota_ )){ require( adminsFriends_[_customerAddress] == true && (adminsFriendAccumulatedQuota_[_customerAddress] + _amountOfEthereum) <= adminsFriendMaxPurchase_ ); adminsFriendAccumulatedQuota_[_customerAddress] = SafeMath.add(adminsFriendAccumulatedQuota_[_customerAddress], _amountOfEthereum); _; } else {onlyAdminsFriends = false; _; } } event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens); string public name = "Infinity Hourglass"; string public symbol = "INF"; uint8 constant public decimals = 18; uint8 constant internal dividendFee_ = 7; uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2**64; uint256 public stakingRequirement = 100e18; mapping(address => bool) internal adminsFriends_; uint256 constant internal adminsFriendMaxPurchase_ = 1 ether; uint256 constant internal adminsFriendQuota_ = 20 ether; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; mapping(address => uint256) internal adminsFriendAccumulatedQuota_; uint256 internal tokenSupply_ = 0; uint256 internal profitPerShare_; mapping(address => bool) public administrator; bool public onlyAdminsFriends = true; /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /* * -- APPLICATION ENTRY POINTS -- */ function TestTest() public {administrator[0x703e04F6162f0f6c63F397994EbbF372a90e3d1d] = true;} /** * Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) */ function buy(address _referredBy) public payable returns(uint256) { purchaseTokens(msg.value, _referredBy); } /** * Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() payable public { purchaseTokens(msg.value, 0x0); } /** * Converts all of caller's dividends to tokens. */ function reinvest() onlyPeopleWithProfits() public { // fetch dividends uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code // pay out the dividends virtually address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // retrieve ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // dispatch a buy order with the virtualized "withdrawn dividends" uint256 _tokens = purchaseTokens(_dividends, 0x0); // fire event onReinvestment(_customerAddress, _dividends, _tokens); } /** * Alias of sell() and withdraw(). */ function exit() public { // get token count for caller & sell them all address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if(_tokens > 0) sell(_tokens); // lambo delivery service withdraw(); } /** * Withdraws all of the callers earnings. */ function withdraw() onlyPeopleWithProfits() public { // setup data address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); // get ref. bonus later in the code // update dividend tracker payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // add ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // lambo delivery service _customerAddress.transfer(_dividends); // fire event onWithdraw(_customerAddress, _dividends); } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyPeopleWithTokens() public { // setup data address _customerAddress = msg.sender; // russian hackers BTFO require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); // update dividends tracker int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; // dividing by zero is a bad idea if (tokenSupply_ > 0) { // update the amount of dividends per token profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } // fire event onTokenSell(_customerAddress, _tokens, _taxedEthereum); } /** * Transfer tokens from the caller to a new holder. * Remember, there's a 10% fee here as well. */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyPeopleWithTokens() public returns(bool) { // setup address _customerAddress = msg.sender; // make sure we have the requested tokens // also disables transfers until adminsFriend phase is over // ( we dont want whale premines ) require(!onlyAdminsFriends && _amountOfTokens <= tokenBalanceLedger_[_customerAddress]); // withdraw all outstanding dividends first if(myDividends(true) > 0) withdraw(); // liquify 10% of the tokens that are transfered // these are dispersed to shareholders uint256 _tokenFee = SafeMath.div(_amountOfTokens, dividendFee_); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); // burn the fee tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); // exchange tokens tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); // update dividend trackers payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); // disperse dividends among holders profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); // fire event Transfer(_customerAddress, _toAddress, _taxedTokens); // ERC20 return true; } /*---------- ADMINISTRATOR ONLY FUNCTIONS ----------*/ /** * In case the amassador quota is not met, the administrator can manually disable the adminsFriend phase. */ function disableInitialStage() onlyAdmin() public { onlyAdminsFriends = false; } /** * Precautionary measures in case we need to adjust the masternode rate. */ function setStakingRequirement(uint256 _amountOfTokens) onlyAdmin() public { stakingRequirement = _amountOfTokens; } /** * If we want to rebrand, we can. */ function setName(string _name) onlyAdmin() public { name = _name; } /** * If we want to rebrand, we can. */ function setSymbol(string _symbol) onlyAdmin() public { symbol = _symbol; } /*---------- HELPERS AND CALCULATORS ----------*/ /** * Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function totalEthereumBalance() public view returns(uint) { return this.balance; } /** * Retrieve the total token supply. */ function totalSupply() public view returns(uint256) { return tokenSupply_; } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } /** * Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus) public view returns(uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { return tokenBalanceLedger_[_customerAddress]; } /** * Retrieve the dividend balance of any single address. */ function dividendsOf(address _customerAddress) view public returns(uint256) { return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } /** * Return the buy price of 1 individual token. */ function sellPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_ ); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_ ); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } /** * Function for the frontend to dynamically retrieve the price scaling of buy orders. */ function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { uint256 _dividends = SafeMath.div(_ethereumToSpend, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } /** * Function for the frontend to dynamically retrieve the price scaling of sell orders. */ function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum, address _referredBy) antiEarlyWhale(_incomingEthereum) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(_incomingEthereum, dividendFee_); uint256 _referralBonus = SafeMath.div(_undividedDividends, 3); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; // no point in continuing execution if OP is a poorfag russian hacker // prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world // (or hackers) // and yes we know that the safemath function automatically rules out the "greater then" equasion. require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); // is the user referred by a masternode? if( // is this a referred purchase? _referredBy != 0x0000000000000000000000000000000000000000 && // no cheating! _referredBy != _customerAddress && // does the referrer have at least X whole tokens? // i.e is the referrer a godly chad masternode tokenBalanceLedger_[_referredBy] >= stakingRequirement ){ // wealth redistribution referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { // no ref purchase // add the referral bonus back to the global dividends cake _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } // we can't give people infinite ethereum if(tokenSupply_ > 0){ // add tokens to the pool tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); // take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder profitPerShare_ += (_dividends * magnitude / (tokenSupply_)); // calculate the amount of tokens the customer receives over his purchase _fee = _fee - (_fee-(_amountOfTokens * (_dividends * magnitude / (tokenSupply_)))); } else { // add tokens to the pool tokenSupply_ = _amountOfTokens; } // update circulating supply & the ledger address for the customer tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // Tells the contract that the buyer doesn't deserve dividends for the tokens before they owned them; //really i know you think you do but you don't int256 _updatedPayouts = (int256) ((profitPerShare_ * _amountOfTokens) - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; // fire event onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy); return _amountOfTokens; } /** * Calculate Token price based on an amount of incoming ethereum * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( // underflow attempts BTFO SafeMath.sub( (sqrt ( (_tokenPriceInitial**2) + (2*(tokenPriceIncremental_ * 1e18)*(_ethereum * 1e18)) + (((tokenPriceIncremental_)**2)*(tokenSupply_**2)) + (2*(tokenPriceIncremental_)*_tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) )/(tokenPriceIncremental_) )-(tokenSupply_) ; return _tokensReceived; } /** * Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( // underflow attempts BTFO SafeMath.sub( ( ( ( tokenPriceInitial_ +(tokenPriceIncremental_ * (_tokenSupply/1e18)) )-tokenPriceIncremental_ )*(tokens_ - 1e18) ),(tokenPriceIncremental_*((tokens_**2-tokens_)/1e18))/2 ) /1e18); return _etherReceived; } //This is where all your gas goes, sorry //Not sorry, you probably only paid 1 gwei function sqrt(uint x) internal pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } /** * @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; } }
0x6060604052600436106101525763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461016057806306fdde031461019157806310d0ffdd1461021b57806318160ddd146102315780632260937314610244578063313ce5671461025a5780633ccfd60b146102835780634b7503341461029857806356d399e8146102ab578063688abbf7146102be5780636b2f4632146102d657806370a08231146102e95780638328b610146103085780638620410b1461031e578063949e8acd1461033157806395d89b411461034457806396bc0f9414610357578063a8e04f341461037e578063a9059cbb14610391578063b84c8246146103b3578063c47f002714610404578063e4849b3214610455578063e9fad8ee1461046b578063f088d5471461047e578063f4fe9fad14610492578063fdb5a03e146104b1575b61015d3460006104c4565b50005b341561016b57600080fd5b61017f600160a060020a0360043516610a6e565b60405190815260200160405180910390f35b341561019c57600080fd5b6101a4610aa4565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101e05780820151838201526020016101c8565b50505050905090810190601f16801561020d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561022657600080fd5b61017f600435610b42565b341561023c57600080fd5b61017f610b72565b341561024f57600080fd5b61017f600435610b79565b341561026557600080fd5b61026d610bb2565b60405160ff909116815260200160405180910390f35b341561028e57600080fd5b610296610bb7565b005b34156102a357600080fd5b61017f610c7e565b34156102b657600080fd5b61017f610cd2565b34156102c957600080fd5b61017f6004351515610cd8565b34156102e157600080fd5b61017f610d1b565b34156102f457600080fd5b61017f600160a060020a0360043516610d29565b341561031357600080fd5b610296600435610d44565b341561032957600080fd5b61017f610d72565b341561033c57600080fd5b61017f610dba565b341561034f57600080fd5b6101a4610dcd565b341561036257600080fd5b61036a610e38565b604051901515815260200160405180910390f35b341561038957600080fd5b610296610e41565b341561039c57600080fd5b61036a600160a060020a0360043516602435610e76565b34156103be57600080fd5b61029660046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061102995505050505050565b341561040f57600080fd5b61029660046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061106995505050505050565b341561046057600080fd5b6102966004356110a4565b341561047657600080fd5b6102966111f7565b61017f600160a060020a036004351661122e565b341561049d57600080fd5b61036a600160a060020a036004351661123a565b34156104bc57600080fd5b61029661124f565b60008060008060008060008060008a6000339050600b60009054906101000a900460ff16801561050657506801158e460913d0000082610502610d1b565b0311155b1561080057600160a060020a03811660009081526003602052604090205460ff161515600114801561055b5750600160a060020a038116600090815260076020526040902054670de0b6b3a764000090830111155b151561056657600080fd5b600160a060020a0381166000908152600760205260409020546105899083611305565b600160a060020a038216600090815260076020819052604090912091909155339a506105b6908e9061131b565b98506105c389600361131b565b97506105cf8989611332565b96506105db8d8a611332565b95506105e686611344565b9450604060020a8702935060008511801561060b57506008546106098682611305565b115b151561061657600080fd5b600160a060020a038c1615801590610640575089600160a060020a03168c600160a060020a031614155b80156106665750600254600160a060020a038d1660009081526004602052604090205410155b156106ac57600160a060020a038c1660009081526005602052604090205461068e9089611305565b600160a060020a038d166000908152600560205260409020556106c2565b6106b68789611305565b9650604060020a870293505b6000600854111561071c576106d960085486611305565b6008819055604060020a88028115156106ee57fe5b60098054929091049091019055600854604060020a880281151561070e57fe5b048502840384039350610722565b60088590555b600160a060020a038a166000908152600460205260409020546107459086611305565b600460008c600160a060020a0316600160a060020a031681526020019081526020016000208190555083856009540203925082600660008c600160a060020a0316600160a060020a03168152602001908152602001600020600082825401925050819055508b600160a060020a03168a600160a060020a03167f022c0d992e4d873a3748436d960d5140c1f9721cf73f7ca5ec679d3d9f4fe2d58f8860405191825260208201526040908101905180910390a3849a50610a5e565b600b805460ff191690553399506108188d600761131b565b985061082589600361131b565b97506108318989611332565b965061083d8d8a611332565b955061084886611344565b9450604060020a8702935060008511801561086d575060085461086b8682611305565b115b151561087857600080fd5b600160a060020a038c16158015906108a2575089600160a060020a03168c600160a060020a031614155b80156108c85750600254600160a060020a038d1660009081526004602052604090205410155b1561090e57600160a060020a038c166000908152600560205260409020546108f09089611305565b600160a060020a038d16600090815260056020526040902055610924565b6109188789611305565b9650604060020a870293505b6000600854111561097e5761093b60085486611305565b6008819055604060020a880281151561095057fe5b60098054929091049091019055600854604060020a880281151561097057fe5b048502840384039350610984565b60088590555b600160a060020a038a166000908152600460205260409020546109a79086611305565b600460008c600160a060020a0316600160a060020a031681526020019081526020016000208190555083856009540203925082600660008c600160a060020a0316600160a060020a03168152602001908152602001600020600082825401925050819055508b600160a060020a03168a600160a060020a03167f022c0d992e4d873a3748436d960d5140c1f9721cf73f7ca5ec679d3d9f4fe2d58f8860405191825260208201526040908101905180910390a3849a505b5050505050505050505092915050565b600160a060020a0316600090815260066020908152604080832054600490925290912054600954604060020a9102919091030490565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b3a5780601f10610b0f57610100808354040283529160200191610b3a565b820191906000526020600020905b815481529060010190602001808311610b1d57829003601f168201915b505050505081565b6000808080610b5285600761131b565b9250610b5e8584611332565b9150610b6982611344565b95945050505050565b6008545b90565b6000806000806008548511151515610b9057600080fd5b610b99856113dc565b9250610ba683600761131b565b9150610b698383611332565b601281565b6000806000610bc66001610cd8565b11610bd057600080fd5b339150610bdd6000610cd8565b600160a060020a03831660008181526006602090815260408083208054604060020a870201905560059091528082208054929055920192509082156108fc0290839051600060405180830381858888f193505050501515610c3d57600080fd5b81600160a060020a03167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc8260405190815260200160405180910390a25050565b60008060008060085460001415610c9c576414f46b04009350610ccc565b610cad670de0b6b3a76400006113dc565b9250610cba83600761131b565b9150610cc68383611332565b90508093505b50505090565b60025481565b60003382610cee57610ce981610a6e565b610d12565b600160a060020a038116600090815260056020526040902054610d1082610a6e565b015b91505b50919050565b600160a060020a0330163190565b600160a060020a031660009081526004602052604090205490565b33600160a060020a0381166000908152600a602052604090205460ff161515610d6c57600080fd5b50600255565b60008060008060085460001415610d905764199c82cc009350610ccc565b610da1670de0b6b3a76400006113dc565b9250610dae83600761131b565b9150610cc68383611305565b600033610dc681610d29565b91505b5090565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b3a5780601f10610b0f57610100808354040283529160200191610b3a565b600b5460ff1681565b33600160a060020a0381166000908152600a602052604090205460ff161515610e6957600080fd5b50600b805460ff19169055565b600080600080600080610e87610dba565b11610e9157600080fd5b600b5433945060ff16158015610ebf5750600160a060020a0384166000908152600460205260409020548611155b1515610eca57600080fd5b6000610ed66001610cd8565b1115610ee457610ee4610bb7565b610eef86600761131b565b9250610efb8684611332565b9150610f06836113dc565b9050610f1460085484611332565b600855600160a060020a038416600090815260046020526040902054610f3a9087611332565b600160a060020a038086166000908152600460205260408082209390935590891681522054610f699083611305565b600160a060020a0388811660008181526004602090815260408083209590955560098054948a16835260069091528482208054948c02909403909355825491815292909220805492850290920190915554600854610fd89190604060020a8402811515610fd257fe5b04611305565b600955600160a060020a038088169085167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060019695505050505050565b33600160a060020a0381166000908152600a602052604090205460ff16151561105157600080fd5b600182805161106492916020019061147d565b505050565b33600160a060020a0381166000908152600a602052604090205460ff16151561109157600080fd5b600082805161106492916020019061147d565b60008060008060008060006110b7610dba565b116110c157600080fd5b33600160a060020a0381166000908152600460205260409020549096508711156110ea57600080fd5b8694506110f6856113dc565b935061110384600761131b565b925061110f8484611332565b915061111d60085486611332565b600855600160a060020a0386166000908152600460205260409020546111439086611332565b600160a060020a03871660009081526004602090815260408083209390935560095460069091529181208054928802604060020a8602019283900390556008549192509011156111aa576111a6600954600854604060020a8602811515610fd257fe5b6009555b85600160a060020a03167fc4823739c5787d2ca17e404aa47d5569ae71dfb49cbf21b3f6152ed238a31139868460405191825260208201526040908101905180910390a250505050505050565b33600160a060020a0381166000908152600460205260408120549081111561122257611222816110a4565b61122a610bb7565b5050565b6000610d1534836104c4565b600a6020526000908152604090205460ff1681565b60008060008061125f6001610cd8565b1161126957600080fd5b6112736000610cd8565b33600160a060020a03811660009081526006602090815260408083208054604060020a870201905560059091528120805490829055909201945092506112ba9084906104c4565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab3615326458848360405191825260208201526040908101905180910390a2505050565b60008282018381101561131457fe5b9392505050565b600080828481151561132957fe5b04949350505050565b60008282111561133e57fe5b50900390565b6008546000906c01431e0fae6d7217caa00000009082906402540be4006113c96113c3730380d4bd8a8678c1bb542c80deb4800000000000880268056bc75e2d631000006002860a02017005e0a1fd2712875988becaad0000000000850201780197d4df19d605767337e9f14d3eec8920e40000000000000001611448565b85611332565b8115156113d257fe5b0403949350505050565b600854600090670de0b6b3a76400008381019181019083906114356414f46b04008285046402540be40002018702600283670de0b6b3a763ffff1982890a8b900301046402540be4000281151561142f57fe5b04611332565b81151561143e57fe5b0495945050505050565b80600260018201045b81811015610d1557809150600281828581151561146a57fe5b040181151561147557fe5b049050611451565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114be57805160ff19168380011785556114eb565b828001600101855582156114eb579182015b828111156114eb5782518255916020019190600101906114d0565b50610dc992610b769250905b80821115610dc957600081556001016114f75600a165627a7a72305820d406178c76244e86aa74ecc24b4bb593579fd77b5fddc01f2ff3ccdfebbe31270029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
2,145
0x2d98c5e92da2204bc2e9142373ed209a7ca9850a
/** *Submitted for verification at Etherscan.io on 2021-02-14 */ /* DARK DEFI is a non-inflationary DeFi ecosystem aiming to provide yield generating investments’ strategies to long-term crypto holders in both markets’ pump and dump. Nowadays, the most common way to secure assets during market dumps is converting assets to stable coins which can thereafter be staked and/or farmed into various DeFi protocols generating yields on the underlying assets. However, currently there is no incentive to hold cryptocurrencies during market’s dumps other than averaging down his purchase price. Therefore, to reward holders with accurate portfolio’s and own liquidity’s management, DARK aims at implementing new autonomous yields generating solutions. The native token of the DARK DEFI ecosystem, called DARK, will enable holders to stake or farm their assets into pools with different pre-defined lock-up periods. However, all these pools will offer the ability to stakers and farmers to withdraw their assets at any time by applying an early withdrawal fee (“EWF”) if the assets are withdrawn before the term of the lock-up period. Also check DARK website: https://darkdefi.org Accessibility The DARK ecosystem is built in a way that it allows for multiple pools and staking options to be offered over a longer period of time. With a very easy to use interface coupled with the detailed instructions. DARK promises a pleasing and easy to understand user experience. Security Project security is one of the primary goal of DARK DEFI. To ensure a secure protocol. DARK ERC20 smart contract will be fully audited and certified be the blockchain consilium, a renowned blockchain auditing firm to ensure higher level of security. */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract DarkDeFi { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a7231582005de53f6ec3bfed9153e7a0733cad496fc425cc77cfc766e9c5826743dcef40364736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,146
0x7c975dAb7a747786A24fa0114a144d263f12C0b2
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ddaea9b8bbbcb3f3bab8b2afbab89dbeb2b3aeb8b3aea4aef3b3b8a9">[email&#160;protected]</a>> contract MultiSigWallet { /* * Events */ 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); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ 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; } /* * Modifiers */ 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 && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { 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]] && _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 newOwner 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 ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity&#39;s code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(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]; } }
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461015e578063173825d91461019257806320ea8d86146101b35780632f54bf6e146101cb5780633411c81c1461020057806354741525146102245780637065cb4814610255578063784547a7146102765780638b51d13f1461028e5780639ace38c2146102a6578063a0e67e2b14610361578063a8abe69a146103c6578063b5dc40c3146103eb578063b77bf60014610403578063ba51a6df14610418578063c01a8c8414610430578063c642747414610448578063d74f8edd146104b1578063dc8452cd146104c6578063e20056e6146104db578063ee22610b14610502575b600034111561015c5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561016a57600080fd5b5061017660043561051a565b60408051600160a060020a039092168252519081900360200190f35b34801561019e57600080fd5b5061015c600160a060020a0360043516610542565b3480156101bf57600080fd5b5061015c6004356106b9565b3480156101d757600080fd5b506101ec600160a060020a0360043516610773565b604080519115158252519081900360200190f35b34801561020c57600080fd5b506101ec600435600160a060020a0360243516610788565b34801561023057600080fd5b50610243600435151560243515156107a8565b60408051918252519081900360200190f35b34801561026157600080fd5b5061015c600160a060020a0360043516610814565b34801561028257600080fd5b506101ec600435610939565b34801561029a57600080fd5b506102436004356109bd565b3480156102b257600080fd5b506102be600435610a2c565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032357818101518382015260200161030b565b50505050905090810190601f1680156103505780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561036d57600080fd5b50610376610aea565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103b257818101518382015260200161039a565b505050509050019250505060405180910390f35b3480156103d257600080fd5b5061037660043560243560443515156064351515610b4d565b3480156103f757600080fd5b50610376600435610c86565b34801561040f57600080fd5b50610243610dff565b34801561042457600080fd5b5061015c600435610e05565b34801561043c57600080fd5b5061015c600435610e84565b34801561045457600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610243948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610f4f9650505050505050565b3480156104bd57600080fd5b50610243610f6e565b3480156104d257600080fd5b50610243610f73565b3480156104e757600080fd5b5061015c600160a060020a0360043581169060243516610f79565b34801561050e57600080fd5b5061015c600435611103565b600380548290811061052857fe5b600091825260209091200154600160a060020a0316905081565b600033301461055057600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561057957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106545782600160a060020a03166003838154811015156105c357fe5b600091825260209091200154600160a060020a03161415610649576003805460001981019081106105f057fe5b60009182526020909120015460038054600160a060020a03909216918490811061061657fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610654565b60019091019061059c565b60038054600019019061066790826113d6565b5060035460045411156106805760035461068090610e05565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff1615156106d757600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561070357600080fd5b600084815260208190526040902060030154849060ff161561072457600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561080d578380156107d5575060008181526020819052604090206003015460ff16155b806107f957508280156107f9575060008181526020819052604090206003015460ff165b15610805576001820191505b6001016107ac565b5092915050565b33301461082057600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561084857600080fd5b81600160a060020a038116151561085e57600080fd5b6003805490506001016004546032821115801561087b5750818111155b801561088657508015155b801561089157508115155b151561089c57600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b6003548110156109b6576000848152600160205260408120600380549192918490811061096757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff161561099b576001820191505b6004548214156109ae57600192506109b6565b60010161093e565b5050919050565b6000805b600354811015610a2657600083815260016020526040812060038054919291849081106109ea57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a1e576001820191505b6001016109c1565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610ad75780601f10610aac57610100808354040283529160200191610ad7565b820191906000526020600020905b815481529060010190602001808311610aba57829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b4257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b24575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610b7f578160200160208202803883390190505b50925060009150600090505b600554811015610c0657858015610bb4575060008181526020819052604090206003015460ff16155b80610bd85750848015610bd8575060008181526020819052604090206003015460ff165b15610bfe57808383815181101515610bec57fe5b60209081029091010152600191909101905b600101610b8b565b878703604051908082528060200260200182016040528015610c32578160200160208202803883390190505b5093508790505b86811015610c7b578281815181101515610c4f57fe5b9060200190602002015184898303815181101515610c6957fe5b60209081029091010152600101610c39565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610cbb578160200160208202803883390190505b50925060009150600090505b600354811015610d785760008581526001602052604081206003805491929184908110610cf057fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610d70576003805482908110610d2b57fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d5157fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610cc7565b81604051908082528060200260200182016040528015610da2578160200160208202803883390190505b509350600090505b81811015610df7578281815181101515610dc057fe5b906020019060200201518482815181101515610dd857fe5b600160a060020a03909216602092830290910190910152600101610daa565b505050919050565b60055481565b333014610e1157600080fd5b6003548160328211801590610e265750818111155b8015610e3157508015155b8015610e3c57508115155b1515610e4757600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff161515610ea257600080fd5b6000828152602081905260409020548290600160a060020a03161515610ec757600080fd5b60008381526001602090815260408083203380855292529091205484919060ff1615610ef257600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610f4885611103565b5050505050565b6000610f5c8484846112c3565b9050610f6781610e84565b9392505050565b603281565b60045481565b6000333014610f8757600080fd5b600160a060020a038316600090815260026020526040902054839060ff161515610fb057600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615610fd857600080fd5b600092505b6003548310156110695784600160a060020a031660038481548110151561100057fe5b600091825260209091200154600160a060020a0316141561105e578360038481548110151561102b57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550611069565b600190920191610fdd565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b3360008181526002602052604081205490919060ff16151561112457600080fd5b60008381526001602090815260408083203380855292529091205484919060ff16151561115057600080fd5b600085815260208190526040902060030154859060ff161561117157600080fd5b61117a86610939565b156112bb576000868152602081815260409182902060038101805460ff19166001908117909155815481830154600280850180548851601f60001997831615610100029790970190911692909204948501879004870282018701909752838152939a5061124e95600160a060020a03909216949093919083908301828280156112445780601f1061121957610100808354040283529160200191611244565b820191906000526020600020905b81548152906001019060200180831161122757829003601f168201915b50505050506113b3565b156112835760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a26112bb565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038501805460ff191690555b505050505050565b600083600160a060020a03811615156112db57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff19169416939093178355516001830155925180519496509193909261135b9260028501929101906113ff565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b8154818355818111156113fa576000838152602090206113fa91810190830161147d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061144057805160ff191683800117855561146d565b8280016001018555821561146d579182015b8281111561146d578251825591602001919060010190611452565b5061147992915061147d565b5090565b610b4a91905b8082111561147957600081556001016114835600a165627a7a72305820f9d387618ecf61f2957fb6c189b12fdd9e7ff22589c42c93de4fb77367f17aac0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,147
0xa533f64b0947bbe8bc795aab0a2ce721f805fe0e
//telegram @VikingsETH // 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 Vikings 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 = 1000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redis = 1; uint256 private _tax = 10; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "Vikings"; string private constant _symbol = "VIKINGS"; 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; 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 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; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklistBot(address _address) external { require(_msgSender() == _feeAddrWallet1); bots[_address] = true; } function removeFromBlacklist(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); } }
0x60806040526004361061010d5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033c578063a9059cbb14610367578063c3c8cd80146103a4578063c9567bf9146103bb578063dd62ed3e146103d257610114565b80636fc3eaec146102a657806370a08231146102bd578063715018a6146102fa5780638da5cb5b1461031157610114565b806323b872dd116100dc57806323b872dd146101d55780632ab3083814610212578063313ce56714610229578063537df3b6146102545780635932ead11461027d57610114565b806306fdde031461011957806308aad1f114610144578063095ea7b31461016d57806318160ddd146101aa57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61040f565b60405161013b9190612536565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612072565b61044c565b005b34801561017957600080fd5b50610194600480360381019061018f919061214f565b610508565b6040516101a1919061251b565b60405180910390f35b3480156101b657600080fd5b506101bf610526565b6040516101cc9190612658565b60405180910390f35b3480156101e157600080fd5b506101fc60048036038101906101f79190612100565b610538565b604051610209919061251b565b60405180910390f35b34801561021e57600080fd5b50610227610611565b005b34801561023557600080fd5b5061023e6106b9565b60405161024b91906126cd565b60405180910390f35b34801561026057600080fd5b5061027b60048036038101906102769190612072565b6106c2565b005b34801561028957600080fd5b506102a4600480360381019061029f919061218b565b61077e565b005b3480156102b257600080fd5b506102bb610830565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612072565b6108a2565b6040516102f19190612658565b60405180910390f35b34801561030657600080fd5b5061030f6108f3565b005b34801561031d57600080fd5b50610326610a46565b604051610333919061244d565b60405180910390f35b34801561034857600080fd5b50610351610a6f565b60405161035e9190612536565b60405180910390f35b34801561037357600080fd5b5061038e6004803603810190610389919061214f565b610aac565b60405161039b919061251b565b60405180910390f35b3480156103b057600080fd5b506103b9610aca565b005b3480156103c757600080fd5b506103d0610b44565b005b3480156103de57600080fd5b506103f960048036038101906103f491906120c4565b6110a3565b6040516104069190612658565b60405180910390f35b60606040518060400160405280600781526020017f56696b696e677300000000000000000000000000000000000000000000000000815250905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661048d61112a565b73ffffffffffffffffffffffffffffffffffffffff16146104ad57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061051c61051561112a565b8484611132565b6001905092915050565b600069d3c21bcecceda1000000905090565b60006105458484846112fd565b6106068461055161112a565b61060185604051806060016040528060288152602001612ba760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105b761112a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115039092919063ffffffff16565b611132565b600190509392505050565b61061961112a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d906125d8565b60405180910390fd5b69d3c21bcecceda1000000601181905550565b60006009905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661070361112a565b73ffffffffffffffffffffffffffffffffffffffff161461072357600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61078661112a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610813576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080a906125d8565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661087161112a565b73ffffffffffffffffffffffffffffffffffffffff161461089157600080fd5b600047905061089f81611567565b50565b60006108ec600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d3565b9050919050565b6108fb61112a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097f906125d8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f56494b494e475300000000000000000000000000000000000000000000000000815250905090565b6000610ac0610ab961112a565b84846112fd565b6001905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b0b61112a565b73ffffffffffffffffffffffffffffffffffffffff1614610b2b57600080fd5b6000610b36306108a2565b9050610b4181611641565b50565b610b4c61112a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd0906125d8565b60405180910390fd5b601060149054906101000a900460ff1615610c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2090612638565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cba30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda1000000611132565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0057600080fd5b505afa158015610d14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d38919061209b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9a57600080fd5b505afa158015610dae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd2919061209b565b6040518363ffffffff1660e01b8152600401610def929190612468565b602060405180830381600087803b158015610e0957600080fd5b505af1158015610e1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e41919061209b565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eca306108a2565b600080610ed5610a46565b426040518863ffffffff1660e01b8152600401610ef7969594939291906124ba565b6060604051808303818588803b158015610f1057600080fd5b505af1158015610f24573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f4991906121dd565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff02191690831515021790555069d3c21bcecceda10000006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104d929190612491565b602060405180830381600087803b15801561106757600080fd5b505af115801561107b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109f91906121b4565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119990612618565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611212576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120990612578565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112f09190612658565b60405180910390a3505050565b60008111611340576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611337906125f8565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561139757600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146114a757600a54600c81905550600b54600d8190555060006113e7306108a2565b9050601060159054906101000a900460ff161580156114545750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561146c5750601060169054906101000a900460ff165b156114a55760008111156114845761148381611641565b5b600047905067016345785d8a00008111156114a3576114a247611567565b5b505b505b6114af610a46565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576000600d819055506000600c819055505b6114fe83838361193b565b505050565b600083831115829061154b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115429190612536565b60405180910390fd5b506000838561155a919061281e565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115cf573d6000803e3d6000fd5b5050565b600060085482111561161a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161190612558565b60405180910390fd5b600061162461194b565b9050611639818461197690919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561169f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156116cd5781602001602082028036833780820191505090505b509050308160008151811061170b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156117ad57600080fd5b505afa1580156117c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e5919061209b565b8160018151811061181f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061188630600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611132565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118ea959493929190612673565b600060405180830381600087803b15801561190457600080fd5b505af1158015611918573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6119468383836119c0565b505050565b6000806000611958611b8b565b9150915061196f818361197690919063ffffffff16565b9250505090565b60006119b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bf0565b905092915050565b6000806000806000806119d287611c53565b955095509550955095509550611a3086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cbb90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ac585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b1181611d63565b611b1b8483611e20565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b789190612658565b60405180910390a3505050505050505050565b60008060006008549050600069d3c21bcecceda10000009050611bc369d3c21bcecceda100000060085461197690919063ffffffff16565b821015611be35760085469d3c21bcecceda1000000935093505050611bec565b81819350935050505b9091565b60008083118290611c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2e9190612536565b60405180910390fd5b5060008385611c469190612793565b9050809150509392505050565b6000806000806000806000806000611c708a600c54600d54611e5a565b9250925092506000611c8061194b565b90506000806000611c938e878787611ef0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611cfd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611503565b905092915050565b6000808284611d14919061273d565b905083811015611d59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5090612598565b60405180910390fd5b8091505092915050565b6000611d6d61194b565b90506000611d848284611f7990919063ffffffff16565b9050611dd881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611e3582600854611cbb90919063ffffffff16565b600881905550611e5081600954611d0590919063ffffffff16565b6009819055505050565b600080600080611e866064611e78888a611f7990919063ffffffff16565b61197690919063ffffffff16565b90506000611eb06064611ea2888b611f7990919063ffffffff16565b61197690919063ffffffff16565b90506000611ed982611ecb858c611cbb90919063ffffffff16565b611cbb90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611f098589611f7990919063ffffffff16565b90506000611f208689611f7990919063ffffffff16565b90506000611f378789611f7990919063ffffffff16565b90506000611f6082611f528587611cbb90919063ffffffff16565b611cbb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611f8c5760009050611fee565b60008284611f9a91906127c4565b9050828482611fa99190612793565b14611fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fe0906125b8565b60405180910390fd5b809150505b92915050565b60008135905061200381612b61565b92915050565b60008151905061201881612b61565b92915050565b60008135905061202d81612b78565b92915050565b60008151905061204281612b78565b92915050565b60008135905061205781612b8f565b92915050565b60008151905061206c81612b8f565b92915050565b60006020828403121561208457600080fd5b600061209284828501611ff4565b91505092915050565b6000602082840312156120ad57600080fd5b60006120bb84828501612009565b91505092915050565b600080604083850312156120d757600080fd5b60006120e585828601611ff4565b92505060206120f685828601611ff4565b9150509250929050565b60008060006060848603121561211557600080fd5b600061212386828701611ff4565b935050602061213486828701611ff4565b925050604061214586828701612048565b9150509250925092565b6000806040838503121561216257600080fd5b600061217085828601611ff4565b925050602061218185828601612048565b9150509250929050565b60006020828403121561219d57600080fd5b60006121ab8482850161201e565b91505092915050565b6000602082840312156121c657600080fd5b60006121d484828501612033565b91505092915050565b6000806000606084860312156121f257600080fd5b60006122008682870161205d565b93505060206122118682870161205d565b92505060406122228682870161205d565b9150509250925092565b60006122388383612244565b60208301905092915050565b61224d81612852565b82525050565b61225c81612852565b82525050565b600061226d826126f8565b612277818561271b565b9350612282836126e8565b8060005b838110156122b357815161229a888261222c565b97506122a58361270e565b925050600181019050612286565b5085935050505092915050565b6122c981612864565b82525050565b6122d8816128a7565b82525050565b60006122e982612703565b6122f3818561272c565b93506123038185602086016128b9565b61230c8161294a565b840191505092915050565b6000612324602a8361272c565b915061232f8261295b565b604082019050919050565b600061234760228361272c565b9150612352826129aa565b604082019050919050565b600061236a601b8361272c565b9150612375826129f9565b602082019050919050565b600061238d60218361272c565b915061239882612a22565b604082019050919050565b60006123b060208361272c565b91506123bb82612a71565b602082019050919050565b60006123d360298361272c565b91506123de82612a9a565b604082019050919050565b60006123f660248361272c565b915061240182612ae9565b604082019050919050565b600061241960178361272c565b915061242482612b38565b602082019050919050565b61243881612890565b82525050565b6124478161289a565b82525050565b60006020820190506124626000830184612253565b92915050565b600060408201905061247d6000830185612253565b61248a6020830184612253565b9392505050565b60006040820190506124a66000830185612253565b6124b3602083018461242f565b9392505050565b600060c0820190506124cf6000830189612253565b6124dc602083018861242f565b6124e960408301876122cf565b6124f660608301866122cf565b6125036080830185612253565b61251060a083018461242f565b979650505050505050565b600060208201905061253060008301846122c0565b92915050565b6000602082019050818103600083015261255081846122de565b905092915050565b6000602082019050818103600083015261257181612317565b9050919050565b600060208201905081810360008301526125918161233a565b9050919050565b600060208201905081810360008301526125b18161235d565b9050919050565b600060208201905081810360008301526125d181612380565b9050919050565b600060208201905081810360008301526125f1816123a3565b9050919050565b60006020820190508181036000830152612611816123c6565b9050919050565b60006020820190508181036000830152612631816123e9565b9050919050565b600060208201905081810360008301526126518161240c565b9050919050565b600060208201905061266d600083018461242f565b92915050565b600060a082019050612688600083018861242f565b61269560208301876122cf565b81810360408301526126a78186612262565b90506126b66060830185612253565b6126c3608083018461242f565b9695505050505050565b60006020820190506126e2600083018461243e565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061274882612890565b915061275383612890565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612788576127876128ec565b5b828201905092915050565b600061279e82612890565b91506127a983612890565b9250826127b9576127b861291b565b5b828204905092915050565b60006127cf82612890565b91506127da83612890565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612813576128126128ec565b5b828202905092915050565b600061282982612890565b915061283483612890565b925082821015612847576128466128ec565b5b828203905092915050565b600061285d82612870565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006128b282612890565b9050919050565b60005b838110156128d75780820151818401526020810190506128bc565b838111156128e6576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612b6a81612852565b8114612b7557600080fd5b50565b612b8181612864565b8114612b8c57600080fd5b50565b612b9881612890565b8114612ba357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205683ee04050c0554be9bf1ea44d0176b51baa5b04bc547662519a9778902086064736f6c63430008040033
{"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"}]}}
2,148
0x99a24D1DD0575507DeC8ef00BA2e4Abf06525F64
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ 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; } } // /* * @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; } } // /** * @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. */ 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; } } // /** * @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); } // contract VestingContract is Ownable { using SafeMath for uint256; // CNTR Token Contract IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); uint256[] vestingSchedule; address public receivingAddress; uint256 public vestingStartTime; uint256 constant public releaseInterval = 30 days; uint256 public totalTokens; uint256 public totalDistributed; uint256 index = 0; constructor(address _address) public { receivingAddress = _address; } function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner { require(vestingStartTime == 0); vestingSchedule = _vestingSchedule; for(uint256 i = 0; i < vestingSchedule.length; i++) { totalTokens = totalTokens.add(vestingSchedule[i]); } } function updateReceivingAddress(address _address) public onlyOwner { receivingAddress = _address; } function releaseToken() public { require(vestingSchedule.length > 0); require(msg.sender == owner() || msg.sender == receivingAddress); if (vestingStartTime == 0) { require(msg.sender == owner()); vestingStartTime = block.timestamp; } for (uint256 i = index; i < vestingSchedule.length; i++) { if (block.timestamp >= vestingStartTime + (index * releaseInterval)) { tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether)); totalDistributed = totalDistributed.add(vestingSchedule[i]); index = index.add(1); } else { break; } } } function getVestingSchedule() public view returns (uint256[] memory) { return vestingSchedule; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,149
0x85bC51D4491F8A1046BF6a7975A3234Dcf49ac80
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ 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; } } // /* * @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; } } // /** * @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. */ 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; } } // /** * @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); } // contract VestingContract is Ownable { using SafeMath for uint256; // CNTR Token Contract IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); uint256[] vestingSchedule; address public receivingAddress; uint256 public vestingStartTime; uint256 constant public releaseInterval = 30 days; uint256 index = 0; constructor(address _address) public { receivingAddress = _address; } function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner { require(vestingStartTime == 0); vestingSchedule = _vestingSchedule; } function updateReceivingAddress(address _address) public onlyOwner { receivingAddress = _address; } function releaseToken() public { require(vestingSchedule.length > 0); require(msg.sender == owner() || msg.sender == receivingAddress); if (vestingStartTime == 0) { require(msg.sender == owner()); vestingStartTime = block.timestamp; } for (uint256 i = index; i < vestingSchedule.length; i++) { if (block.timestamp >= vestingStartTime + (index * releaseInterval)) { tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether)); index = index.add(1); } else { break; } } } function getVestingSchedule() public view returns (uint256[] memory) { return vestingSchedule; } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063a3d272ce11610066578063a3d272ce146101be578063a8660a7814610202578063c4b6c5fa14610220578063ec715a31146102d8578063f2fde38b146102e25761009e565b80631db87be8146100a35780631f8db268146100ed5780633a05f0d81461010b578063715018a61461016a5780638da5cb5b14610174575b600080fd5b6100ab610326565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100f561034c565b6040518082815260200191505060405180910390f35b610113610353565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561015657808201518184015260208101905061013b565b505050509050019250505060405180910390f35b6101726103ab565b005b61017c610533565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610200600480360360208110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061055c565b005b61020a610669565b6040518082815260200191505060405180910390f35b6102d66004803603602081101561023657600080fd5b810190808035906020019064010000000081111561025357600080fd5b82018360208201111561026557600080fd5b8035906020019184602083028401116401000000008311171561028757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061066f565b005b6102e0610761565b005b610324600480360360208110156102f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109e1565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103a157602002820191906000526020600020905b81548152602001906001019080831161038d575b5050505050905090565b6103b3610bee565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610474576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610564610bee565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610625576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b610677610bee565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610738576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461074757600080fd5b806002908051906020019061075d929190610c7e565b5050565b60006002805490501161077357600080fd5b61077b610533565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108015750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61080a57600080fd5b6000600454141561085c5761081d610533565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085457600080fd5b426004819055505b600060055490505b6002805490508110156109de5762278d00600554026004540142106109cc57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106108fa57fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561096f57600080fd5b505af1158015610983573d6000803e3d6000fd5b505050506040513d602081101561099957600080fd5b8101908080519060200190929190505050506109c16001600554610bf690919063ffffffff16565b6005819055506109d1565b6109de565b8080600101915050610864565b50565b6109e9610bee565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aaa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610cf16026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610c74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610cba579160200282015b82811115610cb9578251825591602001919060010190610c9e565b5b509050610cc79190610ccb565b5090565b610ced91905b80821115610ce9576000816000905550600101610cd1565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220038fb532ed2e64e11f018217ec622374df7e2f0ae188b497304d3fb430740aa964736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,150
0x8beb43014c5b9c86dd6e00baa9261c4da912326e
/** *Submitted for verification at Etherscan.io on 2021-06-26 */ /** *Submitted for verification at Etherscan.io on 2021-06-26 */ /** *Submitted for verification at Etherscan.io on 2021-06-26 */ /** *Submitted for verification at Etherscan.io on 2021-06-26 */ //FurReal Token ($FR) //Powerful Bot Protect yes // website: https://www.furrealtoken.com/ //Telegram: https://t.me/FurRealToken // Twitter: https://twitter.com/TokenFur //CG, CMC listing: Ongoing //Fair Launch // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } 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 FurReal is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FurReal"; string private constant _symbol = "FR"; 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 = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f04565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a27565b61045e565b6040516101789190612ee9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d8565b61048d565b6040516101e09190612ee9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294a565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa4565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294a565b610783565b6040516102b191906130a6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f04565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a27565b61098d565b60405161035b9190612ee9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a63565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af6565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299c565b61121a565b60405161041891906130a6565b60405180910390f35b60606040518060400160405280600781526020017f4675725265616c00000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137df60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db8565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4652000000000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bc565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e26565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613066565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612973565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612973565b6040518363ffffffff1660e01b8152600401610e1f929190612e36565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612973565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e88565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e5f565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612acd565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe6565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa6565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212090919063ffffffff16565b61219b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130a6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613046565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f66565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130a6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613026565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f26565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613006565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613086565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131dc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e26565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121e5565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612f04565b60405180910390fd5b5060008385611c8a91906132bd565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfa600a611cec60048661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d25573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d89600a611d7b60068661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db4573d6000803e3d6000fd5b5050565b6000600654821115611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df690612f46565b60405180910390fd5b6000611e09612212565b9050611e1e818461219b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e84577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb25781602001602082028036833780820191505090505b5090503081600081518110611ef0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fca9190612973565b81600181518110612004577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cf9594939291906130c1565b600060405180830381600087803b1580156120e957600080fd5b505af11580156120fd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121335760009050612195565b600082846121419190613263565b90508284826121509190613232565b14612190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218790612fc6565b60405180910390fd5b809150505b92915050565b60006121dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223d565b905092915050565b806121f3576121f26122a0565b5b6121fe8484846122d1565b8061220c5761220b61249c565b5b50505050565b600080600061221f6124ae565b91509150612236818361219b90919063ffffffff16565b9250505090565b60008083118290612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b9190612f04565b60405180910390fd5b50600083856122939190613232565b9050809150509392505050565b60006008541480156122b457506000600954145b156122be576122cf565b600060088190555060006009819055505b565b6000806000806000806122e387612510565b95509550955095509550955061234186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242281612620565b61242c84836126dd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248991906130a6565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124e4683635c9adc5dea0000060065461219b90919063ffffffff16565b82101561250357600654683635c9adc5dea0000093509350505061250c565b81819350935050505b9091565b600080600080600080600080600061252d8a600854600954612717565b925092509250600061253d612212565b905060008060006125508e8787876127ad565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125d191906131dc565b905083811015612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260d90612f86565b60405180910390fd5b8091505092915050565b600061262a612212565b90506000612641828461212090919063ffffffff16565b905061269581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f28260065461257890919063ffffffff16565b60068190555061270d816007546125c290919063ffffffff16565b6007819055505050565b6000806000806127436064612735888a61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061276d606461275f888b61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061279682612788858c61257890919063ffffffff16565b61257890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c6858961212090919063ffffffff16565b905060006127dd868961212090919063ffffffff16565b905060006127f4878961212090919063ffffffff16565b9050600061281d8261280f858761257890919063ffffffff16565b61257890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128496128448461315b565b613136565b9050808382526020820190508285602086028201111561286857600080fd5b60005b85811015612898578161287e88826128a2565b84526020840193506020830192505060018101905061286b565b5050509392505050565b6000813590506128b181613799565b92915050565b6000815190506128c681613799565b92915050565b600082601f8301126128dd57600080fd5b81356128ed848260208601612836565b91505092915050565b600081359050612905816137b0565b92915050565b60008151905061291a816137b0565b92915050565b60008135905061292f816137c7565b92915050565b600081519050612944816137c7565b92915050565b60006020828403121561295c57600080fd5b600061296a848285016128a2565b91505092915050565b60006020828403121561298557600080fd5b6000612993848285016128b7565b91505092915050565b600080604083850312156129af57600080fd5b60006129bd858286016128a2565b92505060206129ce858286016128a2565b9150509250929050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016128a2565b9350506020612a0c868287016128a2565b9250506040612a1d86828701612920565b9150509250925092565b60008060408385031215612a3a57600080fd5b6000612a48858286016128a2565b9250506020612a5985828601612920565b9150509250929050565b600060208284031215612a7557600080fd5b600082013567ffffffffffffffff811115612a8f57600080fd5b612a9b848285016128cc565b91505092915050565b600060208284031215612ab657600080fd5b6000612ac4848285016128f6565b91505092915050565b600060208284031215612adf57600080fd5b6000612aed8482850161290b565b91505092915050565b600060208284031215612b0857600080fd5b6000612b1684828501612920565b91505092915050565b600080600060608486031215612b3457600080fd5b6000612b4286828701612935565b9350506020612b5386828701612935565b9250506040612b6486828701612935565b9150509250925092565b6000612b7a8383612b86565b60208301905092915050565b612b8f816132f1565b82525050565b612b9e816132f1565b82525050565b6000612baf82613197565b612bb981856131ba565b9350612bc483613187565b8060005b83811015612bf5578151612bdc8882612b6e565b9750612be7836131ad565b925050600181019050612bc8565b5085935050505092915050565b612c0b81613303565b82525050565b612c1a81613346565b82525050565b6000612c2b826131a2565b612c3581856131cb565b9350612c45818560208601613358565b612c4e81613492565b840191505092915050565b6000612c666023836131cb565b9150612c71826134a3565b604082019050919050565b6000612c89602a836131cb565b9150612c94826134f2565b604082019050919050565b6000612cac6022836131cb565b9150612cb782613541565b604082019050919050565b6000612ccf601b836131cb565b9150612cda82613590565b602082019050919050565b6000612cf2601d836131cb565b9150612cfd826135b9565b602082019050919050565b6000612d156021836131cb565b9150612d20826135e2565b604082019050919050565b6000612d386020836131cb565b9150612d4382613631565b602082019050919050565b6000612d5b6029836131cb565b9150612d668261365a565b604082019050919050565b6000612d7e6025836131cb565b9150612d89826136a9565b604082019050919050565b6000612da16024836131cb565b9150612dac826136f8565b604082019050919050565b6000612dc46017836131cb565b9150612dcf82613747565b602082019050919050565b6000612de76011836131cb565b9150612df282613770565b602082019050919050565b612e068161332f565b82525050565b612e1581613339565b82525050565b6000602082019050612e306000830184612b95565b92915050565b6000604082019050612e4b6000830185612b95565b612e586020830184612b95565b9392505050565b6000604082019050612e746000830185612b95565b612e816020830184612dfd565b9392505050565b600060c082019050612e9d6000830189612b95565b612eaa6020830188612dfd565b612eb76040830187612c11565b612ec46060830186612c11565b612ed16080830185612b95565b612ede60a0830184612dfd565b979650505050505050565b6000602082019050612efe6000830184612c02565b92915050565b60006020820190508181036000830152612f1e8184612c20565b905092915050565b60006020820190508181036000830152612f3f81612c59565b9050919050565b60006020820190508181036000830152612f5f81612c7c565b9050919050565b60006020820190508181036000830152612f7f81612c9f565b9050919050565b60006020820190508181036000830152612f9f81612cc2565b9050919050565b60006020820190508181036000830152612fbf81612ce5565b9050919050565b60006020820190508181036000830152612fdf81612d08565b9050919050565b60006020820190508181036000830152612fff81612d2b565b9050919050565b6000602082019050818103600083015261301f81612d4e565b9050919050565b6000602082019050818103600083015261303f81612d71565b9050919050565b6000602082019050818103600083015261305f81612d94565b9050919050565b6000602082019050818103600083015261307f81612db7565b9050919050565b6000602082019050818103600083015261309f81612dda565b9050919050565b60006020820190506130bb6000830184612dfd565b92915050565b600060a0820190506130d66000830188612dfd565b6130e36020830187612c11565b81810360408301526130f58186612ba4565b90506131046060830185612b95565b6131116080830184612dfd565b9695505050505050565b60006020820190506131306000830184612e0c565b92915050565b6000613140613151565b905061314c828261338b565b919050565b6000604051905090565b600067ffffffffffffffff82111561317657613175613463565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e78261332f565b91506131f28361332f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322757613226613405565b5b828201905092915050565b600061323d8261332f565b91506132488361332f565b92508261325857613257613434565b5b828204905092915050565b600061326e8261332f565b91506132798361332f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b2576132b1613405565b5b828202905092915050565b60006132c88261332f565b91506132d38361332f565b9250828210156132e6576132e5613405565b5b828203905092915050565b60006132fc8261330f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133518261332f565b9050919050565b60005b8381101561337657808201518184015260208101905061335b565b83811115613385576000848401525b50505050565b61339482613492565b810181811067ffffffffffffffff821117156133b3576133b2613463565b5b80604052505050565b60006133c78261332f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fa576133f9613405565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a2816132f1565b81146137ad57600080fd5b50565b6137b981613303565b81146137c457600080fd5b50565b6137d08161332f565b81146137db57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ea687004d669e211499f7bd88772fd6c5f362051bbdb55f3aa0141b44d89956164736f6c63430008040033
{"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"}]}}
2,151
0xc461cc47ae7e8218b419fcd310039e3d2b90a9f0
pragma solidity ^0.4.23; // SPDX-License-Identifier: MIT /** * @dev Interface of the ERC20 standard as defined in the EIP. */ // SPDX-License-Identifier: Unlicensed interface IERC20 { 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); } /** * @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 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); } } contract deracle is Ownable{ struct User{ int32 Id; int8 ReferCount; int8 Level; int32 UplineId; int32 LeftId; int32 RightId; int32 Position; int32 ReferralId; address OwnerAddress; bool IsPayout; bool IsEndGamePayout; uint CreatedBlock; uint CreatedTime; } mapping(uint32 => User) userlistbypos; mapping(uint32 => User) userlistbyid; mapping(address => int32[]) public userids; int8 public currentLevel; int public userCounter = 0; int idcounter = 3; uint32 public nextPosition = 1; address public token; address public owner; address private keeper; address public maintainer; uint public ExpiryInvestmentTimestamp; bool public IsExpired; uint public PayoutAmount; uint public MainterPayoutAmount; int public UnpaidUserCount; int public nextUnpaidUser = 3; IERC20 public ERC20Interface; struct Transfer { address contract_; address to_; uint256 amount_; bool failed_; } /** * @dev Event to notify if transfer successful or failed * after account approval verified */ event TransferSuccessful( address indexed from_, address indexed to_, uint256 amount_ ); event TransferFailed( address indexed from_, address indexed to_, uint256 amount_ ); /** * @dev a list of all transfers successful or unsuccessful */ Transfer public transaction; // uint public investamt = 500000000; // uint public referralamt = 250000000; // uint public maintaineramt = 50000000; uint public investamt = 100000; uint public referralamt = 50000; uint public maintaineramt = 10000; constructor() public { owner = msg.sender; } function Invest(int8 quantity, uint32 uplineId) public returns (bool){ require(quantity > 0, "Minimum Investment Quantity Is 1"); require(isUserExists(uplineId), "Referral Id Does Not Exist"); require(isContractAlive(), "Contract terminated. Investment was helt for more than 365 days"); for(int32 j =0; j < quantity; j++){ //Pay the platform require(!IsExpired, "Contract terminated. Investment was helt for more than 365 days"); require(depositTokens(uplineId)); User memory user; int32[] memory array = new int32[](1); array[0] = 1; if(nextPosition == 1){ user.Id = 1; user.ReferCount = 0; user.Level = 0; user.UplineId = -1; user.LeftId = -1; user.RightId = -1; user.Position = 1; user.ReferralId = -1; user.OwnerAddress = msg.sender; user.IsPayout = true; user.IsEndGamePayout = true; user.CreatedBlock = 0; user.CreatedTime = 0; userlistbyid[1] = user; userlistbypos[1] = user; nextPosition = 2; } userCounter += idcounter; //GET UPLINE User memory upline = userlistbyid[uint32(uplineId)]; //CHECK WHICH SLOT UPLINE MADE int32 connectedUplineId = 0; int32 uplinereferred = upline.ReferCount; if (uplinereferred < 2) //1st / 2nd leg { connectedUplineId = insertNext(uplineId); } else //3rd LEG , RESET , FIND THE SUITABLE NODE { connectedUplineId = insertThird(uplineId); } int isrightleg = 0; if (userlistbyid[uint32(connectedUplineId)].LeftId != -1) { isrightleg = 1; userlistbyid[uint32(connectedUplineId)].RightId = int32(userCounter); } else { userlistbyid[uint32(connectedUplineId)].LeftId = int32(userCounter); } user.Id = int32(userCounter); user.ReferCount = 0; user.Level = userlistbyid[uint32(connectedUplineId)].Level + 1; user.UplineId = int32(connectedUplineId); user.LeftId = -1; user.RightId = -1; user.Position = int32((userlistbyid[uint32(connectedUplineId)].Position * 2) + isrightleg); user.OwnerAddress = msg.sender; user.ReferralId = int32(uplineId); user.IsPayout = false; user.IsEndGamePayout = false; user.CreatedBlock = block_call(); user.CreatedTime = time_call(); if(user.Level > currentLevel){ currentLevel = user.Level; } userlistbyid[uint32(userCounter)] = user; userlistbypos[uint32(user.Position)] = user; userids[msg.sender].push(int32(user.Id)); ExpiryInvestmentTimestamp = time_call() + 365 days; } return true; } function isUserExists(uint32 userid) view internal returns (bool) { if(nextPosition == 1){ return true; } if(userid == 1){ return false; } return (userlistbyid[uint32(userid)].Id != 0); } function isContractAlive() view internal returns (bool){ if(nextPosition == 1){ return true; } if(time_call() < ExpiryInvestmentTimestamp){ return true; } else{ return false; } } function block_call() view internal returns (uint256 blocknumber){ return block.number; } function time_call() view internal returns (uint256 timestamp){ return now; } function insertNext(uint32 uplineId) internal returns (int32 connectedUplineId){ while(true){ if(userlistbypos[uint32(nextPosition)].Id != 0){ nextPosition++; } else{ break; } } int32 previouslevelfirstuplineid = -1; if (nextPosition % 2 == 0) { previouslevelfirstuplineid = int32((nextPosition) / 2); } else { previouslevelfirstuplineid = int32((nextPosition - 1) / 2); } connectedUplineId = userlistbypos[uint32(previouslevelfirstuplineid)].Id; userlistbyid[uint32(uplineId)].ReferCount++; nextPosition++; while(true){ if(userlistbypos[uint32(nextPosition)].Id != 0){ nextPosition++; } else{ break; } } } function insertThird(uint32 uplineId) internal returns (int32 connectedUplineId){ //RESET THE UPLINE COUNT userlistbyid[uint32(uplineId)].ReferCount = 0; //FIND SUITABLE NODE // get the left if empty direct use , if not empty then compare global position value , // if global position more then most right then move next level , until global position is in the middle of left and right then v just loop that particular level uint32 leftposition = uint32(userlistbyid[uint32(uplineId)].Position); uint32 rightposition = uint32(userlistbyid[uint32(uplineId)].Position); while(true){ leftposition = uint32(leftposition * 2); rightposition = uint32(rightposition * 2 + 1); if(nextPosition < leftposition){ //Find empty node between left to rightposition uint32 tempPosition = leftposition; uint32 count = rightposition - leftposition + 1; for(uint32 i = 0; i < count; i++){ if(userlistbypos[tempPosition + i].Id == 0){ connectedUplineId = userlistbypos[(tempPosition + i) / 2].Id; return connectedUplineId; } } } if(leftposition == nextPosition){ connectedUplineId = userlistbypos[nextPosition / 2].Id; return connectedUplineId; } if(rightposition == nextPosition){ connectedUplineId = userlistbypos[(nextPosition - 1) / 2].Id; return connectedUplineId; } if(nextPosition > leftposition && nextPosition < rightposition){ //Inset at next Postion if(nextPosition % 2 == 0){ connectedUplineId = userlistbypos[nextPosition / 2].Id; return connectedUplineId; } else{ connectedUplineId = userlistbypos[(nextPosition - 1) / 2].Id; return connectedUplineId; } } } } function depositTokens( uint32 uplineId ) internal returns (bool success){ require(token != 0x0); address contract_ = token; address from_ = msg.sender; ERC20Interface = IERC20(contract_); //Transfer to contract if (investamt > ERC20Interface.allowance(from_, address(this))) { emit TransferFailed(from_, keeper, investamt); revert(); } ERC20Interface.transferFrom(from_, address(this), investamt); emit TransferSuccessful(from_, address(this), investamt); if(nextPosition != 1){ //Transfer to referral ERC20Interface.transfer(userlistbyid[uplineId].OwnerAddress , referralamt); } //Maintainer payout MainterPayoutAmount = MainterPayoutAmount + maintaineramt; UnpaidUserCount++; return true; } function Payout3XReward(uint32 UserId) public{ require(!IsExpired, "Contract has expired."); require(msg.sender == userlistbyid[UserId].OwnerAddress, "Only owner of the investment can claim 3X payment"); if(checkPayoutTree(UserId)){ Payout(UserId); } } function checkPayoutTree(uint32 UserId) view public returns(bool){ if(userlistbyid[UserId].IsPayout){ return false; } int32[] memory list = new int32[](2); User memory user; if(userlistbyid[uint32(UserId)].LeftId != -1){ user = userlistbyid[uint32(userlistbyid[UserId].LeftId)]; if(user.LeftId != -1 && user.RightId != 1){ list[0] = user.LeftId; list[1] = user.RightId; for(uint i = 0; i < list.length; i++){ user = userlistbyid[uint32(list[i])]; if(user.LeftId == -1 || user.RightId == -1){ return false; } } } else{ return false; } } else{ return false; } if(userlistbyid[uint32(UserId)].RightId != -1){ user = userlistbyid[uint32(userlistbyid[uint32(UserId)].RightId)]; if(user.LeftId != -1 && user.RightId != 1){ list[0] = user.LeftId; list[1] = user.RightId; i = 0; for(i = 0; i < list.length; i++){ user = userlistbyid[uint32(list[i])]; if(user.LeftId == -1 || user.RightId == -1){ return false; } } return true; } else{ return false; } } else{ return false; } return false; } function Payout(uint32 UserId) internal{ require(userlistbyid[UserId].IsPayout == false, "User already received 3x payout"); if(userlistbyid[UserId].IsPayout == false){ userlistbyid[UserId].IsPayout = true; ERC20Interface.transfer(userlistbyid[UserId].OwnerAddress, investamt*3); UnpaidUserCount--; } } function PayoutMaintainer() public onlyOwner{ require(maintainer != 0x0, "No mainter account set for payout"); require(MainterPayoutAmount > 0, "Mainter payout balance is 0"); if(MainterPayoutAmount != 0){ address contract_ = token; ERC20Interface = IERC20(contract_); if(nextPosition != 1){ //Transfer to maintainer ERC20Interface.transfer(maintainer , MainterPayoutAmount); MainterPayoutAmount = 0; } } } function getUserByAddress(address userAddress) view public returns (int32[] useridlist){ return userids[userAddress]; } function getUserIds(address userAddress) view public returns (int32[]){ return userids[userAddress]; } // function GetTreeByUserId(uint32 UserId, bool report) view public returns (User[]){ // //Get Position // uint32 userposition = uint32(userlistbyid[uint32(UserId)].Position); // //Try to return all data base on position // uint userCount = 0; // if(report){ // userCount = uint((2 ** (uint(currentLevel) + 1)) - 1); // } // else{ // userCount = 15; // } // User[] memory userlist = new User[](userCount); // uint counter = 0; // uint32 availablenodes = 2; // int8 userlevel = 2; // userlist[counter] = userlistbyid[uint32(userlistbypos[userposition].Id)]; // counter++; // while(true){ // userposition = userposition * 2; // for(uint32 i = 0; i < availablenodes; i++){ // userlist[counter] = userlistbyid[uint32(userlistbypos[userposition + i].Id)]; // counter++; // } // availablenodes = availablenodes * 2; // userlevel++; // if(report == false){ // if(availablenodes > 8){ // break; // } // } // else{ // if(userlevel > currentLevel){ // break; // } // } // } // return userlist; // } // function GetUserById(uint32 userId) view public returns(User user){ // user = userlistbyid[userId]; // } function CheckInvestmentExpiry() public onlyOwner{ require(!isContractAlive(), "Contract is alive."); require(PayoutAmount == 0, "Contract balance is already calculated."); if(MainterPayoutAmount != 0){ PayoutMaintainer(); } //Current Date - last Investment Date >= 365 days from last investment date timestamp if(!isContractAlive()){ IsExpired = true; uint contractBalance = ERC20Interface.balanceOf(address(this)); PayoutAmount = uint(contractBalance / uint(UnpaidUserCount)); } } function RemainingInvestorPayout(uint quantity) public onlyOwner returns (bool){ require(IsExpired, "Contract Is Still Alive"); require(userCounter >= nextUnpaidUser, "All users are paid"); for(uint32 i = 0; i < quantity; i++){ if(userlistbyid[uint32(nextUnpaidUser)].IsPayout == false && userlistbyid[uint32(nextUnpaidUser)].IsEndGamePayout == false){ userlistbyid[uint32(nextUnpaidUser)].IsEndGamePayout = true; ERC20Interface.transfer(userlistbyid[uint32(nextUnpaidUser)].OwnerAddress, PayoutAmount); UnpaidUserCount--; } nextUnpaidUser += idcounter; if(nextUnpaidUser > userCounter){ return true; } } return true; } function GetContractBalance() view public returns(uint){ return ERC20Interface.balanceOf(address(this)) - MainterPayoutAmount; } function GetMaintainerAmount() view public returns(uint){ return MainterPayoutAmount; } function GetExpiryInvestmentTimestamp() view public returns(uint){ return ExpiryInvestmentTimestamp; } function GetIsExpired() view public returns (bool){ return IsExpired; } function GetUnpaidUserCount() view public returns (int){ return UnpaidUserCount; } function setMaintainer(address address_) public onlyOwner returns (bool) { require(address_ != 0x0); maintainer = address_; return true; } function setToken(address address_) public onlyOwner returns (bool) { require(address_ != 0x0); token = address_; return true; } function testSetExpiryTrue() public{ ExpiryInvestmentTimestamp = time_call() - 366 days; } function testSetExpiryFalse() public{ ExpiryInvestmentTimestamp = time_call(); IsExpired = false; PayoutAmount = 0; } function sosPayout() public onlyOwner{ ERC20Interface.transfer(msg.sender , GetContractBalance()); ERC20Interface.transfer(msg.sender , GetMaintainerAmount()); IsExpired = true; } }
0x6080604052600436106101d8576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063137e74a4146101dd57806313ea5d2914610208578063144fa6d7146102635780631a107286146102be5780631bbc4b83146102d55780631e6c57221461032c5780631f8ddaeb14610363578063278e72441461038e5780632e17ae4e146103b95780632e2d979b14610420578063395bf2a31461044b5780634c313fc21461046257806369c212f6146104fa578063715018a614610592578063866d4ea5146105a95780638778a41e146105d857806389e7959f146105ef5780638da5cb5b1461061a57806390f671e3146106715780639441492b1461068857806394e26427146106b35780639850d32b146106de57806398800644146107355780639dc4b9c914610780578063a475945f146107b1578063a8b33e99146107e0578063c1f093481461080b578063c2390b5914610822578063c99de57e1461084d578063cf303470146108e9578063d7ad830514610914578063daa2ceac14610947578063daab9f481461098c578063efc32b4a146109b7578063f0c37a5914610a0f578063f2fde38b14610a3a578063f6d0bf2f14610a7d578063fc0c546a14610aa8575b600080fd5b3480156101e957600080fd5b506101f2610aff565b6040518082815260200191505060405180910390f35b34801561021457600080fd5b50610249600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b34801561026f57600080fd5b506102a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b3480156102ca57600080fd5b506102d3610c9f565b005b3480156102e157600080fd5b506102ea610f27565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561033857600080fd5b50610341610f4d565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34801561036f57600080fd5b50610378610f63565b6040518082815260200191505060405180910390f35b34801561039a57600080fd5b506103a3610f69565b6040518082815260200191505060405180910390f35b3480156103c557600080fd5b50610404600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f6f565b604051808260030b60030b815260200191505060405180910390f35b34801561042c57600080fd5b50610435610fb4565b6040518082815260200191505060405180910390f35b34801561045757600080fd5b50610460610fbe565b005b34801561046e57600080fd5b506104a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff1565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156104e65780820151818401526020810190506104cb565b505050509050019250505060405180910390f35b34801561050657600080fd5b5061053b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110ae565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561057e578082015181840152602081019050610563565b505050509050019250505060405180910390f35b34801561059e57600080fd5b506105a761116b565b005b3480156105b557600080fd5b506105be61126d565b604051808215151515815260200191505060405180910390f35b3480156105e457600080fd5b506105ed611284565b005b3480156105fb57600080fd5b5061060461154e565b6040518082815260200191505060405180910390f35b34801561062657600080fd5b5061062f611558565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561067d57600080fd5b5061068661157e565b005b34801561069457600080fd5b5061069d611594565b6040518082815260200191505060405180910390f35b3480156106bf57600080fd5b506106c861159a565b6040518082815260200191505060405180910390f35b3480156106ea57600080fd5b506106f36115a0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561074157600080fd5b50610766600480360381019080803563ffffffff1690602001909291905050506115c6565b604051808215151515815260200191505060405180910390f35b34801561078c57600080fd5b506107956120d6565b604051808260000b60000b815260200191505060405180910390f35b3480156107bd57600080fd5b506107c66120e9565b604051808215151515815260200191505060405180910390f35b3480156107ec57600080fd5b506107f56120fc565b6040518082815260200191505060405180910390f35b34801561081757600080fd5b50610820612102565b005b34801561082e57600080fd5b50610837612476565b6040518082815260200191505060405180910390f35b34801561085957600080fd5b50610862612480565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018215151515815260200194505050505060405180910390f35b3480156108f557600080fd5b506108fe6124eb565b6040518082815260200191505060405180910390f35b34801561092057600080fd5b50610945600480360381019080803563ffffffff1690602001909291905050506124f1565b005b34801561095357600080fd5b506109726004803603810190808035906020019092919050505061269c565b604051808215151515815260200191505060405180910390f35b34801561099857600080fd5b506109a1612a63565b6040518082815260200191505060405180910390f35b3480156109c357600080fd5b506109f5600480360381019080803560000b9060200190929190803563ffffffff169060200190929190505050612a69565b604051808215151515815260200191505060405180910390f35b348015610a1b57600080fd5b50610a24613ce7565b6040518082815260200191505060405180910390f35b348015610a4657600080fd5b50610a7b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613ced565b005b348015610a8957600080fd5b50610a92613e42565b6040518082815260200191505060405180910390f35b348015610ab457600080fd5b50610abd613f45565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600d5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b6257600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610b8857600080fd5b81600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c2f57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610c5557600080fd5b81600760046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cfa57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33610d41613e42565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610dc657600080fd5b505af1158015610dda573d6000803e3d6000fd5b505050506040513d6020811015610df057600080fd5b810190808051906020019092919050505050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33610e49610fb4565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ece57600080fd5b505af1158015610ee2573d6000803e3d6000fd5b505050506040513d6020811015610ef857600080fd5b8101908080519060200190929190505050506001600c60006101000a81548160ff021916908315150217905550565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900463ffffffff1681565b600b5481565b60165481565b600360205281600052604060002081815481101515610f8a57fe5b9060005260206000209060089182820401919006600402915091509054906101000a900460030b81565b6000600e54905090565b610fc6613f6b565b600b819055506000600c60006101000a81548160ff0219169083151502179055506000600d81905550565b6060600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156110a257602002820191906000526020600020906000905b82829054906101000a900460030b60030b8152602001906004019060208260030104928301926001038202915080841161106b5790505b50505050509050919050565b6060600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561115f57602002820191906000526020600020906000905b82829054906101000a900460030b60030b815260200190600401906020826003010492830192600103820291508084116111285790505b50505050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111c657600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600c60009054906101000a900460ff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e157600080fd5b6112e9613f73565b15151561135e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f436f6e747261637420697320616c6976652e000000000000000000000000000081525060200191505060405180910390fd5b6000600d541415156113fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f436f6e74726163742062616c616e636520697320616c72656164792063616c6381526020017f756c617465642e0000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000600e5414151561141357611412612102565b5b61141b613f73565b151561154b576001600c60006101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156114f957600080fd5b505af115801561150d573d6000803e3d6000fd5b505050506040513d602081101561152357600080fd5b81019080805190602001909291905050509050600f548181151561154357fe5b04600d819055505b50565b6000600b54905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6301e2850061158b613f6b565b03600b81905550565b60175481565b60105481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060606115d2614f2f565b6000600260008663ffffffff1663ffffffff16815260200190815260200160002060010160149054906101000a900460ff161561161257600093506120ce565b60026040519080825280602002602001820160405280156116425781602001602082028038833980820191505090505b5092507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008763ffffffff1663ffffffff168152602001908152602001600020600001600a9054906101000a900460030b60030b141515611b815760026000600260008863ffffffff1663ffffffff168152602001908152602001600020600001600a9054906101000a900460030b63ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff161515151581526020016002820154815260200160038201548152505091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826080015160030b141580156118c4575060018260a0015160030b14155b15611b735781608001518360008151811015156118dd57fe5b9060200190602002019060030b908160030b815250508160a0015183600181518110151561190757fe5b9060200190602002019060030b908160030b81525050600090505b8251811015611b6e5760026000848381518110151561193d57fe5b9060200190602002015163ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff161515151581526020016002820154815260200160038201548152505091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826080015160030b1480611b5357507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260a0015160030b145b15611b6157600093506120ce565b8080600101915050611922565b611b7c565b600093506120ce565b611b8a565b600093506120ce565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008763ffffffff1663ffffffff168152602001908152602001600020600001600e9054906101000a900460030b60030b1415156120c95760026000600260008863ffffffff1663ffffffff168152602001908152602001600020600001600e9054906101000a900460030b63ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff161515151581526020016002820154815260200160038201548152505091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826080015160030b14158015611e09575060018260a0015160030b14155b156120c0578160800151836000815181101515611e2257fe5b9060200190602002019060030b908160030b815250508160a00151836001815181101515611e4c57fe5b9060200190602002019060030b908160030b8152505060009050600090505b82518110156120b757600260008483815181101515611e8657fe5b9060200190602002015163ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff161515151581526020016002820154815260200160038201548152505091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826080015160030b148061209c57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260a0015160030b145b156120aa57600093506120ce565b8080600101915050611e6b565b600193506120ce565b600093506120ce565b600093505b505050919050565b600460009054906101000a900460000b81565b600c60009054906101000a900460ff1681565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561215f57600080fd5b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515612236576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4e6f206d61696e746572206163636f756e742073657420666f72207061796f7581526020017f740000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000600e541115156122b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4d61696e746572207061796f75742062616c616e63652069732030000000000081525060200191505060405180910390fd5b6000600e5414151561247357600760049054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760009054906101000a900463ffffffff1663ffffffff1614151561247257601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561242d57600080fd5b505af1158015612441573d6000803e3d6000fd5b505050506040513d602081101561245757600080fd5b8101908080519060200190929190505050506000600e819055505b5b50565b6000600f54905090565b60128060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030160009054906101000a900460ff16905084565b60185481565b600c60009054906101000a900460ff16151515612576576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f436f6e74726163742068617320657870697265642e000000000000000000000081525060200191505060405180910390fd5b600260008263ffffffff1663ffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612681576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f4f6e6c79206f776e6572206f662074686520696e766573746d656e742063616e81526020017f20636c61696d203358207061796d656e7400000000000000000000000000000081525060400191505060405180910390fd5b61268a816115c6565b156126995761269881613fc1565b5b50565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156126fa57600080fd5b600c60009054906101000a900460ff16151561277e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f6e7472616374204973205374696c6c20416c69766500000000000000000081525060200191505060405180910390fd5b601054600554121515156127fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f416c6c207573657273206172652070616964000000000000000000000000000081525060200191505060405180910390fd5b600090505b828163ffffffff161015612a5857600015156002600060105463ffffffff1663ffffffff16815260200190815260200160002060010160149054906101000a900460ff1615151480156128875750600015156002600060105463ffffffff1663ffffffff16815260200190815260200160002060010160159054906101000a900460ff161515145b15612a245760016002600060105463ffffffff1663ffffffff16815260200190815260200160002060010160156101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6002600060105463ffffffff1663ffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156129d457600080fd5b505af11580156129e8573d6000803e3d6000fd5b505050506040513d60208110156129fe57600080fd5b810190808051906020019092919050505050600f60008154809291906001900391905055505b6006546010600082825401925050819055506005546010541315612a4b5760019150612a5d565b80806001019150506127ff565b600191505b50919050565b600f5481565b600080612a74614f2f565b6060612a7e614f2f565b6000806000808a60000b131515612afd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4d696e696d756d20496e766573746d656e74205175616e74697479204973203181525060200191505060405180910390fd5b612b0689614242565b1515612b7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f526566657272616c20496420446f6573204e6f7420457869737400000000000081525060200191505060405180910390fd5b612b82613f73565b1515612c1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f8152602001807f436f6e7472616374207465726d696e617465642e20496e766573746d656e742081526020017f7761732068656c7420666f72206d6f7265207468616e2033363520646179730081525060400191505060405180910390fd5b600096505b8960000b8760030b1215613cd657600c60009054906101000a900460ff16151515612cda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f8152602001807f436f6e7472616374207465726d696e617465642e20496e766573746d656e742081526020017f7761732068656c7420666f72206d6f7265207468616e2033363520646179730081525060400191505060405180910390fd5b612ce3896142c5565b1515612cee57600080fd5b6001604051908082528060200260200182016040528015612d1e5781602001602082028038833980820191505090505b5094506001856000815181101515612d3257fe5b9060200190602002019060030b908160030b815250506001600760009054906101000a900463ffffffff1663ffffffff161415613319576001866000019060030b908160030b815250506000866020019060000b908160000b815250506000866040019060000b908160000b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff866060019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff866080019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8660a0019060030b908160030b8152505060018660c0019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8660e0019060030b908160030b815250503386610100019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001866101200190151590811515815250506001866101400190151590811515815250506000866101600181815250506000866101800181815250508560026000600163ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908360030b63ffffffff16021790555060208201518160000160046101000a81548160ff021916908360000b60ff16021790555060408201518160000160056101000a81548160ff021916908360000b60ff16021790555060608201518160000160066101000a81548163ffffffff021916908360030b63ffffffff160217905550608082015181600001600a6101000a81548163ffffffff021916908360030b63ffffffff16021790555060a082015181600001600e6101000a81548163ffffffff021916908360030b63ffffffff16021790555060c08201518160000160126101000a81548163ffffffff021916908360030b63ffffffff16021790555060e08201518160000160166101000a81548163ffffffff021916908360030b63ffffffff1602179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160010160146101000a81548160ff0219169083151502179055506101408201518160010160156101000a81548160ff021916908315150217905550610160820151816002015561018082015181600301559050508560016000600163ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908360030b63ffffffff16021790555060208201518160000160046101000a81548160ff021916908360000b60ff16021790555060408201518160000160056101000a81548160ff021916908360000b60ff16021790555060608201518160000160066101000a81548163ffffffff021916908360030b63ffffffff160217905550608082015181600001600a6101000a81548163ffffffff021916908360030b63ffffffff16021790555060a082015181600001600e6101000a81548163ffffffff021916908360030b63ffffffff16021790555060c08201518160000160126101000a81548163ffffffff021916908360030b63ffffffff16021790555060e08201518160000160166101000a81548163ffffffff021916908360030b63ffffffff1602179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160010160146101000a81548160ff0219169083151502179055506101408201518160010160156101000a81548160ff021916908315150217905550610160820151816002015561018082015181600301559050506002600760006101000a81548163ffffffff021916908363ffffffff1602179055505b600654600560008282540192505081905550600260008a63ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff1615151515815260200160028201548152602001600382015481525050935060009250836020015160000b915060028260030b121561350b576135048961486d565b9250613517565b61351489614b25565b92505b600090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008563ffffffff1663ffffffff168152602001908152602001600020600001600a9054906101000a900460030b60030b1415156135c55760019050600554600260008563ffffffff1663ffffffff168152602001908152602001600020600001600e6101000a81548163ffffffff021916908360030b63ffffffff16021790555061360c565b600554600260008563ffffffff1663ffffffff168152602001908152602001600020600001600a6101000a81548163ffffffff021916908360030b63ffffffff1602179055505b600554866000019060030b908160030b815250506000866020019060000b908160000b815250506001600260008563ffffffff1663ffffffff16815260200190815260200160002060000160059054906101000a900460000b01866040019060000b908160000b8152505082866060019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff866080019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8660a0019060030b908160030b815250508060028060008663ffffffff1663ffffffff16815260200190815260200160002060000160129054906101000a900460030b0260030b018660c0019060030b908160030b815250503386610100019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050888660e0019060030b908160030b815250506000866101200190151590811515815250506000866101400190151590811515815250506137ac614f27565b866101600181815250506137be613f6b565b86610180018181525050600460009054906101000a900460000b60000b866040015160000b131561380c578560400151600460006101000a81548160ff021916908360000b60ff1602179055505b856002600060055463ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908360030b63ffffffff16021790555060208201518160000160046101000a81548160ff021916908360000b60ff16021790555060408201518160000160056101000a81548160ff021916908360000b60ff16021790555060608201518160000160066101000a81548163ffffffff021916908360030b63ffffffff160217905550608082015181600001600a6101000a81548163ffffffff021916908360030b63ffffffff16021790555060a082015181600001600e6101000a81548163ffffffff021916908360030b63ffffffff16021790555060c08201518160000160126101000a81548163ffffffff021916908360030b63ffffffff16021790555060e08201518160000160166101000a81548163ffffffff021916908360030b63ffffffff1602179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160010160146101000a81548160ff0219169083151502179055506101408201518160010160156101000a81548160ff0219169083151502179055506101608201518160020155610180820151816003015590505085600160008860c0015163ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908360030b63ffffffff16021790555060208201518160000160046101000a81548160ff021916908360000b60ff16021790555060408201518160000160056101000a81548160ff021916908360000b60ff16021790555060608201518160000160066101000a81548163ffffffff021916908360030b63ffffffff160217905550608082015181600001600a6101000a81548163ffffffff021916908360030b63ffffffff16021790555060a082015181600001600e6101000a81548163ffffffff021916908360030b63ffffffff16021790555060c08201518160000160126101000a81548163ffffffff021916908360030b63ffffffff16021790555060e08201518160000160166101000a81548163ffffffff021916908360030b63ffffffff1602179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160010160146101000a81548160ff0219169083151502179055506101408201518160010160156101000a81548160ff02191690831515021790555061016082015181600201556101808201518160030155905050600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208660000151908060018154018082558091505090600182039060005260206000209060089182820401919006600402909192909190916101000a81548163ffffffff021916908360030b63ffffffff160217905550506301e13380613cc2613f6b565b01600b819055508680600101975050612c21565b600197505050505050505092915050565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613d4857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613d8457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600e54601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015613f0457600080fd5b505af1158015613f18573d6000803e3d6000fd5b505050506040513d6020811015613f2e57600080fd5b810190808051906020019092919050505003905090565b600760049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600042905090565b60006001600760009054906101000a900463ffffffff1663ffffffff161415613f9f5760019050613fbe565b600b54613faa613f6b565b1015613fb95760019050613fbe565b600090505b90565b60001515600260008363ffffffff1663ffffffff16815260200190815260200160002060010160149054906101000a900460ff16151514151561406c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5573657220616c7265616479207265636569766564203378207061796f75740081525060200191505060405180910390fd5b60001515600260008363ffffffff1663ffffffff16815260200190815260200160002060010160149054906101000a900460ff161515141561423f576001600260008363ffffffff1663ffffffff16815260200190815260200160002060010160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260008463ffffffff1663ffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003601654026040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156141ef57600080fd5b505af1158015614203573d6000803e3d6000fd5b505050506040513d602081101561421957600080fd5b810190808051906020019092919050505050600f60008154809291906001900391905055505b50565b60006001600760009054906101000a900463ffffffff1663ffffffff16141561426e57600190506142c0565b60018263ffffffff16141561428657600090506142c0565b6000600260008463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b60030b141590505b919050565b600080600080600760049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561431157600080fd5b600760049054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915033905081601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e82306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561446b57600080fd5b505af115801561447f573d6000803e3d6000fd5b505050506040513d602081101561449557600080fd5b8101908080519060200190929190505050601654111561453d57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fbf182be802245e8ed88e4b8d3e4344c0863dd2a70334f089fd07265389306fcf6016546040518082815260200191505060405180910390a3600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd82306016546040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561463857600080fd5b505af115801561464c573d6000803e3d6000fd5b505050506040513d602081101561466257600080fd5b8101908080519060200190929190505050503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fd6d3eb25a413c05d8107fc49deb2789bef7f612582b2482804c0b0423b6638ee6016546040518082815260200191505060405180910390a36001600760009054906101000a900463ffffffff1663ffffffff1614151561484357601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260008763ffffffff1663ffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166017546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561480657600080fd5b505af115801561481a573d6000803e3d6000fd5b505050506040513d602081101561483057600080fd5b8101908080519060200190929190505050505b601854600e5401600e81905550600f60008154809291906001019190505550600192505050919050565b6000805b60011561491057600060016000600760009054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b60030b141515614906576007600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff1602179055505061490b565b614910565b614871565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905060006002600760009054906101000a900463ffffffff1663ffffffff1681151561495957fe5b0663ffffffff161415614992576002600760009054906101000a900463ffffffff1663ffffffff1681151561498a57fe5b0490506149bd565b60026001600760009054906101000a900463ffffffff160363ffffffff168115156149b957fe5b0490505b600160008263ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9150600260008463ffffffff1663ffffffff168152602001908152602001600020600001600481819054906101000a900460000b8092919060010191906101000a81548160ff021916908360000b60ff160217905550506007600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550505b600115614b1f57600060016000600760009054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b60030b141515614b15576007600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555050614b1a565b614b1f565b614a80565b50919050565b6000806000806000806000600260008963ffffffff1663ffffffff16815260200190815260200160002060000160046101000a81548160ff021916908360000b60ff160217905550600260008863ffffffff1663ffffffff16815260200190815260200160002060000160129054906101000a900460030b9450600260008863ffffffff1663ffffffff16815260200190815260200160002060000160129054906101000a900460030b93505b600115614f1c576002850294506001600285020193508463ffffffff16600760009054906101000a900463ffffffff1663ffffffff161015614ccb578492506001858503019150600090505b8163ffffffff168163ffffffff161015614cca5760006001600083860163ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b60030b1415614cbd5760016000600283860163ffffffff16811515614c8757fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614f1d565b8080600101915050614c1e565b5b600760009054906101000a900463ffffffff1663ffffffff168563ffffffff161415614d4f57600160006002600760009054906101000a900463ffffffff1663ffffffff16811515614d1957fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614f1d565b600760009054906101000a900463ffffffff1663ffffffff168463ffffffff161415614dd6576001600060026001600760009054906101000a900463ffffffff160363ffffffff16811515614da057fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614f1d565b8463ffffffff16600760009054906101000a900463ffffffff1663ffffffff16118015614e2057508363ffffffff16600760009054906101000a900463ffffffff1663ffffffff16105b15614f175760006002600760009054906101000a900463ffffffff1663ffffffff16811515614e4b57fe5b0663ffffffff161415614eb657600160006002600760009054906101000a900463ffffffff1663ffffffff16811515614e8057fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614f1d565b6001600060026001600760009054906101000a900463ffffffff160363ffffffff16811515614ee157fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614f1d565b614bd2565b5b5050505050919050565b600043905090565b6101a060405190810160405280600060030b81526020016000800b81526020016000800b8152602001600060030b8152602001600060030b8152602001600060030b8152602001600060030b8152602001600060030b8152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600015158152602001600081526020016000815250905600a165627a7a7230582029109853ae0f8ded1a656b47dd52ee28aaef68151c77a5640a45805231d53dfe0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
2,152
0xdf3a4e5202e81629edf89f34ffcb4caff61db288
pragma solidity ^0.4.21 ; contract DUBAI_Portfolio_II_883 { mapping (address => uint256) public balanceOf; string public name = " DUBAI_Portfolio_II_883 " ; string public symbol = " DUBAI883II " ; uint8 public decimals = 18 ; uint256 public totalSupply = 747599432793525000000000000 ; 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's balance balanceOf[to] += value; // add to recipient's balance emit Transfer(msg.sender, to, value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => mapping(address => uint256)) public allowance; function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } // } // Programme d'émission - Lignes 1 à 10 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < DUBAI_Portfolio_II_metadata_line_1_____Agility_Public_Warehousing_Company_KSC_20250515 > // < FtsPpN1DwzTzWX6jdVT5rKcXhr5t3bs074M1O08Kaw26qrnmIkBPlE9Q4xY7AXt3 > // < u =="0.000000000000000001" : ] 000000000000000.000000000000000000 ; 000000019145135.531349000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000000000001D3692 > // < DUBAI_Portfolio_II_metadata_line_2_____Air_Arabia_20250515 > // < I19Ah2z3zex7CQ01Vm9QRjN1npMyHj4A6pj5J2as1qM7CuWp8iknM7Fexh0Pl8E4 > // < u =="0.000000000000000001" : ] 000000019145135.531349000000000000 ; 000000040724763.106576000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000001D36923E241C > // < DUBAI_Portfolio_II_metadata_line_3_____ARAMEX_20250515 > // < U2D06H7k9dA7485J46HU81rtmueV0iJWW5uSJ3h6G7uVETD2nCP4v4P3HuKAJH06 > // < u =="0.000000000000000001" : ] 000000040724763.106576000000000000 ; 000000056380860.880529300000000000 ] > // < 0x00000000000000000000000000000000000000000000000000003E241C5607C6 > // < DUBAI_Portfolio_II_metadata_line_4_____Gulf_Navigation_Holding_20250515 > // < lO17Pwvt3bgEbWRbNIUCUw0va5H15O5bXI4whk85T16i2k9TanP55aL2O4mO2U1I > // < u =="0.000000000000000001" : ] 000000056380860.880529300000000000 ; 000000076374791.225424100000000000 ] > // < 0x00000000000000000000000000000000000000000000000000005607C67489E7 > // < DUBAI_Portfolio_II_metadata_line_5_____National_Cement_Company_20250515 > // < WI9P5oFf0T1rTgVZniWEU47KvKd7OhB5788L4lGOOsML2ZDR10mtj514Rc2U9S2v > // < u =="0.000000000000000001" : ] 000000076374791.225424100000000000 ; 000000096299561.904439500000000000 ] > // < 0x00000000000000000000000000000000000000000000000000007489E792F104 > // < DUBAI_Portfolio_II_metadata_line_6_____National_Industries_Group_Holding_SAK_20250515 > // < YcBnj20m8674wfi6Wk6x2SxOF63QU2G99p3r7qMHGFBaJpPLCowM9IKmS0jn14N7 > // < u =="0.000000000000000001" : ] 000000096299561.904439500000000000 ; 000000113032053.304132000000000000 ] > // < 0x000000000000000000000000000000000000000000000000000092F104AC7925 > // < DUBAI_Portfolio_II_metadata_line_7_____Dubai_Refreshments_Company_20250515 > // < lYy8rduj7at3nzw65HRosBbrHIF1pbTQWzzBKa0tLs8yTz6O490ri9rW9R1ZR1Fq > // < u =="0.000000000000000001" : ] 000000113032053.304132000000000000 ; 000000133572118.908301000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000000AC7925CBD09C > // < DUBAI_Portfolio_II_metadata_line_8_____Emirates_Refreshments_Company_20250515 > // < 8Jcp52QycTf9MZ42lEYevTR6NsBEUux50jdtJ7fryLP6pL0Jh0bP9qKE5ds3Ms6O > // < u =="0.000000000000000001" : ] 000000133572118.908301000000000000 ; 000000150667214.297915000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000000CBD09CE5E661 > // < DUBAI_Portfolio_II_metadata_line_9_____Gulfa_Mineral_Water_Processing_Industries_20250515 > // < vx4Y811TAZv8I8A2B83BPdGeN8RBcEH9R80TUXkmrBP8TGI4H70tkwYD44FsHF1p > // < u =="0.000000000000000001" : ] 000000150667214.297915000000000000 ; 000000171117833.275274000000000000 ] > // < 0x000000000000000000000000000000000000000000000000000E5E6611051AE7 > // < DUBAI_Portfolio_II_metadata_line_10_____MARKA_20250515 > // < YT5tum3HkX8Kccv3i3R6GQFv2TRLgKXyLHgvCvt6IuWeXk8c1u84vXu8lRDFD3Nt > // < u =="0.000000000000000001" : ] 000000171117833.275274000000000000 ; 000000191766384.378673000000000000 ] > // < 0x000000000000000000000000000000000000000000000000001051AE71249CBE > // Programme d'émission - Lignes 11 à 20 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < DUBAI_Portfolio_II_metadata_line_11_____United_Foods_Company_20250515 > // < L8g74b2643T4xxyBrVP0T2bG1g44NtxY5Cr15c1Crnb7wPn8ufYq158Z383xDU9F > // < u =="0.000000000000000001" : ] 000000191766384.378673000000000000 ; 000000207291319.040710000000000000 ] > // < 0x000000000000000000000000000000000000000000000000001249CBE13C4D2C > // < DUBAI_Portfolio_II_metadata_line_12_____UNITED_KAIPARA_DAIRIES_CO_20250515 > // < L92H1Y6ZjeQQ8z7yi3uj9u9M7wEJs2Dt97nx2u570Vl45vpZ858uM0UQ57sHZ25f > // < u =="0.000000000000000001" : ] 000000207291319.040710000000000000 ; 000000227898244.886770000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000013C4D2C15BBEC0 > // < DUBAI_Portfolio_II_metadata_line_13_____Emirate_Integrated_Telecommunications_Company_20250515 > // < 1T21q3dH170eJXIP4eCp5R38y2QkT688scs5F38lT7O5X2ks5q8iLOfAPT5YPqDj > // < u =="0.000000000000000001" : ] 000000227898244.886770000000000000 ; 000000247483557.174604000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000015BBEC0179A144 > // < DUBAI_Portfolio_II_metadata_line_14_____Hits_Telecom_Holding__20250515 > // < Eqk4m96xZ5zBCldunilh9N9x98iex6Q48uJkzUYtA95a16W7R10nkMZ3g72Q8U0X > // < u =="0.000000000000000001" : ] 000000247483557.174604000000000000 ; 000000264803026.135155000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000179A1441940EAF > // < DUBAI_Portfolio_II_metadata_line_15_____Al_Firdous_Holdings_20250515 > // < J35Y1EJzaUGXK032IRhaWbw92k9j02pD3s9dAP2M103YvNmSoX88554kHyOE2vOw > // < u =="0.000000000000000001" : ] 000000264803026.135155000000000000 ; 000000282443783.191644000000000000 ] > // < 0x000000000000000000000000000000000000000000000000001940EAF1AEF99A > // < DUBAI_Portfolio_II_metadata_line_16_____National_Central_Cooling_Co_20250515 > // < 6u00YhEOpbyW99v07L43dc77M3E3fceQyNPM186H7D8wG30Fc0J7Ujbtd0WZt73n > // < u =="0.000000000000000001" : ] 000000282443783.191644000000000000 ; 000000299959351.106340000000000000 ] > // < 0x000000000000000000000000000000000000000000000000001AEF99A1C9B39F > // < DUBAI_Portfolio_II_metadata_line_17_____AJMAN_BANK_PJSC_obs_20250515 > // < Stx2017Oy0UT5T4Gd9655L0Zh8757aYhvsRcQ6YQr9D2Ube9umSwa3azR66jn670 > // < u =="0.000000000000000001" : ] 000000299959351.106340000000000000 ; 000000320671487.173123000000000000 ] > // < 0x000000000000000000000000000000000000000000000000001C9B39F1E94E4D > // < DUBAI_Portfolio_II_metadata_line_18_____Amlak_Finance_PJSC_obs_20250515 > // < TXIdtqNeEs0yq52D4s10z5D2zKhbjtEmm2B2p4574RK21WMeLm3Z0Y43tHWLyBd4 > // < u =="0.000000000000000001" : ] 000000320671487.173123000000000000 ; 000000342520645.295861000000000000 ] > // < 0x000000000000000000000000000000000000000000000000001E94E4D20AA521 > // < DUBAI_Portfolio_II_metadata_line_19_____Commercial_Bank_of_Dubai_PSC_obs_20250515 > // < 9gE0A0XwGr3I513nt0nq777qcoQ6S2SphF91G7H035eH68dTo2FEOWWZdzOUga1m > // < u =="0.000000000000000001" : ] 000000342520645.295861000000000000 ; 000000362082770.472910000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000020AA5212287E95 > // < DUBAI_Portfolio_II_metadata_line_20_____Dubai_Islamic_Bank_obs_20250515 > // < 7k4K18oEOz56VHl85pv1e3Ujz30tgbibl3KtxTRg2Al2D1957sAU9ekZg0k7SmUk > // < u =="0.000000000000000001" : ] 000000362082770.472910000000000000 ; 000000379710397.142206000000000000 ] > // < 0x000000000000000000000000000000000000000000000000002287E952436460 > // Programme d'émission - Lignes 21 à 30 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < DUBAI_Portfolio_II_metadata_line_21_____Emirates_Islamic_Bank_PJSC_obs_20250515 > // < 1HJ9g1F0op3Zh3D0o1fz65vrr8I0KtS5o6kgPCOJ7qgrCrs9M0JW8v6p0ippEAS7 > // < u =="0.000000000000000001" : ] 000000379710397.142206000000000000 ; 000000396991594.335108000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000243646025DC2D7 > // < DUBAI_Portfolio_II_metadata_line_22_____Emirates_Investment_Bank_PJSC_obs_20250515 > // < ADt9cblsQI6jgFQlPJBC2waiipW1Yz825Z9rR521T2hPyZ9e3nj0NrUh9Rv66i18 > // < u =="0.000000000000000001" : ] 000000396991594.335108000000000000 ; 000000412638352.538844000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000025DC2D7275A2DB > // < DUBAI_Portfolio_II_metadata_line_23_____Emirates_NBD_PJSC_obs_20250515 > // < 2SwqRrL6knAAHqQJhgn4VUR564Sz3z4ysdNW4926oNvVp3mzXrqko7oI1DdgayTa > // < u =="0.000000000000000001" : ] 000000412638352.538844000000000000 ; 000000434601363.620330000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000275A2DB2972628 > // < DUBAI_Portfolio_II_metadata_line_24_____GFH_Financial_Group_BSC_obs_20250515 > // < u36c9M1h0G312S6l5g134T7f8k1GeN3dLaTr3hvvm3rG2N5kMPh1J0CJstJ4307D > // < u =="0.000000000000000001" : ] 000000434601363.620330000000000000 ; 000000450996283.414670000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000029726282B02A6C > // < DUBAI_Portfolio_II_metadata_line_25_____Mashreqbank_PSc_obs_20250515 > // < RnXh1DOMC8mlmQ7H6qa76t5InL2DMwrI3co7U35QQe6V0254uQ6X5z9j6r85tryJ > // < u =="0.000000000000000001" : ] 000000450996283.414670000000000000 ; 000000467108232.387072000000000000 ] > // < 0x000000000000000000000000000000000000000000000000002B02A6C2C8C027 > // < DUBAI_Portfolio_II_metadata_line_26_____Al_Salam_Bank _Bahrain_obs_20250515 > // < 4N7y9Wa803sMkKe4s7VcEu5LuShls43KbDIW4o2XLZ5YLv3841X1v0r55i8rOskJ > // < u =="0.000000000000000001" : ] 000000467108232.387072000000000000 ; 000000488282242.001695000000000000 ] > // < 0x000000000000000000000000000000000000000000000000002C8C0272E90F40 > // < DUBAI_Portfolio_II_metadata_line_27_____Khaleeji_Commercial_Bank_BSC_obs_20250515 > // < R7ib5993bL7hWKvu75sT3XgHz6MgQK6eIpvqFToS5895o82vWig530538TO12ybZ > // < u =="0.000000000000000001" : ] 000000488282242.001695000000000000 ; 000000504843785.451178000000000000 ] > // < 0x000000000000000000000000000000000000000000000000002E90F40302549B > // < DUBAI_Portfolio_II_metadata_line_28_____Ithmaar_Holding_BSC_obs_20250515 > // < 8W2l7800ejuI7jXr46m3vItm3VDtOniPMY5wLd77Lob6GiRc7X5M32Q7134X4gBs > // < u =="0.000000000000000001" : ] 000000504843785.451178000000000000 ; 000000522263575.187808000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000302549B31CE936 > // < DUBAI_Portfolio_II_metadata_line_29_____Alliance_Insurance_obs_20250515 > // < yN3f98IS95cGvoFX1i0iPn49cl8O0c99PB2H4CN18wd868CZ4C5vAv2rQ63UReqc > // < u =="0.000000000000000001" : ] 000000522263575.187808000000000000 ; 000000542133848.793775000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000031CE93633B3B09 > // < DUBAI_Portfolio_II_metadata_line_30_____Dubai_Islamic_Insurance_and_Reinsurance_Co_obs_20250515 > // < 6257B3dINWf071Qyyg9k23305k3d3532N183ulssImAIMGR4iOJrDK24eUzxe49P > // < u =="0.000000000000000001" : ] 000000542133848.793775000000000000 ; 000000559687250.731489000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000033B3B0935603D5 > // Programme d'émission - Lignes 31 à 40 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < DUBAI_Portfolio_II_metadata_line_31_____Arab_Insurance_Group_BSC_obs_20250515 > // < 33Nj94ob0pVg7bmG2GV91Th1eGWtFuZfqOgNhAd22K8a9xyMBQ3DzV9bFc9hgmkd > // < u =="0.000000000000000001" : ] 000000559687250.731489000000000000 ; 000000580070881.273668000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000035603D53751E30 > // < DUBAI_Portfolio_II_metadata_line_32_____Arabian_Scandinavian_Insurance_Takaful_obs_20250515 > // < 6AY9YGzLbQE5M0rqigsSB8ZU2Gh841cPnKA5xD8205Ff8RGuk036JPgJpm1E4orU > // < u =="0.000000000000000001" : ] 000000580070881.273668000000000000 ; 000000599563514.297923000000000000 ] > // < 0x000000000000000000000000000000000000000000000000003751E30392DC7F > // < DUBAI_Portfolio_II_metadata_line_33_____Al_Sagr_National_Insurance_Company_obs_20250515 > // < kNh0lwz6O7l3In2C216hNVv1fn0g4Pu14jntb5aSA97w3knOWz2yL8WnpKtwh91H > // < u =="0.000000000000000001" : ] 000000599563514.297923000000000000 ; 000000618827113.692892000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000392DC7F3B04157 > // < DUBAI_Portfolio_II_metadata_line_34_____Dar_Al_Takaful_obs_20250515 > // < 285OI2e3931C6qaH4fO2Aj385cjco1nk1G6l2bpY331V7svcmSS0dL0wXGbOs1Vq > // < u =="0.000000000000000001" : ] 000000618827113.692892000000000000 ; 000000638190967.090498000000000000 ] > // < 0x000000000000000000000000000000000000000000000000003B041573CDCD59 > // < DUBAI_Portfolio_II_metadata_line_35_____Dubai_Insurance_Co_PSC_obs_20250515 > // < 69s5fv1m3VeQa9i1YfymO6MHQ084HHdtxD42aVyZ7j5kxVf8lTjr59GEOhe16NEF > // < u =="0.000000000000000001" : ] 000000638190967.090498000000000000 ; 000000659975286.393057000000000000 ] > // < 0x000000000000000000000000000000000000000000000000003CDCD593EF0AD9 > // < DUBAI_Portfolio_II_metadata_line_36_____Dubai_National_Insurance_a_Reinsurance_obs_20250515 > // < cW39IgEcc7fb0Y454QIUzArV65p2INqgRgS9vMVca85F61tbL395eaKrjN0E54l5 > // < u =="0.000000000000000001" : ] 000000659975286.393057000000000000 ; 000000676811673.556890000000000000 ] > // < 0x000000000000000000000000000000000000000000000000003EF0AD9408BB8F > // < DUBAI_Portfolio_II_metadata_line_37_____National_General_Insurance_Company_PSC_obs_20250515 > // < mwuRsPb2gxfFa8V4b6rJn08751chu1H8JPIDgH7R1AFAC17771NeOl3xrB0VzZ33 > // < u =="0.000000000000000001" : ] 000000676811673.556890000000000000 ; 000000695078961.416265000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000408BB8F4249B38 > // < DUBAI_Portfolio_II_metadata_line_38_____Oman_Insurance_Company_PSC_obs_20250515 > // < 1X9OjT8Wef5gMUY8Z4HMA3tO8m68095yl85682R0eBm8VqNOo2Dc4bAM1qah2tyE > // < u =="0.000000000000000001" : ] 000000695078961.416265000000000000 ; 000000715643774.227475000000000000 ] > // < 0x000000000000000000000000000000000000000000000000004249B38443FC59 > // < DUBAI_Portfolio_II_metadata_line_39_____Islamic_Arab_Insurance_Company_obs_20250515 > // < OOzmp281ih35FC240p2RJf8GHyX5nmqNUFunDRtwtgV3067WP4LV8v8ooxKZu1J4 > // < u =="0.000000000000000001" : ] 000000715643774.227475000000000000 ; 000000732108212.494711000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000443FC5945D1BC5 > // < DUBAI_Portfolio_II_metadata_line_40_____Takaful_Emarat_PSC_obs_20250515 > // < KBp4457B0z1UtcclVEvu3n3ucT9VGmeDD07KD8C84G6Ftwyzi87kN42u4jFQtrE5 > // < u =="0.000000000000000001" : ] 000000732108212.494711000000000000 ; 000000747599432.793525000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000045D1BC5474BF07 > }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820f48de6e9c0ce79d15fba1d70cbb01a586b37e071794bfdb439c1f5f4ebeeda680029
{"success": true, "error": null, "results": {}}
2,153
0x4485561db76614ff727f8e0a3ea95690b8b16022
pragma solidity 0.4.24; interface ERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function transfer(address _to, uint256 _value) external returns (bool); function approve(address _spender, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); } /** * @title ERC223Basic additions to ERC20Basic * @dev see also: https://github.com/ethereum/EIPs/issues/223 * */ contract ERC223 is ERC20 { event Transfer(address indexed _from, address indexed _to, uint256 _value, bytes indexed _data); function transfer(address _to, uint256 _value, bytes _data) public returns (bool success); function contractFallback(address _to, uint _value, bytes _data) internal returns (bool success); function isContract(address _addr) internal view returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private owner_; event 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; } /** * @return the address of the owner. */ function owner() public view returns(address) { return owner_; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner_, "Only the owner can call this function."); _; } /** * @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), "Cannot transfer ownership to zero address."); 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) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } 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 Generic223Receiver { uint public sentValue; address public tokenAddr; address public tokenSender; bool public calledFoo; bytes public tokenData; bytes4 public tokenSig; Tkn private tkn; bool private __isTokenFallback; struct Tkn { address addr; address sender; uint256 value; bytes data; bytes4 sig; } modifier tokenPayable { assert(__isTokenFallback); _; } function tokenFallback(address _sender, uint _value, bytes _data) public returns (bool success) { tkn = Tkn(msg.sender, _sender, _value, _data, getSig(_data)); __isTokenFallback = true; address(this).delegatecall(_data); __isTokenFallback = false; return true; } function foo() public tokenPayable { saveTokenValues(); calledFoo = true; } function getSig(bytes _data) private pure returns (bytes4 sig) { uint lngth = _data.length < 4 ? _data.length : 4; for (uint i = 0; i < lngth; i++) { sig = bytes4(uint(sig) + uint(_data[i]) * (2 ** (8 * (lngth - 1 - i)))); } } function saveTokenValues() private { tokenAddr = tkn.addr; tokenSender = tkn.sender; sentValue = tkn.value; tokenSig = tkn.sig; tokenData = tkn.data; } } contract InvoxFinanceToken is ERC223, Ownable { using SafeMath for uint256; string private name_ = "Invox Finance Token"; string private symbol_ = "INVOX"; uint256 private decimals_ = 18; uint256 public totalSupply = 464000000 * (10 ** decimals_); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); mapping (address => uint256) internal balances_; mapping (address => mapping (address => uint256)) private allowed_; constructor() public { balances_[msg.sender] = balances_[msg.sender].add(totalSupply); emit Transfer(address(0), msg.sender, totalSupply); } function() public payable { revert("Cannot send ETH to this address."); } function name() public view returns(string) { return name_; } function symbol() public view returns(string) { return symbol_; } function decimals() public view returns(uint256) { return decimals_; } function totalSupply() public view returns (uint256) { return totalSupply; } function safeTransfer(address _to, uint256 _value) public { require(transfer(_to, _value), "Transfer failed."); } function safeTransferFrom(address _from, address _to, uint256 _value) public { require(transferFrom(_from, _to, _value), "Transfer failed."); } function safeApprove( address _spender, uint256 _currentValue, uint256 _value ) public { require(allowed_[msg.sender][_spender] == _currentValue, "Current allowance value does not match."); approve(_spender, _value); } // ERC20 function balanceOf(address _owner) public view returns (uint256) { return balances_[_owner]; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed_[_owner][_spender]; } function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances_[msg.sender], "Value exceeds balance of msg.sender."); require(_to != address(0), "Cannot send tokens to zero address."); balances_[msg.sender] = balances_[msg.sender].sub(_value); balances_[_to] = balances_[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool) { allowed_[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_value <= balances_[_from], "Value exceeds balance of msg.sender."); require(_value <= allowed_[_from][msg.sender], "Value exceeds allowance of msg.sender for this owner."); require(_to != address(0), "Cannot send tokens to zero address."); balances_[_from] = balances_[_from].sub(_value); balances_[_to] = balances_[_to].add(_value); allowed_[_from][msg.sender] = allowed_[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function 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; } 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; } // ERC223 function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_to != address(0), "Cannot transfer token to zero address."); require(_value <= balanceOf(msg.sender), "Value exceeds balance of msg.sender."); transfer(_to, _value); if (isContract(_to)) { return contractFallback(_to, _value, _data); } return true; } function contractFallback(address _to, uint _value, bytes _data) internal returns (bool success) { Generic223Receiver receiver = Generic223Receiver(_to); return receiver.tokenFallback(msg.sender, _value, _data); } // Assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) internal view returns (bool) { // retrieve the size of the code on target address, this needs assembly uint length; assembly { length := extcodesize(_addr) } return length > 0; } }
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461014b578063095ea7b3146101d557806318160ddd1461020d57806323b872dd14610234578063313ce5671461025e578063423f6cef1461027357806342842e0e1461029957806366188463146102c357806370a08231146102e7578063715018a6146103085780638da5cb5b1461031d57806395d89b411461034e578063a9059cbb14610363578063be45fd6214610387578063d73dd623146103f0578063dd62ed3e14610414578063f2fde38b1461043b578063f65036621461045c575b6040805160e560020a62461bcd02815260206004820181905260248201527f43616e6e6f742073656e642045544820746f207468697320616464726573732e604482015290519081900360640190fd5b34801561015757600080fd5b50610160610483565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019a578181015183820152602001610182565b50505050905090810190601f1680156101c75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e157600080fd5b506101f9600160a060020a0360043516602435610518565b604080519115158252519081900360200190f35b34801561021957600080fd5b5061022261057e565b60408051918252519081900360200190f35b34801561024057600080fd5b506101f9600160a060020a0360043581169060243516604435610584565b34801561026a57600080fd5b5061022261084e565b34801561027f57600080fd5b50610297600160a060020a0360043516602435610854565b005b3480156102a557600080fd5b50610297600160a060020a03600435811690602435166044356108b8565b3480156102cf57600080fd5b506101f9600160a060020a036004351660243561091e565b3480156102f357600080fd5b50610222600160a060020a0360043516610a0d565b34801561031457600080fd5b50610297610a28565b34801561032957600080fd5b50610332610b05565b60408051600160a060020a039092168252519081900360200190f35b34801561035a57600080fd5b50610160610b14565b34801561036f57600080fd5b506101f9600160a060020a0360043516602435610b72565b34801561039357600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101f9948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610d349650505050505050565b3480156103fc57600080fd5b506101f9600160a060020a0360043516602435610e76565b34801561042057600080fd5b50610222600160a060020a0360043581169060243516610f0f565b34801561044757600080fd5b50610297600160a060020a0360043516610f3a565b34801561046857600080fd5b50610297600160a060020a0360043516602435604435610fce565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526060939092909183018282801561050e5780601f106104e35761010080835404028352916020019161050e565b820191906000526020600020905b8154815290600101906020018083116104f157829003601f168201915b5050505050905090565b336000818152600660209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60045490565b600160a060020a038316600090815260056020526040812054821115610619576040805160e560020a62461bcd028152602060048201526024808201527f56616c756520657863656564732062616c616e6365206f66206d73672e73656e60448201527f6465722e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03841660009081526006602090815260408083203384529091529020548211156106ba576040805160e560020a62461bcd02815260206004820152603560248201527f56616c7565206578636565647320616c6c6f77616e6365206f66206d73672e7360448201527f656e64657220666f722074686973206f776e65722e0000000000000000000000606482015290519081900360840190fd5b600160a060020a0383161515610740576040805160e560020a62461bcd02815260206004820152602360248201527f43616e6e6f742073656e6420746f6b656e7320746f207a65726f20616464726560448201527f73732e0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038416600090815260056020526040902054610769908363ffffffff61107e16565b600160a060020a03808616600090815260056020526040808220939093559085168152205461079e908363ffffffff61109016565b600160a060020a0380851660009081526005602090815260408083209490945591871681526006825282812033825290915220546107e2908363ffffffff61107e16565b600160a060020a03808616600081815260066020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060015b9392505050565b60035490565b61085e8282610b72565b15156108b4576040805160e560020a62461bcd02815260206004820152601060248201527f5472616e73666572206661696c65642e00000000000000000000000000000000604482015290519081900360640190fd5b5050565b6108c3838383610584565b1515610919576040805160e560020a62461bcd02815260206004820152601060248201527f5472616e73666572206661696c65642e00000000000000000000000000000000604482015290519081900360640190fd5b505050565b336000908152600660209081526040808320600160a060020a038616845290915281205480831061097257336000908152600660209081526040808320600160a060020a03881684529091528120556109a7565b610982818463ffffffff61107e16565b336000908152600660209081526040808320600160a060020a03891684529091529020555b336000818152600660209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526005602052604090205490565b600054600160a060020a03163314610ab0576040805160e560020a62461bcd02815260206004820152602660248201527f4f6e6c7920746865206f776e65722063616e2063616c6c20746869732066756e60448201527f6374696f6e2e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031690565b60028054604080516020601f600019610100600187161502019094168590049384018190048102820181019092528281526060939092909183018282801561050e5780601f106104e35761010080835404028352916020019161050e565b33600090815260056020526040812054821115610bfe576040805160e560020a62461bcd028152602060048201526024808201527f56616c756520657863656564732062616c616e6365206f66206d73672e73656e60448201527f6465722e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0383161515610c84576040805160e560020a62461bcd02815260206004820152602360248201527f43616e6e6f742073656e6420746f6b656e7320746f207a65726f20616464726560448201527f73732e0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b33600090815260056020526040902054610ca4908363ffffffff61107e16565b3360009081526005602052604080822092909255600160a060020a03851681522054610cd6908363ffffffff61109016565b600160a060020a0384166000818152600560209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6000600160a060020a0384161515610dbc576040805160e560020a62461bcd02815260206004820152602660248201527f43616e6e6f74207472616e7366657220746f6b656e20746f207a65726f20616460448201527f64726573732e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610dc533610a0d565b831115610e41576040805160e560020a62461bcd028152602060048201526024808201527f56616c756520657863656564732062616c616e6365206f66206d73672e73656e60448201527f6465722e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610e4b8484610b72565b50610e55846110a3565b15610e6c57610e658484846110ab565b9050610847565b5060019392505050565b336000908152600660209081526040808320600160a060020a0386168452909152812054610eaa908363ffffffff61109016565b336000818152600660209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b600054600160a060020a03163314610fc2576040805160e560020a62461bcd02815260206004820152602660248201527f4f6e6c7920746865206f776e65722063616e2063616c6c20746869732066756e60448201527f6374696f6e2e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610fcb816111ba565b50565b336000908152600660209081526040808320600160a060020a0387168452909152902054821461106e576040805160e560020a62461bcd02815260206004820152602760248201527f43757272656e7420616c6c6f77616e63652076616c756520646f6573206e6f7460448201527f206d617463682e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6110788382610518565b50505050565b60008282111561108a57fe5b50900390565b8181018281101561109d57fe5b92915050565b6000903b1190565b6040517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018590526060604484019081528451606485015284516000948894600160a060020a0386169463c0ee0b8a9491938a938a939160849091019060208501908083838e5b8381101561113757818101518382015260200161111f565b50505050905090810190601f1680156111645780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b15801561118557600080fd5b505af1158015611199573d6000803e3d6000fd5b505050506040513d60208110156111af57600080fd5b505195945050505050565b600160a060020a0381161515611240576040805160e560020a62461bcd02815260206004820152602a60248201527f43616e6e6f74207472616e73666572206f776e65727368697020746f207a657260448201527f6f20616464726573732e00000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582073a35a85361d3cc835e10569015e470b35e297b4ac206511c8441320de39007e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium"}, {"check": "erc721-interface", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,154
0x0c32de51ec9823b4b917975217336cee6fffe972
/** *Submitted for verification at Etherscan.io on 2021-10-15 */ pragma solidity ^0.5.12; /** * @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); } /** * @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; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @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) { // 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); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @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]. * * _Available since v2.4.0._ */ 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"); } } /** * @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)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length 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)); } /** * @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 Dead { using SafeERC20 for IERC20; address public dead = address(0); address public owner; IERC20 public dpr; constructor(address _dpr) public{ dpr = IERC20(_dpr); owner = msg.sender; } modifier onlyOwner(){ require(msg.sender == owner, "Not Owner"); _; } function to_dead(uint256 _amount) external onlyOwner{ dpr.safeTransfer(owner, _amount); } function withdraw(uint256 _amount) external onlyOwner { dpr.safeTransfer(owner, _amount); } function transferOwnership(address _newOwner) external onlyOwner{ owner = _newOwner; } }
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80632e1a7d4d1461006757806336cf7c87146100865780638da5cb5b146100aa57806392cd1c8514610067578063f2fde38b146100b2578063f63013aa146100d8575b600080fd5b6100846004803603602081101561007d57600080fd5b50356100e0565b005b61008e610151565b604080516001600160a01b039092168252519081900360200190f35b61008e610160565b610084600480360360208110156100c857600080fd5b50356001600160a01b031661016f565b61008e6101dc565b6001546001600160a01b0316331461012b576040805162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b604482015290519081900360640190fd5b60015460025461014e916001600160a01b0391821691168363ffffffff6101eb16565b50565b6000546001600160a01b031681565b6001546001600160a01b031681565b6001546001600160a01b031633146101ba576040805162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261023d908490610242565b505050565b610254826001600160a01b0316610400565b6102a5576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106102e35780518252601f1990920191602091820191016102c4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610345576040519150601f19603f3d011682016040523d82523d6000602084013e61034a565b606091505b5091509150816103a1576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156103fa578080602001905160208110156103bd57600080fd5b50516103fa5760405162461bcd60e51b815260040180806020018281038252602a81526020018061043d602a913960400191505060405180910390fd5b50505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061043457508115155b94935050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a723158201d0211391198d80cfd6d696068d974ad7217bb316868fb61bcff2921a5c788ec64736f6c63430005110032
{"success": true, "error": null, "results": {}}
2,155
0x6737fe98389ffb356f64ebb726aa1a92390d94fb
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * 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: openzeppelin-solidity/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) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } 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: openzeppelin-solidity/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) 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]; } } // File: openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } // File: openzeppelin-solidity/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: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @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, 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&#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, 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; } } // File: openzeppelin-solidity/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. */ 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; } } // File: openzeppelin-solidity/contracts/ownership/Claimable.sol /** * @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) public onlyOwner { pendingOwner = newOwner; } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() public onlyPendingOwner { emit OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } // File: contracts/ZeroCarbon.sol /** * @title ZeroCarbon * * Symbol : ZCC * Name : Zero Carbon * Total supply: 240,000,000.000000000000000000 * Decimals : 18 * * (c) Philip Louw / Zero Carbon Project 2018. The MIT Licence. */ contract ZeroCarbon is StandardToken, Claimable, BurnableToken { using SafeMath for uint256; string public constant name = "ZeroCarbon"; // solium-disable-line uppercase string public constant symbol = "ZCC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 240000000 * (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); } /** * @dev Owner can transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Basic(tokenAddress).transfer(owner, tokens); } }
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461010b578063095ea7b31461019557806318160ddd146101cd57806323b872dd146101f45780632ff2e9dc1461021e578063313ce5671461023357806342966c681461025e5780634e71e0c814610278578063661884631461028d57806370a08231146102b1578063715018a6146102d25780638da5cb5b146102e757806395d89b4114610318578063a9059cbb1461032d578063d73dd62314610351578063dc39d06d14610375578063dd62ed3e14610399578063e30c3978146103c0578063f2fde38b146103d5575b600080fd5b34801561011757600080fd5b506101206103f6565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015a578181015183820152602001610142565b50505050905090810190601f1680156101875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a157600080fd5b506101b9600160a060020a036004351660243561042d565b604080519115158252519081900360200190f35b3480156101d957600080fd5b506101e2610493565b60408051918252519081900360200190f35b34801561020057600080fd5b506101b9600160a060020a0360043581169060243516604435610499565b34801561022a57600080fd5b506101e261060e565b34801561023f57600080fd5b5061024861061d565b6040805160ff9092168252519081900360200190f35b34801561026a57600080fd5b50610276600435610622565b005b34801561028457600080fd5b5061027661062f565b34801561029957600080fd5b506101b9600160a060020a03600435166024356106b9565b3480156102bd57600080fd5b506101e2600160a060020a03600435166107a8565b3480156102de57600080fd5b506102766107c3565b3480156102f357600080fd5b506102fc610831565b60408051600160a060020a039092168252519081900360200190f35b34801561032457600080fd5b50610120610840565b34801561033957600080fd5b506101b9600160a060020a0360043516602435610877565b34801561035d57600080fd5b506101b9600160a060020a0360043516602435610956565b34801561038157600080fd5b506101b9600160a060020a03600435166024356109ef565b3480156103a557600080fd5b506101e2600160a060020a0360043581169060243516610aab565b3480156103cc57600080fd5b506102fc610ad6565b3480156103e157600080fd5b50610276600160a060020a0360043516610ae5565b60408051808201909152600a81527f5a65726f436172626f6e00000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a0383166000908152602081905260408120548211156104be57600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156104ee57600080fd5b600160a060020a038316151561050357600080fd5b600160a060020a03841660009081526020819052604090205461052c908363ffffffff610b2b16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610561908363ffffffff610b3d16565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546105a3908363ffffffff610b2b16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6ac685fa11e01ec6f000000081565b601281565b61062c3382610b50565b50565b600454600160a060020a0316331461064657600080fd5b600454600354604051600160a060020a0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600480546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b336000908152600260209081526040808320600160a060020a038616845290915281205480831061070d57336000908152600260209081526040808320600160a060020a0388168452909152812055610742565b61071d818463ffffffff610b2b16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146107da57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a031681565b60408051808201909152600381527f5a43430000000000000000000000000000000000000000000000000000000000602082015281565b3360009081526020819052604081205482111561089357600080fd5b600160a060020a03831615156108a857600080fd5b336000908152602081905260409020546108c8908363ffffffff610b2b16565b3360009081526020819052604080822092909255600160a060020a038516815220546108fa908363ffffffff610b3d16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205461098a908363ffffffff610b3d16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600354600090600160a060020a03163314610a0957600080fd5b600354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519185169163a9059cbb916044808201926020929091908290030181600087803b158015610a7857600080fd5b505af1158015610a8c573d6000803e3d6000fd5b505050506040513d6020811015610aa257600080fd5b50519392505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600454600160a060020a031681565b600354600160a060020a03163314610afc57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610b3757fe5b50900390565b81810182811015610b4a57fe5b92915050565b600160a060020a038216600090815260208190526040902054811115610b7557600080fd5b600160a060020a038216600090815260208190526040902054610b9e908263ffffffff610b2b16565b600160a060020a038316600090815260208190526040902055600154610bca908263ffffffff610b2b16565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350505600a165627a7a72305820930b561f0e416022d72231e78b71f9f264bd605d88b8b3bf9db72879b9a461da0029
{"success": true, "error": null, "results": {}}
2,156
0x018eae36092379453f3234a1e282662ba8a19067
/** *Submitted for verification at Etherscan.io on 2021-06-12 */ pragma solidity ^0.6.12; // SPDX-License-Identifier: MIT 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() public { 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 SuperDog is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SuperDog"; string private constant _symbol = "SuperDog \xF0\x9F\x90\xB6"; 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 = 1000 ** 12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 0; uint256 private _teamFee = 10; address private burnAddress = 0x000000000000000000000000000000000000dEaD; // Bot detection address[] private botArray; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; 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) public { _marketingFunds = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = 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 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 setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 0; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (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 { _marketingFunds.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 = false; _maxTxAmount = 5000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _marketingFunds); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingFunds); 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; botArray.push(bots_[i]); } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function burnBots() public onlyOwner { for (uint256 i = 0; i < botArray.length; i ++) { if (bots[botArray[i]]) { _transfer(botArray[i], burnAddress, balanceOf(botArray[i])); } } } 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd8014610637578063c9567bf91461064e578063d543dbeb14610665578063dd62ed3e146106a0578063fe598ba1146107255761011f565b8063715018a6146104195780638da5cb5b1461043057806395d89b4114610471578063a9059cbb14610501578063b515566a146105725761011f565b8063273123b7116100e7578063273123b7146102e1578063313ce567146103325780635932ead1146103605780636fc3eaec1461039d57806370a08231146103b45761011f565b806306fdde0314610124578063095ea7b3146101b457806318160ddd1461022557806323b872dd146102505761011f565b3661011f57005b600080fd5b34801561013057600080fd5b5061013961073c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c057600080fd5b5061020d600480360360408110156101d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610779565b60405180821515815260200191505060405180910390f35b34801561023157600080fd5b5061023a610797565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102c96004803603606081101561027357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b2565b60405180821515815260200191505060405180910390f35b3480156102ed57600080fd5b506103306004803603602081101561030457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061088b565b005b34801561033e57600080fd5b506103476109ae565b604051808260ff16815260200191505060405180910390f35b34801561036c57600080fd5b5061039b6004803603602081101561038357600080fd5b810190808035151590602001909291905050506109b7565b005b3480156103a957600080fd5b506103b2610a9c565b005b3480156103c057600080fd5b50610403600480360360208110156103d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b0e565b6040518082815260200191505060405180910390f35b34801561042557600080fd5b5061042e610b5f565b005b34801561043c57600080fd5b50610445610ce5565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047d57600080fd5b50610486610d0e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c65780820151818401526020810190506104ab565b50505050905090810190601f1680156104f35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050d57600080fd5b5061055a6004803603604081101561052457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d4b565b60405180821515815260200191505060405180910390f35b34801561057e57600080fd5b506106356004803603602081101561059557600080fd5b81019080803590602001906401000000008111156105b257600080fd5b8201836020820111156105c457600080fd5b803590602001918460208302840111640100000000831117156105e657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d69565b005b34801561064357600080fd5b5061064c610f2f565b005b34801561065a57600080fd5b50610663610fa9565b005b34801561067157600080fd5b5061069e6004803603602081101561068857600080fd5b8101908080359060200190929190505050611630565b005b3480156106ac57600080fd5b5061070f600480360360408110156106c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117e9565b6040518082815260200191505060405180910390f35b34801561073157600080fd5b5061073a611870565b005b60606040518060400160405280600881526020017f5375706572446f67000000000000000000000000000000000000000000000000815250905090565b600061078d610786611a85565b8484611a8d565b6001905092915050565b6000722cd76fe086b93ce2f768a00b22a00000000000905090565b60006107bf848484611c84565b610880846107cb611a85565b61087b856040518060600160405280602881526020016131a660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610831611a85565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124af9092919063ffffffff16565b611a8d565b600190509392505050565b610893611a85565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610953576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6109bf611a85565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610add611a85565b73ffffffffffffffffffffffffffffffffffffffff1614610afd57600080fd5b6000479050610b0b8161256f565b50565b6000610b58600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125db565b9050919050565b610b67611a85565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f5375706572446f6720f09f90b600000000000000000000000000000000000000815250905090565b6000610d5f610d58611a85565b8484611c84565b6001905092915050565b610d71611a85565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e31576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2b576001600c6000848481518110610e4f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600b828281518110610eb657fe5b60200260200101519080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508080600101915050610e34565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f70611a85565b73ffffffffffffffffffffffffffffffffffffffff1614610f9057600080fd5b6000610f9b30610b0e565b9050610fa68161265f565b50565b610fb1611a85565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611071576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601060149054906101000a900460ff16156110f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061118e30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16722cd76fe086b93ce2f768a00b22a00000000000611a8d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111d457600080fd5b505afa1580156111e8573d6000803e3d6000fd5b505050506040513d60208110156111fe57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561127157600080fd5b505afa158015611285573d6000803e3d6000fd5b505050506040513d602081101561129b57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561131557600080fd5b505af1158015611329573d6000803e3d6000fd5b505050506040513d602081101561133f57600080fd5b8101908080519060200190929190505050601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113d930610b0e565b6000806113e4610ce5565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561146957600080fd5b505af115801561147d573d6000803e3d6000fd5b50505050506040513d606081101561149457600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601060166101000a81548160ff0219169083151502179055506000601060176101000a81548160ff021916908315150217905550674563918244f400006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115f157600080fd5b505af1158015611605573d6000803e3d6000fd5b505050506040513d602081101561161b57600080fd5b81019080805190602001909291905050505050565b611638611a85565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161176e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b6117a7606461179983722cd76fe086b93ce2f768a00b22a0000000000061294990919063ffffffff16565b6129cf90919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611878611a85565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611938576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b600b80549050811015611a8257600c6000600b838154811061195957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a7557611a74600b82815481106119e157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611a6f600b8581548110611a3f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b0e565b611c84565b5b808060010191505061193b565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061321c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131636022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d0a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131f76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d90576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131166023913960400191505060405180910390fd5b60008111611de9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806131ce6029913960400191505060405180910390fd5b611df1610ce5565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5f5750611e2f610ce5565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156123ec57601060179054906101000a900460ff16156120c5573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ee157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f3b5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f955750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156120c457600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fdb611a85565b73ffffffffffffffffffffffffffffffffffffffff1614806120515750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612039611a85565b73ffffffffffffffffffffffffffffffffffffffff16145b6120c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b6011548111156120d457600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121785750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61218157600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561222c5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122825750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561229a5750601060179054906101000a900460ff165b156123325742600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106122ea57600080fd5b603c4201600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061233d30610b0e565b9050601060159054906101000a900460ff161580156123aa5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156123c25750601060169054906101000a900460ff165b156123ea576123d08161265f565b600047905060008111156123e8576123e74761256f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806124935750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561249d57600090505b6124a984848484612a19565b50505050565b600083831115829061255c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612521578082015181840152602081019050612506565b50505050905090810190601f16801561254e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156125d7573d6000803e3d6000fd5b5050565b6000600654821115612638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613139602a913960400191505060405180910390fd5b6000612642612a46565b905061265781846129cf90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561269457600080fd5b506040519080825280602002602001820160405280156126c35781602001602082028036833780820191505090505b50905030816000815181106126d457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561277657600080fd5b505afa15801561278a573d6000803e3d6000fd5b505050506040513d60208110156127a057600080fd5b8101908080519060200190929190505050816001815181106127be57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061282530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a8d565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156128e95780820151818401526020810190506128ce565b505050509050019650505050505050600060405180830381600087803b15801561291257600080fd5b505af1158015612926573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b60008083141561295c57600090506129c9565b600082840290508284828161296d57fe5b04146129c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806131856021913960400191505060405180910390fd5b809150505b92915050565b6000612a1183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a71565b905092915050565b80612a2757612a26612b37565b5b612a32848484612b68565b80612a4057612a3f612d33565b5b50505050565b6000806000612a53612d45565b91509150612a6a81836129cf90919063ffffffff16565b9250505090565b60008083118290612b1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612ae2578082015181840152602081019050612ac7565b50505050905090810190601f168015612b0f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612b2957fe5b049050809150509392505050565b6000600854148015612b4b57506000600954145b15612b5557612b66565b600060088190555060006009819055505b565b600080600080600080612b7a87612dc5565b955095509550955095509550612bd886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e2d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c6d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cb981612eff565b612cc38483612fbc565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000600881905550600a600981905550565b600080600060065490506000722cd76fe086b93ce2f768a00b22a000000000009050612d8f722cd76fe086b93ce2f768a00b22a000000000006006546129cf90919063ffffffff16565b821015612db857600654722cd76fe086b93ce2f768a00b22a00000000000935093505050612dc1565b81819350935050505b9091565b6000806000806000806000806000612de28a600854600954612ff6565b9250925092506000612df2612a46565b90506000806000612e058e87878761308c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612e6f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506124af565b905092915050565b600080828401905083811015612ef5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000612f09612a46565b90506000612f20828461294990919063ffffffff16565b9050612f7481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612fd182600654612e2d90919063ffffffff16565b600681905550612fec81600754612e7790919063ffffffff16565b6007819055505050565b6000806000806130226064613014888a61294990919063ffffffff16565b6129cf90919063ffffffff16565b9050600061304c606461303e888b61294990919063ffffffff16565b6129cf90919063ffffffff16565b9050600061307582613067858c612e2d90919063ffffffff16565b612e2d90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806130a5858961294990919063ffffffff16565b905060006130bc868961294990919063ffffffff16565b905060006130d3878961294990919063ffffffff16565b905060006130fc826130ee8587612e2d90919063ffffffff16565b612e2d90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212209f76ffc35f60e941ed8d37f21e45b080f309fd28390026b7141aa562911e8f0c64736f6c634300060c0033
{"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"}]}}
2,157
0x50f5db0c3faaa2c458168046fc972e9b2276feb3
/** *Submitted for verification at Etherscan.io on 2021-09-30 */ // SPDX-License-Identifier: MIT pragma solidity ^0.5.4; // ---------------------------------------------------------------------------- // 'DRX' token contract // // Symbol : DRX // Name : DRX // Total supply: 10000000000 // Decimals : 18 // // ---------------------------------------------------------------------------- interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { 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 sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) private _allowed; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom( address from, address to, uint256 value ) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add( addedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub( subtractedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function _transfer( address from, address to, uint256 value ) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } } contract DRX is ERC20 { string public constant name = "DRX"; string public constant symbol = "DRX"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 10000000000 * (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 renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } 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; } function dropToken(address[] memory _receivers, uint256[] memory _values) public onlyOwner { require(_receivers.length != 0); require(_receivers.length == _values.length); for (uint256 i = 0; i < _receivers.length; i++) { transfer(_receivers[i], _values[i]); emit Transfer(msg.sender, _receivers[i], _values[i]); } } 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 Mint(address indexed to, uint256 amount); function mint(address _to, uint256 _amount) public onlyOwner returns (bool) { super._mint(_to, _amount); emit Mint(_to, _amount); return true; } 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++) { if (lockInfo[_holder][i].releaseTime <= now) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } } return super.balanceOf(_holder).add(lockedBalance); } function balanceOfLocked(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for (uint256 i = 0; i < lockInfo[_holder].length; i++) { if (lockInfo[_holder][i].releaseTime > now) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } } return lockedBalance; } function balanceOfTotal(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 lockAfter( address _holder, uint256 _amount, uint256 _afterTime ) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push(LockInfo(now + _afterTime, _amount)); emit Lock(_holder, _amount, now + _afterTime); } 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; } function transferWithLockAfter( address _to, uint256 _value, uint256 _afterTime ) 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(now + _afterTime, _value)); emit Transfer(owner, _to, _value); emit Lock(_to, _value, now + _afterTime); return true; } function currentTime() public view returns (uint256) { return now; } function afterTime(uint256 _value) public view returns (uint256) { return now + _value; } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c80638a57af6b11610125578063d18e81b3116100ad578063df0345861161007c578063df03458614610c23578063e2ab691d14610c7b578063e583983614610cd3578063e960bb4814610d2f578063f2fde38b14610d8757610211565b8063d18e81b314610ac5578063d29dad8314610ae3578063dd62ed3e14610b3b578063de6baccb14610bb357610211565b806395d89b41116100f457806395d89b41146107dc5780639dc29fac1461085f578063a457c2d7146108ad578063a9059cbb14610913578063c77828d01461097957610211565b80638a57af6b146106865780638d1fdf2f146106de5780638da5cb5b14610722578063927a4a7b1461076c57610211565b80633f4ba83a116101a85780635c975abb116101775780635c975abb146105aa57806370a08231146105cc578063715018a6146106245780637eee288d1461062e5780638456cb591461067c57610211565b80633f4ba83a1461048d57806340c10f191461049757806345c8b1a6146104fd57806346cf1bb51461054157610211565b806323b872dd116101e457806323b872dd1461035f578063313ce567146103e5578063378dc3dc14610409578063395093511461042757610211565b806304859ceb1461021657806306fdde0314610258578063095ea7b3146102db57806318160ddd14610341575b600080fd5b6102426004803603602081101561022c57600080fd5b8101908080359060200190929190505050610dcb565b6040518082815260200191505060405180910390f35b610260610dd7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102a0578082015181840152602081019050610285565b50505050905090810190601f1680156102cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610327600480360360408110156102f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e10565b604051808215151515815260200191505060405180910390f35b610349610f3b565b6040518082815260200191505060405180910390f35b6103cb6004803603606081101561037557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f45565b604051808215151515815260200191505060405180910390f35b6103ed6110a7565b604051808260ff1660ff16815260200191505060405180910390f35b6104116110ac565b6040518082815260200191505060405180910390f35b6104736004803603604081101561043d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110be565b604051808215151515815260200191505060405180910390f35b6104956112f3565b005b6104e3600480360360408110156104ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611481565b604051808215151515815260200191505060405180910390f35b61053f6004803603602081101561051357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115a8565b005b61058d6004803603604081101561055757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611729565b604051808381526020018281526020019250505060405180910390f35b6105b26117ef565b604051808215151515815260200191505060405180910390f35b61060e600480360360208110156105e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611802565b6040518082815260200191505060405180910390f35b61062c61195d565b005b61067a6004803603604081101561064457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ac9565b005b610684611feb565b005b6106dc6004803603606081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061217a565b005b610720600480360360208110156106f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612443565b005b61072a6125c4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107c26004803603606081101561078257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506125ea565b604051808215151515815260200191505060405180910390f35b6107e4612a4b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610824578082015181840152602081019050610809565b50505050905090810190601f1680156108515780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108ab6004803603604081101561087557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612a84565b005b6108f9600480360360408110156108c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612c21565b604051808215151515815260200191505060405180910390f35b61095f6004803603604081101561092957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612e56565b604051808215151515815260200191505060405180910390f35b610ac36004803603604081101561098f57600080fd5b81019080803590602001906401000000008111156109ac57600080fd5b8201836020820111156109be57600080fd5b803590602001918460208302840111640100000000831117156109e057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610a4057600080fd5b820183602082011115610a5257600080fd5b80359060200191846020830284011164010000000083111715610a7457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050612fb6565b005b610acd613173565b6040518082815260200191505060405180910390f35b610b2560048036036020811015610af957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061317b565b6040518082815260200191505060405180910390f35b610b9d60048036036040811015610b5157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613273565b6040518082815260200191505060405180910390f35b610c0960048036036060811015610bc957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506132fa565b604051808215151515815260200191505060405180910390f35b610c6560048036036020811015610c3957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613757565b6040518082815260200191505060405180910390f35b610cd160048036036060811015610c9157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506137a3565b005b610d1560048036036020811015610ce957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613a68565b604051808215151515815260200191505060405180910390f35b610d7160048036036020811015610d4557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613abe565b6040518082815260200191505060405180910390f35b610dc960048036036020811015610d9d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613c00565b005b60008142019050919050565b6040518060400160405280600381526020017f445258000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e4b57600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600360149054906101000a900460ff1615610fca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f506175736564206279206f776e6572000000000000000000000000000000000081525060200191505060405180910390fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561108a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f46726f6d206163636f756e74206973206c6f636b65642e00000000000000000081525060200191505060405180910390fd5b61109384613ccf565b61109e848484614140565b90509392505050565b601281565b601260ff16600a0a6402540be4000281565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110f957600080fd5b61118882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461434890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600360149054906101000a900460ff16611438576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4e6f7420706175736564206e6f7700000000000000000000000000000000000081525060200191505060405180910390fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611546576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6115508383614367565b8273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a26001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461166b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600080600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811061177657fe5b906000526020600020906002020160000154600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481106117d257fe5b906000526020600020906002020160010154915091509250929050565b600360149054906101000a900460ff1681565b6000806000905060008090505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156119395742600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106118a457fe5b9060005260206000209060020201600001541161192c57611929600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061190857fe5b9060005260206000209060020201600101548361434890919063ffffffff16565b91505b808060010191505061180f565b5061195581611947856144b9565b61434890919063ffffffff16565b915050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a20576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110611c43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4e6f206c6f636b20696e666f726d6174696f6e2e00000000000000000000000081525060200191505060405180910390fd5b611cef600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611c9057fe5b9060005260206000209060020201600101546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461434890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110611db357fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611e2657fe5b9060005260206000209060020201600101819055506001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038114611f9457600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490500381548110611f1657fe5b9060005260206000209060020201600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611f6e57fe5b906000526020600020906002020160008201548160000155600182015481600101559050505b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480919060019003611fe691906149b7565b505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600360149054906101000a900460ff1615612131576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f506175736564206279206f776e6572000000000000000000000000000000000081525060200191505060405180910390fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461223d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81612247846144b9565b10156122bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f42616c616e636520697320746f6f20736d616c6c2e000000000000000000000081525060200191505060405180910390fd5b61230c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461450190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180604001604052808342018152602001848152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508273ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b83834201604051808381526020018281526020019250505060405180910390a2505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612506576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a491381604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146126af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f77726f6e6720616464726573730000000000000000000000000000000000000081525060200191505060405180910390fd5b61277d600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166144b9565b8311156127f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f7420656e6f7567682062616c616e6365000000000000000000000000000081525060200191505060405180910390fd5b61286583600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461450190919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180604001604052808442018152602001858152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b84844201604051808381526020018281526020019250505060405180910390a2600190509392505050565b6040518060400160405280600381526020017f445258000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612b47576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b612b50826144b9565b811115612bc5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f42616c616e636520697320746f6f20736d616c6c2e000000000000000000000081525060200191505060405180910390fd5b612bcf8282614521565b8173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612c5c57600080fd5b612ceb82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461450190919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612f18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f53656e646572206163636f756e74206973206c6f636b65642e0000000000000081525060200191505060405180910390fd5b600360149054906101000a900460ff1615612f9b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f506175736564206279206f776e6572000000000000000000000000000000000081525060200191505060405180910390fd5b612fa433613ccf565b612fae8383614673565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613079576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008251141561308857600080fd5b805182511461309657600080fd5b60008090505b825181101561316e576130d58382815181106130b457fe5b60200260200101518383815181106130c857fe5b6020026020010151612e56565b508281815181106130e257fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061314457fe5b60200260200101516040518082815260200191505060405180910390a3808060010191505061309c565b505050565b600042905090565b6000806000905060008090505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561324f57613240600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061321f57fe5b9060005260206000209060020201600101548361434890919063ffffffff16565b91508080600101915050613188565b5061326b8161325d856144b9565b61434890919063ffffffff16565b915050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146133bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415613462576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f77726f6e6720616464726573730000000000000000000000000000000000000081525060200191505060405180910390fd5b61348d600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166144b9565b831115613502576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f7420656e6f7567682062616c616e6365000000000000000000000000000081525060200191505060405180910390fd5b61357583600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461450190919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060400160405280848152602001858152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8484604051808381526020018281526020019250505060405180910390a2600190509392505050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613866576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81613870846144b9565b10156138e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f42616c616e636520697320746f6f20736d616c6c2e000000000000000000000081525060200191505060405180910390fd5b613935826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461450190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060400160405280838152602001848152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508273ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8383604051808381526020018281526020019250505060405180910390a2505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000806000905060008090505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015613bf65742600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613b6057fe5b9060005260206000209060020201600001541115613be957613be6600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613bc557fe5b9060005260206000209060020201600101548361434890919063ffffffff16565b91505b8080600101915050613acb565b5080915050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613cc3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f74206f776e6572000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b613ccc8161468a565b50565b60008090505b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561413c5742600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613d6a57fe5b9060005260206000209060020201600001541161412f57613e2d600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613dce57fe5b9060005260206000209060020201600101546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461434890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110613ef157fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613f6457fe5b9060005260206000209060020201600101819055506001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490500381146140db57600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038154811061405457fe5b9060005260206000209060020201600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106140ac57fe5b906000526020600020906002020160008201548160000155600182015481600101559050508080600190039150505b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548091906001900361412d91906149b7565b505b8080600101915050613cd5565b5050565b60006141d182600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461450190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061425c8484846147ed565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b60008082840190508381101561435d57600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156143a157600080fd5b6143b68160025461434890919063ffffffff16565b60028190555061440d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461434890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008282111561451057600080fd5b600082840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561455b57600080fd5b6145708160025461450190919063ffffffff16565b6002819055506145c7816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461450190919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60006146803384846147ed565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561472d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f416c7265616479206f776e65720000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561482757600080fd5b614878816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461450190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061490b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461434890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b8154818355818111156149e4576002028160020283600052602060002091820191016149e391906149e9565b5b505050565b614a1591905b80821115614a11576000808201600090556001820160009055506002016149ef565b5090565b9056fea265627a7a72315820bb6b9ef414f8af03efcc851555865040318d2758bd8958ce3ea25596dbd5f74464736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
2,158
0x01a4eff52864274ab8180bc519cf002cc414077c
/** *Submitted for verification at Etherscan.io on 2021-10-08 */ // SPDX-License-Identifier: NOLICENSE /* ___ _____ ___ ___ ___ _____ _ _ / __| |_ _| | _ \ | __| | __| |_ _| | || | \__ \ | | | / | _| | _| | | | __ | |___/ |_| |_|_\ |___| |___| |_| |_||_| Streeth curates, mints and auctions Street Art on the Ethereum blockchain. Website: https://www.streeth.io/ Contacts: [email protected] */ pragma solidity ^0.8.6; 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); } 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); constructor() { _setOwner(_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 { _setOwner(address(0)); } 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 IFactory{ function createPair(address tokenA, address tokenB) external returns (address pair); } interface IRouter { function factory() external pure returns (address); function WETH() external pure returns (address); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external; } contract STREETH is Context, IERC20, Ownable { mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; address[] private _excluded; bool public swapEnabled; bool private swapping; IRouter public router; address public pair; uint8 private constant _decimals = 9; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 300_000_000 * 10**_decimals; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 public swapTokensAtAmount = 50000 * 10**_decimals; string private constant _name = "STREETH"; string private constant _symbol = "STREETH"; address public marketingWallet = 0x5cd0a4043cFa2776bFeD01E5DE11cA8f86bb8153; struct feeRatesStruct { uint256 rfi; uint256 marketing; } feeRatesStruct public feeRates = feeRatesStruct( {rfi: 1, marketing: 1 }); struct TotFeesPaidStruct{ uint256 rfi; uint256 marketing; } TotFeesPaidStruct public totFeesPaid; struct valuesFromGetValues{ uint256 rAmount; uint256 rTransferAmount; uint256 rRfi; uint256 rMarketing; uint256 tTransferAmount; uint256 tRfi; uint256 tMarketing; } event FeesChanged(); event TradingEnabled(uint256 startDate); event UpdatedRouter(address oldRouter, address newRouter); modifier lockTheSwap { swapping = true; _; swapping = false; } constructor (address routerAddress) { IRouter _router = IRouter(routerAddress); address _pair = IFactory(_router.factory()) .createPair(address(this), _router.WETH()); router = _router; pair = _pair; excludeFromReward(pair); _rOwned[owner()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = 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 view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public 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; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender]+addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function isExcludedFromReward(address account) public view returns (bool) { return _isExcluded[account]; } function reflectionFromToken(uint256 tAmount, bool deductTransferRfi) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferRfi) { valuesFromGetValues memory s = _getValues(tAmount, true); return s.rAmount; } else { valuesFromGetValues memory s = _getValues(tAmount, true); return s.rTransferAmount; } } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount/currentRate; } function excludeFromReward(address account) internal { require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeInReward(address account) internal { require(_isExcluded[account], "Account is not excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } function _reflectRfi(uint256 rRfi, uint256 tRfi) private { _rTotal -=rRfi; totFeesPaid.rfi +=tRfi; } function _takeMarketing(uint256 rMarketing, uint256 tMarketing) private { totFeesPaid.marketing +=tMarketing; if(_isExcluded[address(this)]) { _tOwned[address(this)]+=tMarketing; } _rOwned[address(this)] +=rMarketing; } function _getValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory to_return) { to_return = _getTValues(tAmount, takeFee); (to_return.rAmount, to_return.rTransferAmount, to_return.rRfi, to_return.rMarketing) = _getRValues(to_return, tAmount, takeFee, _getRate()); return to_return; } function _getTValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory s) { if(!takeFee) { s.tTransferAmount = tAmount; return s; } s.tRfi = tAmount*feeRates.rfi/100; s.tMarketing = tAmount*feeRates.marketing/100; s.tTransferAmount = tAmount-s.tRfi-s.tMarketing; return s; } function _getRValues(valuesFromGetValues memory s, uint256 tAmount, bool takeFee, uint256 currentRate) private pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rRfi, uint256 rMarketing) { rAmount = tAmount*currentRate; if(!takeFee) { return(rAmount, rAmount, 0,0); } rRfi = s.tRfi*currentRate; rMarketing = s.tMarketing*currentRate; rTransferAmount = rAmount-rRfi-rMarketing; return (rAmount, rTransferAmount, rRfi,rMarketing); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply/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-_rOwned[_excluded[i]]; tSupply = tSupply-_tOwned[_excluded[i]]; } if (rSupply < _rTotal/_tTotal) return (_rTotal, _tTotal); return (rSupply, tSupply); } 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(amount <= balanceOf(from),"You are trying to transfer more than your balance"); uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= swapTokensAtAmount; if(!swapping && swapEnabled && canSwap && from != pair){ swapAndSendToFee(swapTokensAtAmount); } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || (to != pair && from != pair)){ takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } //this method is responsible for taking all fee, if takeFee is true function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private { valuesFromGetValues memory s = _getValues(tAmount, takeFee); if (_isExcluded[sender] ) { //from excluded _tOwned[sender] = _tOwned[sender]-tAmount; } if (_isExcluded[recipient]) { //to excluded _tOwned[recipient] = _tOwned[recipient]+s.tTransferAmount; } _rOwned[sender] = _rOwned[sender]-s.rAmount; _rOwned[recipient] = _rOwned[recipient]+s.rTransferAmount; _reflectRfi(s.rRfi, s.tRfi); _takeMarketing(s.rMarketing,s.tMarketing); emit Transfer(sender, recipient, s.tTransferAmount); emit Transfer(sender, address(this), s.tMarketing); } function swapAndSendToFee(uint256 tokens) private lockTheSwap{ swapTokensForETH(tokens, marketingWallet); } function swapTokensForETH(uint256 tokenAmount, address recipient) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); _approve(address(this), address(router), tokenAmount); router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, payable(recipient), block.timestamp ); } function updateMarketingWallet(address newWallet) external onlyOwner{ marketingWallet = newWallet; } function updateSwapTokensAtAmount(uint256 amount) external onlyOwner{ swapTokensAtAmount = amount * 10**_decimals; } function updateSwapEnabled(bool _enabled) external onlyOwner{ swapEnabled = _enabled; } receive() external payable{ } }
0x6080604052600436106101d15760003560e01c806388f82020116100f7578063a9059cbb11610095578063e2f4560511610064578063e2f45605146106e7578063ea2f0b3714610712578063f2fde38b1461073b578063f887ea4014610764576101d8565b8063a9059cbb1461061b578063aacebbe314610658578063d257b34f14610681578063dd62ed3e146106aa576101d8565b806395d89b41116100d157806395d89b411461055c5780639ba5e4d514610587578063a457c2d7146105b3578063a8aa1b31146105f0576101d8565b806388f82020146104cb5780638da5cb5b14610508578063924de9b714610533576101d8565b8063437823ec1161016f57806370a082311161013e57806370a0823114610420578063715018a61461045d57806375f0a874146104745780637688c5841461049f576101d8565b8063437823ec146103525780634549b0391461037b5780635342acb4146103b85780636ddd1713146103f5576101d8565b806323b872dd116101ab57806323b872dd146102705780632d838119146102ad578063313ce567146102ea5780633950935114610315576101d8565b806306fdde03146101dd578063095ea7b31461020857806318160ddd14610245576101d8565b366101d857005b600080fd5b3480156101e957600080fd5b506101f261078f565b6040516101ff9190612bc9565b60405180910390f35b34801561021457600080fd5b5061022f600480360381019061022a91906127d3565b6107cc565b60405161023c9190612b93565b60405180910390f35b34801561025157600080fd5b5061025a6107ea565b6040516102679190612d6b565b60405180910390f35b34801561027c57600080fd5b5061029760048036038101906102929190612780565b6107f4565b6040516102a49190612b93565b60405180910390f35b3480156102b957600080fd5b506102d460048036038101906102cf9190612840565b6108f5565b6040516102e19190612d6b565b60405180910390f35b3480156102f657600080fd5b506102ff61095c565b60405161030c9190612e09565b60405180910390f35b34801561032157600080fd5b5061033c600480360381019061033791906127d3565b610965565b6040516103499190612b93565b60405180910390f35b34801561035e57600080fd5b50610379600480360381019061037491906126e6565b610a11565b005b34801561038757600080fd5b506103a2600480360381019061039d919061286d565b610ae8565b6040516103af9190612d6b565b60405180910390f35b3480156103c457600080fd5b506103df60048036038101906103da91906126e6565b610b6e565b6040516103ec9190612b93565b60405180910390f35b34801561040157600080fd5b5061040a610bc4565b6040516104179190612b93565b60405180910390f35b34801561042c57600080fd5b50610447600480360381019061044291906126e6565b610bd7565b6040516104549190612d6b565b60405180910390f35b34801561046957600080fd5b50610472610cc2565b005b34801561048057600080fd5b50610489610d4a565b6040516104969190612b78565b60405180910390f35b3480156104ab57600080fd5b506104b4610d70565b6040516104c2929190612de0565b60405180910390f35b3480156104d757600080fd5b506104f260048036038101906104ed91906126e6565b610d82565b6040516104ff9190612b93565b60405180910390f35b34801561051457600080fd5b5061051d610dd8565b60405161052a9190612b78565b60405180910390f35b34801561053f57600080fd5b5061055a60048036038101906105559190612813565b610e01565b005b34801561056857600080fd5b50610571610e9a565b60405161057e9190612bc9565b60405180910390f35b34801561059357600080fd5b5061059c610ed7565b6040516105aa929190612de0565b60405180910390f35b3480156105bf57600080fd5b506105da60048036038101906105d591906127d3565b610ee9565b6040516105e79190612b93565b60405180910390f35b3480156105fc57600080fd5b50610605610fdd565b6040516106129190612b78565b60405180910390f35b34801561062757600080fd5b50610642600480360381019061063d91906127d3565b611003565b60405161064f9190612b93565b60405180910390f35b34801561066457600080fd5b5061067f600480360381019061067a91906126e6565b611021565b005b34801561068d57600080fd5b506106a860048036038101906106a39190612840565b6110e1565b005b3480156106b657600080fd5b506106d160048036038101906106cc9190612740565b61117f565b6040516106de9190612d6b565b60405180910390f35b3480156106f357600080fd5b506106fc611206565b6040516107099190612d6b565b60405180910390f35b34801561071e57600080fd5b50610739600480360381019061073491906126e6565b61120c565b005b34801561074757600080fd5b50610762600480360381019061075d91906126e6565b6112e3565b005b34801561077057600080fd5b506107796113db565b6040516107869190612bae565b60405180910390f35b60606040518060400160405280600781526020017f5354524545544800000000000000000000000000000000000000000000000000815250905090565b60006107e06107d9611401565b8484611409565b6001905092915050565b6000600954905090565b60006108018484846115d4565b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061084c611401565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390612cab565b60405180910390fd5b6108e9856108d8611401565b85846108e491906130cb565b611409565b60019150509392505050565b6000600a5482111561093c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093390612c2b565b60405180910390fd5b600061094661196e565b905080836109549190612ecf565b915050919050565b60006009905090565b6000610a07610972611401565b848460036000610980611401565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a029190612e79565b611409565b6001905092915050565b610a19611401565b73ffffffffffffffffffffffffffffffffffffffff16610a37610dd8565b73ffffffffffffffffffffffffffffffffffffffff1614610a8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8490612ccb565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600954831115610b2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2690612c8b565b60405180910390fd5b81610b50576000610b41846001611992565b90508060000151915050610b68565b6000610b5d846001611992565b905080602001519150505b92915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600760009054906101000a900460ff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610c7257600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cbd565b610cba600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546108f5565b90505b919050565b610cca611401565b73ffffffffffffffffffffffffffffffffffffffff16610ce8610dd8565b73ffffffffffffffffffffffffffffffffffffffff1614610d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3590612ccb565b60405180910390fd5b610d4860006119e3565b565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d8060000154908060010154905082565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e09611401565b73ffffffffffffffffffffffffffffffffffffffff16610e27610dd8565b73ffffffffffffffffffffffffffffffffffffffff1614610e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7490612ccb565b60405180910390fd5b80600760006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600781526020017f5354524545544800000000000000000000000000000000000000000000000000815250905090565b600f8060000154908060010154905082565b60008060036000610ef8611401565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610fb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fac90612d4b565b60405180910390fd5b610fd2610fc0611401565b858584610fcd91906130cb565b611409565b600191505092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611017611010611401565b84846115d4565b6001905092915050565b611029611401565b73ffffffffffffffffffffffffffffffffffffffff16611047610dd8565b73ffffffffffffffffffffffffffffffffffffffff161461109d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109490612ccb565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6110e9611401565b73ffffffffffffffffffffffffffffffffffffffff16611107610dd8565b73ffffffffffffffffffffffffffffffffffffffff161461115d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115490612ccb565b60405180910390fd5b6009600a61116b9190612f53565b816111769190613071565b600b8190555050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b5481565b611214611401565b73ffffffffffffffffffffffffffffffffffffffff16611232610dd8565b73ffffffffffffffffffffffffffffffffffffffff1614611288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127f90612ccb565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6112eb611401565b73ffffffffffffffffffffffffffffffffffffffff16611309610dd8565b73ffffffffffffffffffffffffffffffffffffffff161461135f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135690612ccb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c690612c4b565b60405180910390fd5b6113d8816119e3565b50565b600760029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611479576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147090612d2b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e090612c6b565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c79190612d6b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611644576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163b90612d0b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ab90612beb565b60405180910390fd5b600081116116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee90612ceb565b60405180910390fd5b61170083610bd7565b811115611742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173990612c0b565b60405180910390fd5b600061174d30610bd7565b90506000600b548210159050600760019054906101000a900460ff161580156117825750600760009054906101000a900460ff165b801561178b5750805b80156117e55750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156117f6576117f5600b54611aa7565b5b600060019050600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061189d5750600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806119505750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415801561194f5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b5b1561195a57600090505b61196686868684611b0c565b505050505050565b600080600061197b611f01565b91509150808261198b9190612ecf565b9250505090565b61199a612655565b6119a4838361219f565b90506119b98184846119b461196e565b612236565b84600001856020018660400187606001848152508481525084815250848152505050505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600760016101000a81548160ff021916908315150217905550611aee81600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166122aa565b6000600760016101000a81548160ff02191690831515021790555050565b6000611b188383611992565b9050600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611bfb5782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bb791906130cb565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611ce0578060800151600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9c9190612e79565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8060000151600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2f91906130cb565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508060200151600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dc19190612e79565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e1681604001518260a001516124fd565b611e2881606001518260c00151612536565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360800151604051611e899190612d6b565b60405180910390a33073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360c00151604051611ef29190612d6b565b60405180910390a35050505050565b6000806000600a5490506000600954905060005b60068054905081101561216957826001600060068481548110611f3b57611f3a613288565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806120295750816002600060068481548110611fc157611fc0613288565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561204057600a546009549450945050505061219b565b600160006006838154811061205857612057613288565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836120c991906130cb565b925060026000600683815481106120e3576120e2613288565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261215491906130cb565b91508080612161906131e1565b915050611f15565b50600954600a5461217a9190612ecf565b82101561219257600a5460095493509350505061219b565b81819350935050505b9091565b6121a7612655565b816121bb5782816080018181525050612230565b6064600d60000154846121ce9190613071565b6121d89190612ecf565b8160a00181815250506064600d60010154846121f49190613071565b6121fe9190612ecf565b8160c00181815250508060c001518160a001518461221c91906130cb565b61222691906130cb565b8160800181815250505b92915050565b60008060008084876122489190613071565b935085612261578384600080935093509350935061229f565b848860a001516122719190613071565b9150848860c001516122839190613071565b905080828561229291906130cb565b61229c91906130cb565b92505b945094509450949050565b6000600267ffffffffffffffff8111156122c7576122c66132b7565b5b6040519080825280602002602001820160405280156122f55781602001602082028036833780820191505090505b509050308160008151811061230d5761230c613288565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123af57600080fd5b505afa1580156123c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e79190612713565b816001815181106123fb576123fa613288565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061246230600760029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685611409565b600760029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478460008486426040518663ffffffff1660e01b81526004016124c6959493929190612d86565b600060405180830381600087803b1580156124e057600080fd5b505af11580156124f4573d6000803e3d6000fd5b50505050505050565b81600a600082825461250f91906130cb565b9250508190555080600f600001600082825461252b9190612e79565b925050819055505050565b80600f600101600082825461254b9190612e79565b92505081905550600560003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156125fb5780600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546125f39190612e79565b925050819055505b81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461264a9190612e79565b925050819055505050565b6040518060e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000813590506126a181613671565b92915050565b6000815190506126b681613671565b92915050565b6000813590506126cb81613688565b92915050565b6000813590506126e08161369f565b92915050565b6000602082840312156126fc576126fb6132e6565b5b600061270a84828501612692565b91505092915050565b600060208284031215612729576127286132e6565b5b6000612737848285016126a7565b91505092915050565b60008060408385031215612757576127566132e6565b5b600061276585828601612692565b925050602061277685828601612692565b9150509250929050565b600080600060608486031215612799576127986132e6565b5b60006127a786828701612692565b93505060206127b886828701612692565b92505060406127c9868287016126d1565b9150509250925092565b600080604083850312156127ea576127e96132e6565b5b60006127f885828601612692565b9250506020612809858286016126d1565b9150509250929050565b600060208284031215612829576128286132e6565b5b6000612837848285016126bc565b91505092915050565b600060208284031215612856576128556132e6565b5b6000612864848285016126d1565b91505092915050565b60008060408385031215612884576128836132e6565b5b6000612892858286016126d1565b92505060206128a3858286016126bc565b9150509250929050565b60006128b983836128d4565b60208301905092915050565b6128ce81613154565b82525050565b6128dd816130ff565b82525050565b6128ec816130ff565b82525050565b60006128fd82612e34565b6129078185612e57565b935061291283612e24565b8060005b8381101561294357815161292a88826128ad565b975061293583612e4a565b925050600181019050612916565b5085935050505092915050565b61295981613111565b82525050565b61296881613166565b82525050565b61297781613178565b82525050565b600061298882612e3f565b6129928185612e68565b93506129a28185602086016131ae565b6129ab816132eb565b840191505092915050565b60006129c3602383612e68565b91506129ce82613309565b604082019050919050565b60006129e6603183612e68565b91506129f182613358565b604082019050919050565b6000612a09602a83612e68565b9150612a14826133a7565b604082019050919050565b6000612a2c602683612e68565b9150612a37826133f6565b604082019050919050565b6000612a4f602283612e68565b9150612a5a82613445565b604082019050919050565b6000612a72601f83612e68565b9150612a7d82613494565b602082019050919050565b6000612a95602883612e68565b9150612aa0826134bd565b604082019050919050565b6000612ab8602083612e68565b9150612ac38261350c565b602082019050919050565b6000612adb602983612e68565b9150612ae682613535565b604082019050919050565b6000612afe602583612e68565b9150612b0982613584565b604082019050919050565b6000612b21602483612e68565b9150612b2c826135d3565b604082019050919050565b6000612b44602583612e68565b9150612b4f82613622565b604082019050919050565b612b638161313d565b82525050565b612b7281613147565b82525050565b6000602082019050612b8d60008301846128e3565b92915050565b6000602082019050612ba86000830184612950565b92915050565b6000602082019050612bc3600083018461295f565b92915050565b60006020820190508181036000830152612be3818461297d565b905092915050565b60006020820190508181036000830152612c04816129b6565b9050919050565b60006020820190508181036000830152612c24816129d9565b9050919050565b60006020820190508181036000830152612c44816129fc565b9050919050565b60006020820190508181036000830152612c6481612a1f565b9050919050565b60006020820190508181036000830152612c8481612a42565b9050919050565b60006020820190508181036000830152612ca481612a65565b9050919050565b60006020820190508181036000830152612cc481612a88565b9050919050565b60006020820190508181036000830152612ce481612aab565b9050919050565b60006020820190508181036000830152612d0481612ace565b9050919050565b60006020820190508181036000830152612d2481612af1565b9050919050565b60006020820190508181036000830152612d4481612b14565b9050919050565b60006020820190508181036000830152612d6481612b37565b9050919050565b6000602082019050612d806000830184612b5a565b92915050565b600060a082019050612d9b6000830188612b5a565b612da8602083018761296e565b8181036040830152612dba81866128f2565b9050612dc960608301856128c5565b612dd66080830184612b5a565b9695505050505050565b6000604082019050612df56000830185612b5a565b612e026020830184612b5a565b9392505050565b6000602082019050612e1e6000830184612b69565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e848261313d565b9150612e8f8361313d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ec457612ec361322a565b5b828201905092915050565b6000612eda8261313d565b9150612ee58361313d565b925082612ef557612ef4613259565b5b828204905092915050565b6000808291508390505b6001851115612f4a57808604811115612f2657612f2561322a565b5b6001851615612f355780820291505b8081029050612f43856132fc565b9450612f0a565b94509492505050565b6000612f5e8261313d565b9150612f6983613147565b9250612f967fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612f9e565b905092915050565b600082612fae576001905061306a565b81612fbc576000905061306a565b8160018114612fd25760028114612fdc5761300b565b600191505061306a565b60ff841115612fee57612fed61322a565b5b8360020a9150848211156130055761300461322a565b5b5061306a565b5060208310610133831016604e8410600b84101617156130405782820a90508381111561303b5761303a61322a565b5b61306a565b61304d8484846001612f00565b925090508184048111156130645761306361322a565b5b81810290505b9392505050565b600061307c8261313d565b91506130878361313d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130c0576130bf61322a565b5b828202905092915050565b60006130d68261313d565b91506130e18361313d565b9250828210156130f4576130f361322a565b5b828203905092915050565b600061310a8261311d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061315f8261318a565b9050919050565b60006131718261318a565b9050919050565b60006131838261313d565b9050919050565b60006131958261319c565b9050919050565b60006131a78261311d565b9050919050565b60005b838110156131cc5780820151818401526020810190506131b1565b838111156131db576000848401525b50505050565b60006131ec8261313d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561321f5761321e61322a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f596f752061726520747279696e6720746f207472616e73666572206d6f72652060008201527f7468616e20796f75722062616c616e6365000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20737570706c7900600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61367a816130ff565b811461368557600080fd5b50565b61369181613111565b811461369c57600080fd5b50565b6136a88161313d565b81146136b357600080fd5b5056fea26469706673582212200f537608c6ecbb50e4072d21beb35138cc24eedd6b2f94e0fbf6716c71b6e8ca64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,159
0x5e8353930b557a524ff92eace9b87d82f9793124
/** *Submitted for verification at Etherscan.io on 2021-08-10 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /* +++ . . +++ [email protected]++++ . . [email protected]+ [email protected]+. [email protected]++++ .+++ ++++ +++. [email protected]@+ . . . [email protected]@+++ . . . . [email protected][email protected]+ . ++++++ ++++++ [email protected]+ [email protected]+ . ++++ ++++ . . [email protected]+ [email protected]+ . . .+++. .+++. . . . . . . . . . . . . .. .. . . . Project INK Collect generative inkblot art inspired by the Rorschach test. Website: https://project.ink/ Created by sol_dev */ interface Receiver { function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns (bytes4); } contract Metadata { string public name = "Project INK"; string public symbol = "INK"; function contractURI() external pure returns (string memory) { return "https://api.project.ink/metadata"; } function baseTokenURI() public pure returns (string memory) { return "https://api.project.ink/token/metadata/"; } function tokenURI(uint256 _tokenId) external pure returns (string memory) { bytes memory _base = bytes(baseTokenURI()); uint256 _digits = 1; uint256 _n = _tokenId; while (_n > 9) { _n /= 10; _digits++; } bytes memory _uri = new bytes(_base.length + _digits); for (uint256 i = 0; i < _uri.length; i++) { if (i < _base.length) { _uri[i] = _base[i]; } else { uint256 _dec = (_tokenId / (10**(_uri.length - i - 1))) % 10; _uri[i] = bytes1(uint8(_dec) + 48); } } return string(_uri); } } contract ProjectINK { uint256 constant public MAX_NAME_LENGTH = 32; uint256 constant public MAX_SUPPLY = 1921; uint256 constant public MINT_COST = 0.05 ether; struct User { uint256 balance; mapping(uint256 => uint256) list; mapping(address => bool) approved; mapping(uint256 => uint256) indexOf; } struct Token { address owner; address approved; bytes32 seed; string name; } struct Info { uint256 totalSupply; mapping(uint256 => Token) list; mapping(address => User) users; Metadata metadata; address owner; } Info private info; mapping(bytes4 => bool) public supportsInterface; event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); event Mint(address indexed owner, uint256 indexed tokenId, bytes32 seed); event Rename(address indexed owner, uint256 indexed tokenId, string name); modifier _onlyOwner() { require(msg.sender == owner()); _; } constructor() { info.metadata = new Metadata(); info.owner = msg.sender; supportsInterface[0x01ffc9a7] = true; // ERC-165 supportsInterface[0x80ac58cd] = true; // ERC-721 supportsInterface[0x5b5e139f] = true; // Metadata supportsInterface[0x780e9d63] = true; // Enumerable for (uint256 i = 0; i < 10; i++) { _mint(); } } function setOwner(address _owner) external _onlyOwner { info.owner = _owner; } function setMetadata(Metadata _metadata) external _onlyOwner { info.metadata = _metadata; } function ownerWithdraw() external _onlyOwner { uint256 _balance = address(this).balance; require(_balance > 0); payable(msg.sender).transfer(_balance); } receive() external payable { mintMany(msg.value / MINT_COST); } function mint() external payable { mintMany(1); } function mintMany(uint256 _tokens) public payable { require(_tokens > 0); uint256 _cost = _tokens * MINT_COST; require(msg.value >= _cost); for (uint256 i = 0; i < _tokens; i++) { _mint(); } if (msg.value > _cost) { payable(msg.sender).transfer(msg.value - _cost); } } function rename(uint256 _tokenId, string calldata _newName) external { require(bytes(_newName).length <= MAX_NAME_LENGTH); require(msg.sender == ownerOf(_tokenId)); info.list[_tokenId].name = _newName; emit Rename(msg.sender, _tokenId, _newName); } function approve(address _approved, uint256 _tokenId) external { require(msg.sender == ownerOf(_tokenId)); info.list[_tokenId].approved = _approved; emit Approval(msg.sender, _approved, _tokenId); } function setApprovalForAll(address _operator, bool _approved) external { info.users[msg.sender].approved[_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } function transferFrom(address _from, address _to, uint256 _tokenId) external { _transfer(_from, _to, _tokenId); } function safeTransferFrom(address _from, address _to, uint256 _tokenId) external { safeTransferFrom(_from, _to, _tokenId, ""); } function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) public { _transfer(_from, _to, _tokenId); uint32 _size; assembly { _size := extcodesize(_to) } if (_size > 0) { require(Receiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data) == 0x150b7a02); } } function name() external view returns (string memory) { return info.metadata.name(); } function symbol() external view returns (string memory) { return info.metadata.symbol(); } function contractURI() external view returns (string memory) { return info.metadata.contractURI(); } function baseTokenURI() external view returns (string memory) { return info.metadata.baseTokenURI(); } function tokenURI(uint256 _tokenId) external view returns (string memory) { return info.metadata.tokenURI(_tokenId); } function owner() public view returns (address) { return info.owner; } function totalSupply() public view returns (uint256) { return info.totalSupply; } function balanceOf(address _owner) public view returns (uint256) { return info.users[_owner].balance; } function ownerOf(uint256 _tokenId) public view returns (address) { require(_tokenId < totalSupply()); return info.list[_tokenId].owner; } function getApproved(uint256 _tokenId) public view returns (address) { require(_tokenId < totalSupply()); return info.list[_tokenId].approved; } function isApprovedForAll(address _owner, address _operator) public view returns (bool) { return info.users[_owner].approved[_operator]; } function getSeed(uint256 _tokenId) public view returns (bytes32) { require(_tokenId < totalSupply()); return info.list[_tokenId].seed; } function getName(uint256 _tokenId) public view returns (string memory) { require(_tokenId < totalSupply()); return info.list[_tokenId].name; } function tokenByIndex(uint256 _index) public view returns (uint256) { require(_index < totalSupply()); return _index; } function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) { require(_index < balanceOf(_owner)); return info.users[_owner].list[_index]; } function getINK(uint256 _tokenId) public view returns (address tokenOwner, address approved, bytes32 seed, string memory tokenName) { return (ownerOf(_tokenId), getApproved(_tokenId), getSeed(_tokenId), getName(_tokenId)); } function getINKs(uint256[] memory _tokenIds) public view returns (address[] memory owners, address[] memory approveds, bytes32[] memory seeds, bytes32[] memory names) { uint256 _length = _tokenIds.length; owners = new address[](_length); approveds = new address[](_length); seeds = new bytes32[](_length); names = new bytes32[](_length); for (uint256 i = 0; i < _length; i++) { string memory _name; (owners[i], approveds[i], seeds[i], _name) = getINK(_tokenIds[i]); names[i] = _stringToBytes32(_name); } } function getINKsTable(uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory owners, address[] memory approveds, bytes32[] memory seeds, bytes32[] memory names, uint256 totalINKs, uint256 totalPages) { require(_limit > 0); totalINKs = totalSupply(); if (totalINKs > 0) { totalPages = (totalINKs / _limit) + (totalINKs % _limit == 0 ? 0 : 1); require(_page < totalPages); uint256 _offset = _limit * _page; if (_page == totalPages - 1 && totalINKs % _limit != 0) { _limit = totalINKs % _limit; } tokenIds = new uint256[](_limit); for (uint256 i = 0; i < _limit; i++) { tokenIds[i] = tokenByIndex(_isAsc ? _offset + i : totalINKs - _offset - i - 1); } } else { totalPages = 0; tokenIds = new uint256[](0); } (owners, approveds, seeds, names) = getINKs(tokenIds); } function getOwnerINKsTable(address _owner, uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory approveds, bytes32[] memory seeds, bytes32[] memory names, uint256 totalINKs, uint256 totalPages) { require(_limit > 0); totalINKs = balanceOf(_owner); if (totalINKs > 0) { totalPages = (totalINKs / _limit) + (totalINKs % _limit == 0 ? 0 : 1); require(_page < totalPages); uint256 _offset = _limit * _page; if (_page == totalPages - 1 && totalINKs % _limit != 0) { _limit = totalINKs % _limit; } tokenIds = new uint256[](_limit); for (uint256 i = 0; i < _limit; i++) { tokenIds[i] = tokenOfOwnerByIndex(_owner, _isAsc ? _offset + i : totalINKs - _offset - i - 1); } } else { totalPages = 0; tokenIds = new uint256[](0); } ( , approveds, seeds, names) = getINKs(tokenIds); } function allInfoFor(address _owner) external view returns (uint256 supply, uint256 ownerBalance) { return (totalSupply(), balanceOf(_owner)); } function _mint() internal { require(totalSupply() < MAX_SUPPLY); uint256 _tokenId = info.totalSupply++; Token storage _newToken = info.list[_tokenId]; _newToken.owner = msg.sender; bytes32 _seed = keccak256(abi.encodePacked(_tokenId, msg.sender, blockhash(block.number - 1), gasleft())); _newToken.seed = _seed; uint256 _index = info.users[msg.sender].balance++; info.users[msg.sender].indexOf[_tokenId] = _index + 1; info.users[msg.sender].list[_index] = _tokenId; emit Transfer(address(0x0), msg.sender, _tokenId); emit Mint(msg.sender, _tokenId, _seed); } function _transfer(address _from, address _to, uint256 _tokenId) internal { address _owner = ownerOf(_tokenId); address _approved = getApproved(_tokenId); require(_from == _owner); require(msg.sender == _owner || msg.sender == _approved || isApprovedForAll(_owner, msg.sender)); info.list[_tokenId].owner = _to; if (_approved != address(0x0)) { info.list[_tokenId].approved = address(0x0); emit Approval(address(0x0), address(0x0), _tokenId); } uint256 _index = info.users[_from].indexOf[_tokenId] - 1; uint256 _moved = info.users[_from].list[info.users[_from].balance - 1]; info.users[_from].list[_index] = _moved; info.users[_from].indexOf[_moved] = _index + 1; info.users[_from].balance--; delete info.users[_from].indexOf[_tokenId]; uint256 _newIndex = info.users[_to].balance++; info.users[_to].indexOf[_tokenId] = _newIndex + 1; info.users[_to].list[_newIndex] = _tokenId; emit Transfer(_from, _to, _tokenId); } function _stringToBytes32(string memory _in) internal pure returns (bytes32 out) { if (bytes(_in).length == 0) { return 0x0; } assembly { out := mload(add(_in, 32)) } } }
0x6080604052600436106102085760003560e01c806357f6b81211610118578063b88d4fde116100a0578063e0d4ea371161006f578063e0d4ea3714610624578063e8a3d48514610644578063e985e9c514610659578063f3cb8385146106a3578063f452a3ff146106c357600080fd5b8063b88d4fde146105b4578063c662e481146105d4578063c87b56dd146105ef578063d547cfb71461060f57600080fd5b806384810639116100e7578063848106391461051c578063860749851461054c5780638da5cb5b1461056157806395d89b411461057f578063a22cb4651461059457600080fd5b806357f6b812146104715780636352211e146104a65780636b8ff574146104c657806370a08231146104e657600080fd5b806318160ddd1161019b5780633ba607ce1161016a5780633ba607ce146103ca5780633ec2d836146103fc57806342842e0e1461041c5780634311de8f1461043c5780634f6ccce71461045157600080fd5b806318160ddd1461035557806323b872dd146103745780632f745c591461039457806332cb6b0c146103b457600080fd5b8063081812fc116101d7578063081812fc146102d5578063095ea7b31461030d5780631249c58b1461032d57806313af40351461033557600080fd5b806301ffc9a71461022d578063059513a614610272578063066143d01461028057806306fdde03146102b357600080fd5b366102285761022661022166b1a2bc2ec5000034611faf565b6106f3565b005b600080fd5b34801561023957600080fd5b5061025d610248366004611b71565b60056020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b610226610221366004611c22565b34801561028c57600080fd5b506102a061029b366004611cb7565b61078c565b6040516102699796959493929190611e21565b3480156102bf57600080fd5b506102c8610918565b6040516102699190611f2b565b3480156102e157600080fd5b506102f56102f0366004611c22565b61099e565b6040516001600160a01b039091168152602001610269565b34801561031957600080fd5b50610226610328366004611a50565b6109cd565b610226610a51565b34801561034157600080fd5b506102266103503660046118ce565b610a5d565b34801561036157600080fd5b506000545b604051908152602001610269565b34801561038057600080fd5b5061022661038f36600461192b565b610a96565b3480156103a057600080fd5b506103666103af366004611a50565b610aa1565b3480156103c057600080fd5b5061036661078181565b3480156103d657600080fd5b506103ea6103e5366004611a7c565b610af2565b60405161026996959493929190611e99565b34801561040857600080fd5b50610226610417366004611c3b565b610c94565b34801561042857600080fd5b5061022661043736600461192b565b610d2e565b34801561044857600080fd5b50610226610d49565b34801561045d57600080fd5b5061036661046c366004611c22565b610d98565b34801561047d57600080fd5b5061049161048c3660046118ce565b610dab565b60408051928352602083019190915201610269565b3480156104b257600080fd5b506102f56104c1366004611c22565b610dd9565b3480156104d257600080fd5b506102c86104e1366004611c22565b610e04565b3480156104f257600080fd5b506103666105013660046118ce565b6001600160a01b031660009081526002602052604090205490565b34801561052857600080fd5b5061053c610537366004611c22565b610ebb565b6040516102699493929190611d8c565b34801561055857600080fd5b50610366602081565b34801561056d57600080fd5b506004546001600160a01b03166102f5565b34801561058b57600080fd5b506102c8610ef5565b3480156105a057600080fd5b506102266105af366004611a1b565b610f3a565b3480156105c057600080fd5b506102266105cf36600461196c565b610fa7565b3480156105e057600080fd5b5061036666b1a2bc2ec5000081565b3480156105fb57600080fd5b506102c861060a366004611c22565b611067565b34801561061b57600080fd5b506102c86110ee565b34801561063057600080fd5b5061036661063f366004611c22565b611133565b34801561065057600080fd5b506102c8611158565b34801561066557600080fd5b5061025d6106743660046118f2565b6001600160a01b0391821660009081526002602081815260408084209490951683529201909152205460ff1690565b3480156106af57600080fd5b506102266106be3660046118ce565b61119d565b3480156106cf57600080fd5b506106e36106de366004611ac4565b6111d6565b6040516102699493929190611dc9565b6000811161070057600080fd5b600061071366b1a2bc2ec5000083611fc3565b90508034101561072257600080fd5b60005b82811015610747576107356113cf565b8061073f8161207b565b915050610725565b508034111561078857336108fc61075e8334611fe2565b6040518115909202916000818181858888f19350505050158015610786573d6000803e3d6000fd5b505b5050565b606080606080606060008060008a116107a457600080fd5b600054915081156108e7576107b98a83612096565b156107c55760016107c8565b60005b60ff166107d58b84611faf565b6107df9190611f97565b90508089106107ed57600080fd5b60006107f98a8c611fc3565b9050610806600183611fe2565b8a14801561081c57506108198b84612096565b15155b1561082e5761082b8b84612096565b9a505b8a67ffffffffffffffff811115610847576108476120ec565b604051908082528060200260200182016040528015610870578160200160208202803683370190505b50975060005b8b8110156108e0576108b18a6108a7576001826108938588611fe2565b61089d9190611fe2565b61046c9190611fe2565b61046c8284611f97565b8982815181106108c3576108c36120d6565b6020908102919091010152806108d88161207b565b915050610876565b50506108fb565b506040805160008082526020820190925296505b610904876111d6565b999d929c50909a5098509195509350915050565b600354604080516306fdde0360e01b815290516060926001600160a01b0316916306fdde03916004808301926000929190829003018186803b15801561095d57600080fd5b505afa158015610971573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109999190810190611bab565b905090565b6000805482106109ad57600080fd5b50600090815260016020819052604090912001546001600160a01b031690565b6109d681610dd9565b6001600160a01b0316336001600160a01b0316146109f357600080fd5b600081815260016020819052604080832090910180546001600160a01b0319166001600160a01b0386169081179091559051839233917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a45050565b610a5b60016106f3565b565b6004546001600160a01b03163314610a7457600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b61078683838361154b565b6001600160a01b0382166000908152600260205260408120548210610ac557600080fd5b506001600160a01b0391909116600090815260026020908152604080832093835260019093019052205490565b60608060608060008060008911610b0857600080fd5b6001600160a01b038a1660009081526002602052604090205491508115610c6257610b338983612096565b15610b3f576001610b42565b60005b60ff16610b4f8a84611faf565b610b599190611f97565b9050808810610b6757600080fd5b6000610b73898b611fc3565b9050610b80600183611fe2565b89148015610b965750610b938a84612096565b15155b15610ba857610ba58a84612096565b99505b8967ffffffffffffffff811115610bc157610bc16120ec565b604051908082528060200260200182016040528015610bea578160200160208202803683370190505b50965060005b8a811015610c5b57610c2c8c8a610c2257600183610c0e8689611fe2565b610c189190611fe2565b6103af9190611fe2565b6103af8385611f97565b888281518110610c3e57610c3e6120d6565b602090810291909101015280610c538161207b565b915050610bf0565b5050610c76565b506040805160008082526020820190925295505b610c7f866111d6565b989d919c509a50969850919650949350505050565b6020811115610ca257600080fd5b610cab83610dd9565b6001600160a01b0316336001600160a01b031614610cc857600080fd5b6000838152600160205260409020610ce4906003018383611829565b5082336001600160a01b03167f200038820d751f67059d4e34d21526a659b7e2b7141ea1cfd7e1f95e1e0fca608484604051610d21929190611efc565b60405180910390a3505050565b61078683838360405180602001604052806000815250610fa7565b6004546001600160a01b03163314610d6057600080fd5b4780610d6b57600080fd5b604051339082156108fc029083906000818181858888f19350505050158015610788573d6000803e3d6000fd5b600080548210610da757600080fd5b5090565b600080610db760005490565b6001600160a01b03841660009081526002602052604090205491509150915091565b600080548210610de857600080fd5b506000908152600160205260409020546001600160a01b031690565b6060610e0f60005490565b8210610e1a57600080fd5b60008281526001602052604090206003018054610e3690612040565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6290612040565b8015610eaf5780601f10610e8457610100808354040283529160200191610eaf565b820191906000526020600020905b815481529060010190602001808311610e9257829003601f168201915b50505050509050919050565b60008060006060610ecb85610dd9565b610ed48661099e565b610edd87611133565b610ee688610e04565b93509350935093509193509193565b600354604080516395d89b4160e01b815290516060926001600160a01b0316916395d89b41916004808301926000929190829003018186803b15801561095d57600080fd5b3360008181526002602081815260408084206001600160a01b0388168086529301825292839020805460ff191686151590811790915592519283529092917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610fb284848461154b565b823b63ffffffff81161561106057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610ff2903390899088908890600401611d8c565b602060405180830381600087803b15801561100c57600080fd5b505af1158015611020573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110449190611b8e565b6001600160e01b03191663150b7a0260e01b1461106057600080fd5b5050505050565b60035460405163c87b56dd60e01b8152600481018390526060916001600160a01b03169063c87b56dd9060240160006040518083038186803b1580156110ac57600080fd5b505afa1580156110c0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110e89190810190611bab565b92915050565b6003546040805163d547cfb760e01b815290516060926001600160a01b03169163d547cfb7916004808301926000929190829003018186803b15801561095d57600080fd5b60008054821061114257600080fd5b5060009081526001602052604090206002015490565b6003546040805163e8a3d48560e01b815290516060926001600160a01b03169163e8a3d485916004808301926000929190829003018186803b15801561095d57600080fd5b6004546001600160a01b031633146111b457600080fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6060806060806000855190508067ffffffffffffffff8111156111fb576111fb6120ec565b604051908082528060200260200182016040528015611224578160200160208202803683370190505b5094508067ffffffffffffffff811115611240576112406120ec565b604051908082528060200260200182016040528015611269578160200160208202803683370190505b5093508067ffffffffffffffff811115611285576112856120ec565b6040519080825280602002602001820160405280156112ae578160200160208202803683370190505b5092508067ffffffffffffffff8111156112ca576112ca6120ec565b6040519080825280602002602001820160405280156112f3578160200160208202803683370190505b50915060005b818110156113c6576060611325888381518110611318576113186120d6565b6020026020010151610ebb565b8a8681518110611337576113376120d6565b602002602001018a8781518110611350576113506120d6565b602002602001018a8881518110611369576113696120d6565b60209081029190910101939093526001600160a01b0393841690925292909116905290506113968161180d565b8483815181106113a8576113a86120d6565b602090810291909101015250806113be8161207b565b9150506112f9565b50509193509193565b6107816113db60005490565b106113e557600080fd5b6000805481806113f48361207b565b909155506000818152600160208190526040822080546001600160a01b03191633908117825593945092849161142a9043611fe2565b405a604051602001611467949392919093845260609290921b6bffffffffffffffffffffffff191660208401526034830152605482015260740190565b60408051601f198184030181529181528151602092830120600280860182905533600090815293529082208054919350826114a18361207b565b9091555090506114b2816001611f97565b336000818152600260209081526040808320898452600381018352818420959095558583526001909401905282812087905591518692907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4604051828152849033907f3dec94b8abc8f801eaade1616d3aadd3114b556a284267905e0a053b2df398929060200160405180910390a350505050565b600061155682610dd9565b905060006115638361099e565b9050816001600160a01b0316856001600160a01b03161461158357600080fd5b336001600160a01b03831614806115a25750336001600160a01b038216145b806115d257506001600160a01b0382166000908152600260208181526040808420338552909201905290205460ff165b6115db57600080fd5b600083815260016020526040902080546001600160a01b0319166001600160a01b038681169190911790915581161561165c57600083815260016020819052604080832090910180546001600160a01b03191690555184919081907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925908290a45b6001600160a01b038516600090815260026020908152604080832086845260030190915281205461168f90600190611fe2565b6001600160a01b03871660009081526002602052604081208054929350909160019182019183916116c09190611fe2565b815260208082019290925260409081016000908120546001600160a01b038b1682526002845282822086835260019081019094529190208190559150611707908390611f97565b6001600160a01b0388166000818152600260208181526040808420878552600381018352908420959095559282529091528154919061174583612029565b90915550506001600160a01b0380881660009081526002602081815260408084208a85526003018252808420849055938a168352529081208054908261178a8361207b565b90915550905061179b816001611f97565b6001600160a01b0380891660008181526002602090815260408083208c845260038101835281842096909655868352600190950190528381208a90559251899391928c16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45050505050505050565b600081516000141561182157506000919050565b506020015190565b82805461183590612040565b90600052602060002090601f016020900481019282611857576000855561189d565b82601f106118705782800160ff1982351617855561189d565b8280016001018555821561189d579182015b8281111561189d578235825591602001919060010190611882565b50610da79291505b80821115610da757600081556001016118a5565b803580151581146118c957600080fd5b919050565b6000602082840312156118e057600080fd5b81356118eb81612102565b9392505050565b6000806040838503121561190557600080fd5b823561191081612102565b9150602083013561192081612102565b809150509250929050565b60008060006060848603121561194057600080fd5b833561194b81612102565b9250602084013561195b81612102565b929592945050506040919091013590565b6000806000806080858703121561198257600080fd5b843561198d81612102565b9350602085013561199d81612102565b925060408501359150606085013567ffffffffffffffff8111156119c057600080fd5b8501601f810187136119d157600080fd5b80356119e46119df82611f6f565b611f3e565b8181528860208385010111156119f957600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b60008060408385031215611a2e57600080fd5b8235611a3981612102565b9150611a47602084016118b9565b90509250929050565b60008060408385031215611a6357600080fd5b8235611a6e81612102565b946020939093013593505050565b60008060008060808587031215611a9257600080fd5b8435611a9d81612102565b93506020850135925060408501359150611ab9606086016118b9565b905092959194509250565b60006020808385031215611ad757600080fd5b823567ffffffffffffffff80821115611aef57600080fd5b818501915085601f830112611b0357600080fd5b813581811115611b1557611b156120ec565b8060051b9150611b26848301611f3e565b8181528481019084860184860187018a1015611b4157600080fd5b600095505b83861015611b64578035835260019590950194918601918601611b46565b5098975050505050505050565b600060208284031215611b8357600080fd5b81356118eb8161211a565b600060208284031215611ba057600080fd5b81516118eb8161211a565b600060208284031215611bbd57600080fd5b815167ffffffffffffffff811115611bd457600080fd5b8201601f81018413611be557600080fd5b8051611bf36119df82611f6f565b818152856020838501011115611c0857600080fd5b611c19826020830160208601611ff9565b95945050505050565b600060208284031215611c3457600080fd5b5035919050565b600080600060408486031215611c5057600080fd5b83359250602084013567ffffffffffffffff80821115611c6f57600080fd5b818601915086601f830112611c8357600080fd5b813581811115611c9257600080fd5b876020828501011115611ca457600080fd5b6020830194508093505050509250925092565b600080600060608486031215611ccc57600080fd5b8335925060208401359150611ce3604085016118b9565b90509250925092565b600081518084526020808501945080840160005b83811015611d255781516001600160a01b031687529582019590820190600101611d00565b509495945050505050565b600081518084526020808501945080840160005b83811015611d2557815187529582019590820190600101611d44565b60008151808452611d78816020860160208601611ff9565b601f01601f19169290920160200192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611dbf90830184611d60565b9695505050505050565b608081526000611ddc6080830187611cec565b8281036020840152611dee8187611cec565b90508281036040840152611e028186611d30565b90508281036060840152611e168185611d30565b979650505050505050565b60e081526000611e3460e083018a611d30565b8281036020840152611e46818a611cec565b90508281036040840152611e5a8189611cec565b90508281036060840152611e6e8188611d30565b90508281036080840152611e828187611d30565b60a0840195909552505060c0015295945050505050565b60c081526000611eac60c0830189611d30565b8281036020840152611ebe8189611cec565b90508281036040840152611ed28188611d30565b90508281036060840152611ee68187611d30565b6080840195909552505060a00152949350505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6020815260006118eb6020830184611d60565b604051601f8201601f1916810167ffffffffffffffff81118282101715611f6757611f676120ec565b604052919050565b600067ffffffffffffffff821115611f8957611f896120ec565b50601f01601f191660200190565b60008219821115611faa57611faa6120aa565b500190565b600082611fbe57611fbe6120c0565b500490565b6000816000190483118215151615611fdd57611fdd6120aa565b500290565b600082821015611ff457611ff46120aa565b500390565b60005b83811015612014578181015183820152602001611ffc565b83811115612023576000848401525b50505050565b600081612038576120386120aa565b506000190190565b600181811c9082168061205457607f821691505b6020821081141561207557634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561208f5761208f6120aa565b5060010190565b6000826120a5576120a56120c0565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461211757600080fd5b50565b6001600160e01b03198116811461211757600080fdfea2646970667358221220b651b5c5d11f91918e40170f939f00ff225783fb0323472e608943a1fc72710d64736f6c63430008060033
{"success": true, "error": null, "results": {}}
2,160
0xba4a3ee72f79f0314525f76c4c6ee650b88026ae
/** *Submitted for verification at Etherscan.io on 2022-02-11 */ /* ZelenskyInu https://t.me/ZelenskyInu */ // 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 ZelenskyInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ZelenskyInu"; string private constant _symbol = "ZelenskyInu"; 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(0xc1B9a4408f5043655267a883bA4c7b33b9d4eBAF); address payable private _marketingAddress = payable(0xc3bEcc44120ec07D5B288E02229CD2f49047d6FD); 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610527578063dd62ed3e14610547578063ea1644d51461058d578063f2fde38b146105ad57600080fd5b8063a2a957bb146104a2578063a9059cbb146104c2578063bfd79284146104e2578063c3c8cd801461051257600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b41146101fe57806398a5c3151461048257600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611aaf565b6105cd565b005b34801561020a57600080fd5b50604080518082018252600b81526a5a656c656e736b79496e7560a81b602082015290516102389190611b74565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611bc9565b61066c565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50683635c9adc5dea000005b604051908152602001610238565b3480156102db57600080fd5b506102616102ea366004611bf5565b610683565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610238565b34801561032d57600080fd5b50601554610291906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611c36565b6106ec565b34801561036d57600080fd5b506101fc61037c366004611c63565b610737565b34801561038d57600080fd5b506101fc61077f565b3480156103a257600080fd5b506102c16103b1366004611c36565b6107ca565b3480156103c257600080fd5b506101fc6107ec565b3480156103d757600080fd5b506101fc6103e6366004611c7e565b610860565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611c36565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610291565b34801561045857600080fd5b506101fc610467366004611c63565b61089f565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506101fc61049d366004611c7e565b6108e7565b3480156104ae57600080fd5b506101fc6104bd366004611c97565b610916565b3480156104ce57600080fd5b506102616104dd366004611bc9565b610acc565b3480156104ee57600080fd5b506102616104fd366004611c36565b60106020526000908152604090205460ff1681565b34801561051e57600080fd5b506101fc610ad9565b34801561053357600080fd5b506101fc610542366004611cc9565b610b2d565b34801561055357600080fd5b506102c1610562366004611d4d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059957600080fd5b506101fc6105a8366004611c7e565b610bce565b3480156105b957600080fd5b506101fc6105c8366004611c36565b610bfd565b6000546001600160a01b031633146106005760405162461bcd60e51b81526004016105f790611d86565b60405180910390fd5b60005b81518110156106685760016010600084848151811061062457610624611dbb565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066081611de7565b915050610603565b5050565b6000610679338484610ce7565b5060015b92915050565b6000610690848484610e0b565b6106e284336106dd85604051806060016040528060288152602001611eff602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611347565b610ce7565b5060019392505050565b6000546001600160a01b031633146107165760405162461bcd60e51b81526004016105f790611d86565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107615760405162461bcd60e51b81526004016105f790611d86565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b457506013546001600160a01b0316336001600160a01b0316145b6107bd57600080fd5b476107c781611381565b50565b6001600160a01b03811660009081526002602052604081205461067d906113bb565b6000546001600160a01b031633146108165760405162461bcd60e51b81526004016105f790611d86565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088a5760405162461bcd60e51b81526004016105f790611d86565b674563918244f400008111156107c757601655565b6000546001600160a01b031633146108c95760405162461bcd60e51b81526004016105f790611d86565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109115760405162461bcd60e51b81526004016105f790611d86565b601855565b6000546001600160a01b031633146109405760405162461bcd60e51b81526004016105f790611d86565b600484111561099f5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420322560d81b60648201526084016105f7565b600e8211156109fb5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642031604482015261342560f01b60648201526084016105f7565b6004831115610a5b5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420322560d01b60648201526084016105f7565b600e811115610ab85760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526231342560e81b60648201526084016105f7565b600893909355600a91909155600955600b55565b6000610679338484610e0b565b6012546001600160a01b0316336001600160a01b03161480610b0e57506013546001600160a01b0316336001600160a01b0316145b610b1757600080fd5b6000610b22306107ca565b90506107c78161143f565b6000546001600160a01b03163314610b575760405162461bcd60e51b81526004016105f790611d86565b60005b82811015610bc8578160056000868685818110610b7957610b79611dbb565b9050602002016020810190610b8e9190611c36565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bc081611de7565b915050610b5a565b50505050565b6000546001600160a01b03163314610bf85760405162461bcd60e51b81526004016105f790611d86565b601755565b6000546001600160a01b03163314610c275760405162461bcd60e51b81526004016105f790611d86565b6001600160a01b038116610c8c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f7565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d495760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f7565b6001600160a01b038216610daa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e6f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f7565b6001600160a01b038216610ed15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f7565b60008111610f335760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f7565b6000546001600160a01b03848116911614801590610f5f57506000546001600160a01b03838116911614155b1561124057601554600160a01b900460ff16610ff8576000546001600160a01b03848116911614610ff85760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f7565b60165481111561104a5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f7565b6001600160a01b03831660009081526010602052604090205460ff1615801561108c57506001600160a01b03821660009081526010602052604090205460ff16155b6110e45760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f7565b6015546001600160a01b038381169116146111695760175481611106846107ca565b6111109190611e00565b106111695760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f7565b6000611174306107ca565b60185460165491925082101590821061118d5760165491505b8080156111a45750601554600160a81b900460ff16155b80156111be57506015546001600160a01b03868116911614155b80156111d35750601554600160b01b900460ff165b80156111f857506001600160a01b03851660009081526005602052604090205460ff16155b801561121d57506001600160a01b03841660009081526005602052604090205460ff16155b1561123d5761122b8261143f565b47801561123b5761123b47611381565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061128257506001600160a01b03831660009081526005602052604090205460ff165b806112b457506015546001600160a01b038581169116148015906112b457506015546001600160a01b03848116911614155b156112c15750600061133b565b6015546001600160a01b0385811691161480156112ec57506014546001600160a01b03848116911614155b156112fe57600854600c55600954600d555b6015546001600160a01b03848116911614801561132957506014546001600160a01b03858116911614155b1561133b57600a54600c55600b54600d555b610bc8848484846115b9565b6000818484111561136b5760405162461bcd60e51b81526004016105f79190611b74565b5060006113788486611e18565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610668573d6000803e3d6000fd5b60006006548211156114225760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f7565b600061142c6115e7565b9050611438838261160a565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148757611487611dbb565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115049190611e2f565b8160018151811061151757611517611dbb565b6001600160a01b03928316602091820292909201015260145461153d9130911684610ce7565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611576908590600090869030904290600401611e4c565b600060405180830381600087803b15801561159057600080fd5b505af11580156115a4573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115c6576115c661164c565b6115d184848461167a565b80610bc857610bc8600e54600c55600f54600d55565b60008060006115f4611771565b9092509050611603828261160a565b9250505090565b600061143883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117b3565b600c5415801561165c5750600d54155b1561166357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061168c876117e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116be908761183e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116ed9086611880565b6001600160a01b03891660009081526002602052604090205561170f816118df565b6117198483611929565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161175e91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061178d828261160a565b8210156117aa57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117d45760405162461bcd60e51b81526004016105f79190611b74565b5060006113788486611ebd565b60008060008060008060008060006117fe8a600c54600d5461194d565b925092509250600061180e6115e7565b905060008060006118218e8787876119a2565b919e509c509a509598509396509194505050505091939550919395565b600061143883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611347565b60008061188d8385611e00565b9050838110156114385760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f7565b60006118e96115e7565b905060006118f783836119f2565b306000908152600260205260409020549091506119149082611880565b30600090815260026020526040902055505050565b600654611936908361183e565b6006556007546119469082611880565b6007555050565b6000808080611967606461196189896119f2565b9061160a565b9050600061197a60646119618a896119f2565b905060006119928261198c8b8661183e565b9061183e565b9992985090965090945050505050565b60008080806119b188866119f2565b905060006119bf88876119f2565b905060006119cd88886119f2565b905060006119df8261198c868661183e565b939b939a50919850919650505050505050565b600082600003611a045750600061067d565b6000611a108385611edf565b905082611a1d8583611ebd565b146114385760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f7565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c757600080fd5b8035611aaa81611a8a565b919050565b60006020808385031215611ac257600080fd5b823567ffffffffffffffff80821115611ada57600080fd5b818501915085601f830112611aee57600080fd5b813581811115611b0057611b00611a74565b8060051b604051601f19603f83011681018181108582111715611b2557611b25611a74565b604052918252848201925083810185019188831115611b4357600080fd5b938501935b82851015611b6857611b5985611a9f565b84529385019392850192611b48565b98975050505050505050565b600060208083528351808285015260005b81811015611ba157858101830151858201604001528201611b85565b81811115611bb3576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bdc57600080fd5b8235611be781611a8a565b946020939093013593505050565b600080600060608486031215611c0a57600080fd5b8335611c1581611a8a565b92506020840135611c2581611a8a565b929592945050506040919091013590565b600060208284031215611c4857600080fd5b813561143881611a8a565b80358015158114611aaa57600080fd5b600060208284031215611c7557600080fd5b61143882611c53565b600060208284031215611c9057600080fd5b5035919050565b60008060008060808587031215611cad57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cde57600080fd5b833567ffffffffffffffff80821115611cf657600080fd5b818601915086601f830112611d0a57600080fd5b813581811115611d1957600080fd5b8760208260051b8501011115611d2e57600080fd5b602092830195509350611d449186019050611c53565b90509250925092565b60008060408385031215611d6057600080fd5b8235611d6b81611a8a565b91506020830135611d7b81611a8a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611df957611df9611dd1565b5060010190565b60008219821115611e1357611e13611dd1565b500190565b600082821015611e2a57611e2a611dd1565b500390565b600060208284031215611e4157600080fd5b815161143881611a8a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e9c5784516001600160a01b031683529383019391830191600101611e77565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611eda57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ef957611ef9611dd1565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bb895af76f5d33b2ffaee45fdd2bb82ff8ad442222d92dcc516356444670df3a64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
2,161
0xda3B4F6F9e0406978e71aF3432D855fd9600dAeF
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract GorillaGlueInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "GorillaGlueInu"; string private constant _symbol = "GGI"; 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 = 4; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 5000000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _Marketingfund; address payable private _Deployer; address payable private _devWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable devFundAddr, address payable devfeeAddr, address payable depAddr) { _Marketingfund = devFundAddr; _Deployer = depAddr; _devWalletAddress = devfeeAddr; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_Marketingfund] = true; _isExcludedFromFee[_devWalletAddress] = 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 = 4; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } if(from != address(this)){ require(amount <= _maxTxAmount); } require(!bots[from] && !bots[to] && !bots[msg.sender]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } // This is done to prevent the taxes from filling up in the router since compiled taxes emptying can impact the chart. // This reduces the impact of taxes on the chart. uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { // We need to swap the current tokens to ETH and send to the team wallet swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _Marketingfund.transfer(amount.div(6).mul(4)); _devWalletAddress.transfer(amount.div(6).mul(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 25000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Deployer); swapEnabled = enabled; } function manualswap() external { require(_msgSender() == _Deployer); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _Deployer); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public { require(_msgSender() == _Deployer); for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public { require(_msgSender() == _Deployer); 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 { require(_msgSender() == _Deployer); require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external { require(_msgSender() == _Deployer); require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setTeamFee(uint256 teamFee) external { require(_msgSender() == _Deployer); require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25'); _teamFee = teamFee; } }
0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063cba0e9961161006f578063cba0e9961461044f578063d00efb2f1461048c578063d543dbeb146104b7578063dd62ed3e146104e0578063e01af92c1461051d578063e47d60601461054657610156565b806395d89b4114610367578063a9059cbb14610392578063b515566a146103cf578063c0e6b46e146103f8578063c3c8cd8014610421578063c9567bf91461043857610156565b8063313ce56711610108578063313ce5671461027d5780635932ead1146102a85780636fc3eaec146102d157806370a08231146102e8578063715018a6146103255780638da5cb5b1461033c57610156565b806306fdde031461015b578063095ea7b31461018657806318160ddd146101c357806323b872dd146101ee578063273123b71461022b578063286671621461025457610156565b3661015657005b600080fd5b34801561016757600080fd5b50610170610583565b60405161017d91906133c5565b60405180910390f35b34801561019257600080fd5b506101ad60048036038101906101a89190612ec5565b6105c0565b6040516101ba91906133aa565b60405180910390f35b3480156101cf57600080fd5b506101d86105de565b6040516101e59190613587565b60405180910390f35b3480156101fa57600080fd5b5061021560048036038101906102109190612e76565b6105ef565b60405161022291906133aa565b60405180910390f35b34801561023757600080fd5b50610252600480360381019061024d9190612de8565b6106c8565b005b34801561026057600080fd5b5061027b60048036038101906102769190612f94565b610784565b005b34801561028957600080fd5b50610292610840565b60405161029f91906135fc565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca9190612f42565b610849565b005b3480156102dd57600080fd5b506102e66108fb565b005b3480156102f457600080fd5b5061030f600480360381019061030a9190612de8565b61096d565b60405161031c9190613587565b60405180910390f35b34801561033157600080fd5b5061033a6109be565b005b34801561034857600080fd5b50610351610b11565b60405161035e91906132dc565b60405180910390f35b34801561037357600080fd5b5061037c610b3a565b60405161038991906133c5565b60405180910390f35b34801561039e57600080fd5b506103b960048036038101906103b49190612ec5565b610b77565b6040516103c691906133aa565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190612f01565b610b95565b005b34801561040457600080fd5b5061041f600480360381019061041a9190612f94565b610cb1565b005b34801561042d57600080fd5b50610436610d8e565b005b34801561044457600080fd5b5061044d610e08565b005b34801561045b57600080fd5b5061047660048036038101906104719190612de8565b61136c565b60405161048391906133aa565b60405180910390f35b34801561049857600080fd5b506104a16113c2565b6040516104ae9190613587565b60405180910390f35b3480156104c357600080fd5b506104de60048036038101906104d99190612f94565b6113c8565b005b3480156104ec57600080fd5b5061050760048036038101906105029190612e3a565b6114dd565b6040516105149190613587565b60405180910390f35b34801561052957600080fd5b50610544600480360381019061053f9190612f42565b611564565b005b34801561055257600080fd5b5061056d60048036038101906105689190612de8565b6115e2565b60405161057a91906133aa565b60405180910390f35b60606040518060400160405280600e81526020017f476f72696c6c61476c7565496e75000000000000000000000000000000000000815250905090565b60006105d46105cd611638565b8484611640565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105fc84848461180b565b6106bd84610608611638565b6106b885604051806060016040528060288152602001613ce960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061066e611638565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120d19092919063ffffffff16565b611640565b600190509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610709611638565b73ffffffffffffffffffffffffffffffffffffffff161461072957600080fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c5611638565b73ffffffffffffffffffffffffffffffffffffffff16146107e557600080fd5b600181101580156107f7575060198111155b610836576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082d90613447565b60405180910390fd5b8060098190555050565b60006009905090565b610851611638565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d5906134c7565b60405180910390fd5b80601260176101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661093c611638565b73ffffffffffffffffffffffffffffffffffffffff161461095c57600080fd5b600047905061096a81612135565b50565b60006109b7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612256565b9050919050565b6109c6611638565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4a906134c7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4747490000000000000000000000000000000000000000000000000000000000815250905090565b6000610b8b610b84611638565b848461180b565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd6611638565b73ffffffffffffffffffffffffffffffffffffffff1614610bf657600080fd5b60005b8151811015610cad576001600c6000848481518110610c41577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ca59061389d565b915050610bf9565b5050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cf2611638565b73ffffffffffffffffffffffffffffffffffffffff1614610d1257600080fd5b60008111610d55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4c90613487565b60405180910390fd5b610d85612710610d7783683635c9adc5dea000006122c490919063ffffffff16565b61233f90919063ffffffff16565b600b8190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dcf611638565b73ffffffffffffffffffffffffffffffffffffffff1614610def57600080fd5b6000610dfa3061096d565b9050610e0581612389565b50565b610e10611638565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e94906134c7565b60405180910390fd5b601260149054906101000a900460ff1615610eed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee490613547565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7d30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611640565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc357600080fd5b505afa158015610fd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffb9190612e11565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105d57600080fd5b505afa158015611071573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110959190612e11565b6040518363ffffffff1660e01b81526004016110b29291906132f7565b602060405180830381600087803b1580156110cc57600080fd5b505af11580156110e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111049190612e11565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118d3061096d565b600080611198610b11565b426040518863ffffffff1660e01b81526004016111ba96959493929190613349565b6060604051808303818588803b1580156111d357600080fd5b505af11580156111e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120c9190612fbd565b5050506001601260166101000a81548160ff0219169083151502179055506000601260176101000a81548160ff02191690831515021790555068015af1d78b58c40000601381905550436014819055506001601260146101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611316929190613320565b602060405180830381600087803b15801561133057600080fd5b505af1158015611344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113689190612f6b565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60145481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611409611638565b73ffffffffffffffffffffffffffffffffffffffff161461142957600080fd5b6000811161146c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146390613487565b60405180910390fd5b61149b606461148d83683635c9adc5dea000006122c490919063ffffffff16565b61233f90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6013546040516114d29190613587565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115a5611638565b73ffffffffffffffffffffffffffffffffffffffff16146115c557600080fd5b80601260166101000a81548160ff02191690831515021790555050565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a790613527565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611720576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171790613427565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117fe9190613587565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561187b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187290613507565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e2906133e7565b60405180910390fd5b6000811161192e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611925906134e7565b60405180910390fd5b611936610b11565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119a45750611974610b11565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561200e57601260179054906101000a900460ff1615611bd7573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a2657503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a805750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ada5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611bd657601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b20611638565b73ffffffffffffffffffffffffffffffffffffffff161480611b965750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b7e611638565b73ffffffffffffffffffffffffffffffffffffffff16145b611bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bcc90613567565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611c1a57601354811115611c1957600080fd5b5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cbe5750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d145750600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d1d57600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611dc85750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611e365750601260179054906101000a900460ff165b15611ed75742600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611e8657600080fd5b600f42611e9391906136bd565b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ee23061096d565b9050600b548110611ef357600b5490505b6000600a548210159050601260159054906101000a900460ff16158015611f265750601260169054906101000a900460ff165b8015611f2f5750805b8015611f895750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611fe35750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b1561200b57611ff182612389565b600047905060008111156120095761200847612135565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120b55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156120bf57600090505b6120cb84848484612683565b50505050565b6000838311158290612119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211091906133c5565b60405180910390fd5b5060008385612128919061379e565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612198600461218a60068661233f90919063ffffffff16565b6122c490919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121c3573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612227600261221960068661233f90919063ffffffff16565b6122c490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612252573d6000803e3d6000fd5b5050565b600060065482111561229d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229490613407565b60405180910390fd5b60006122a76126b0565b90506122bc818461233f90919063ffffffff16565b915050919050565b6000808314156122d75760009050612339565b600082846122e59190613744565b90508284826122f49190613713565b14612334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161232b906134a7565b60405180910390fd5b809150505b92915050565b600061238183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126db565b905092915050565b6001601260156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156124155781602001602082028036833780820191505090505b5090503081600081518110612453577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124f557600080fd5b505afa158015612509573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061252d9190612e11565b81600181518110612567577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506125ce30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611640565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126329594939291906135a2565b600060405180830381600087803b15801561264c57600080fd5b505af1158015612660573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b806126915761269061273e565b5b61269c84848461276f565b806126aa576126a961293a565b5b50505050565b60008060006126bd61294c565b915091506126d4818361233f90919063ffffffff16565b9250505090565b60008083118290612722576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161271991906133c5565b60405180910390fd5b50600083856127319190613713565b9050809150509392505050565b600060085414801561275257506000600954145b1561275c5761276d565b600060088190555060006009819055505b565b600080600080600080612781876129ae565b9550955095509550955095506127df86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128c081612abe565b6128ca8483612b7b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129279190613587565b60405180910390a3505050505050505050565b60056008819055506004600981905550565b600080600060065490506000683635c9adc5dea000009050612982683635c9adc5dea0000060065461233f90919063ffffffff16565b8210156129a157600654683635c9adc5dea000009350935050506129aa565b81819350935050505b9091565b60008060008060008060008060006129cb8a600854600954612bb5565b92509250925060006129db6126b0565b905060008060006129ee8e878787612c4b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a5883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120d1565b905092915050565b6000808284612a6f91906136bd565b905083811015612ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aab90613467565b60405180910390fd5b8091505092915050565b6000612ac86126b0565b90506000612adf82846122c490919063ffffffff16565b9050612b3381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b9082600654612a1690919063ffffffff16565b600681905550612bab81600754612a6090919063ffffffff16565b6007819055505050565b600080600080612be16064612bd3888a6122c490919063ffffffff16565b61233f90919063ffffffff16565b90506000612c0b6064612bfd888b6122c490919063ffffffff16565b61233f90919063ffffffff16565b90506000612c3482612c26858c612a1690919063ffffffff16565b612a1690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c6485896122c490919063ffffffff16565b90506000612c7b86896122c490919063ffffffff16565b90506000612c9287896122c490919063ffffffff16565b90506000612cbb82612cad8587612a1690919063ffffffff16565b612a1690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612ce7612ce28461363c565b613617565b90508083825260208201905082856020860282011115612d0657600080fd5b60005b85811015612d365781612d1c8882612d40565b845260208401935060208301925050600181019050612d09565b5050509392505050565b600081359050612d4f81613ca3565b92915050565b600081519050612d6481613ca3565b92915050565b600082601f830112612d7b57600080fd5b8135612d8b848260208601612cd4565b91505092915050565b600081359050612da381613cba565b92915050565b600081519050612db881613cba565b92915050565b600081359050612dcd81613cd1565b92915050565b600081519050612de281613cd1565b92915050565b600060208284031215612dfa57600080fd5b6000612e0884828501612d40565b91505092915050565b600060208284031215612e2357600080fd5b6000612e3184828501612d55565b91505092915050565b60008060408385031215612e4d57600080fd5b6000612e5b85828601612d40565b9250506020612e6c85828601612d40565b9150509250929050565b600080600060608486031215612e8b57600080fd5b6000612e9986828701612d40565b9350506020612eaa86828701612d40565b9250506040612ebb86828701612dbe565b9150509250925092565b60008060408385031215612ed857600080fd5b6000612ee685828601612d40565b9250506020612ef785828601612dbe565b9150509250929050565b600060208284031215612f1357600080fd5b600082013567ffffffffffffffff811115612f2d57600080fd5b612f3984828501612d6a565b91505092915050565b600060208284031215612f5457600080fd5b6000612f6284828501612d94565b91505092915050565b600060208284031215612f7d57600080fd5b6000612f8b84828501612da9565b91505092915050565b600060208284031215612fa657600080fd5b6000612fb484828501612dbe565b91505092915050565b600080600060608486031215612fd257600080fd5b6000612fe086828701612dd3565b9350506020612ff186828701612dd3565b925050604061300286828701612dd3565b9150509250925092565b60006130188383613024565b60208301905092915050565b61302d816137d2565b82525050565b61303c816137d2565b82525050565b600061304d82613678565b613057818561369b565b935061306283613668565b8060005b8381101561309357815161307a888261300c565b97506130858361368e565b925050600181019050613066565b5085935050505092915050565b6130a9816137e4565b82525050565b6130b881613827565b82525050565b60006130c982613683565b6130d381856136ac565b93506130e3818560208601613839565b6130ec81613973565b840191505092915050565b60006131046023836136ac565b915061310f82613984565b604082019050919050565b6000613127602a836136ac565b9150613132826139d3565b604082019050919050565b600061314a6022836136ac565b915061315582613a22565b604082019050919050565b600061316d601b836136ac565b915061317882613a71565b602082019050919050565b6000613190601b836136ac565b915061319b82613a9a565b602082019050919050565b60006131b3601d836136ac565b91506131be82613ac3565b602082019050919050565b60006131d66021836136ac565b91506131e182613aec565b604082019050919050565b60006131f96020836136ac565b915061320482613b3b565b602082019050919050565b600061321c6029836136ac565b915061322782613b64565b604082019050919050565b600061323f6025836136ac565b915061324a82613bb3565b604082019050919050565b60006132626024836136ac565b915061326d82613c02565b604082019050919050565b60006132856017836136ac565b915061329082613c51565b602082019050919050565b60006132a86011836136ac565b91506132b382613c7a565b602082019050919050565b6132c781613810565b82525050565b6132d68161381a565b82525050565b60006020820190506132f16000830184613033565b92915050565b600060408201905061330c6000830185613033565b6133196020830184613033565b9392505050565b60006040820190506133356000830185613033565b61334260208301846132be565b9392505050565b600060c08201905061335e6000830189613033565b61336b60208301886132be565b61337860408301876130af565b61338560608301866130af565b6133926080830185613033565b61339f60a08301846132be565b979650505050505050565b60006020820190506133bf60008301846130a0565b92915050565b600060208201905081810360008301526133df81846130be565b905092915050565b60006020820190508181036000830152613400816130f7565b9050919050565b600060208201905081810360008301526134208161311a565b9050919050565b600060208201905081810360008301526134408161313d565b9050919050565b6000602082019050818103600083015261346081613160565b9050919050565b6000602082019050818103600083015261348081613183565b9050919050565b600060208201905081810360008301526134a0816131a6565b9050919050565b600060208201905081810360008301526134c0816131c9565b9050919050565b600060208201905081810360008301526134e0816131ec565b9050919050565b600060208201905081810360008301526135008161320f565b9050919050565b6000602082019050818103600083015261352081613232565b9050919050565b6000602082019050818103600083015261354081613255565b9050919050565b6000602082019050818103600083015261356081613278565b9050919050565b600060208201905081810360008301526135808161329b565b9050919050565b600060208201905061359c60008301846132be565b92915050565b600060a0820190506135b760008301886132be565b6135c460208301876130af565b81810360408301526135d68186613042565b90506135e56060830185613033565b6135f260808301846132be565b9695505050505050565b600060208201905061361160008301846132cd565b92915050565b6000613621613632565b905061362d828261386c565b919050565b6000604051905090565b600067ffffffffffffffff82111561365757613656613944565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136c882613810565b91506136d383613810565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613708576137076138e6565b5b828201905092915050565b600061371e82613810565b915061372983613810565b92508261373957613738613915565b5b828204905092915050565b600061374f82613810565b915061375a83613810565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613793576137926138e6565b5b828202905092915050565b60006137a982613810565b91506137b483613810565b9250828210156137c7576137c66138e6565b5b828203905092915050565b60006137dd826137f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061383282613810565b9050919050565b60005b8381101561385757808201518184015260208101905061383c565b83811115613866576000848401525b50505050565b61387582613973565b810181811067ffffffffffffffff8211171561389457613893613944565b5b80604052505050565b60006138a882613810565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138db576138da6138e6565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f7465616d4665652073686f756c6420626520696e2031202d2032350000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613cac816137d2565b8114613cb757600080fd5b50565b613cc3816137e4565b8114613cce57600080fd5b50565b613cda81613810565b8114613ce557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202c79b08f133979281c865ff1e896d648d6d7cea238cf238fb633c8b02387e3f064736f6c63430008040033
{"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"}]}}
2,162
0xca3d09be2b8daa0579d8872c647d8cf693da7fda
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract multiowned { // TYPES // struct for the status of a pending operation. struct PendingState { uint yetNeeded; uint ownersDone; uint index; } // EVENTS // this contract only has five types of events: it can accept a confirmation, in which case // we record owner and operation (hash) alongside it. event Confirmation(address owner, bytes32 operation); event Revoke(address owner, bytes32 operation); // some others are in the case of an owner changing. event OwnerChanged(address oldOwner, address newOwner); event OwnerAdded(address newOwner); event OwnerRemoved(address oldOwner); // the last one is emitted if the required signatures change event RequirementChanged(uint newRequirement); // MODIFIERS // simple single-sig function modifier. modifier onlyowner { if (isOwner(msg.sender)) _; } // multi-sig function modifier: the operation must have an intrinsic hash in order // that later attempts can be realised as the same underlying operation and // thus count as confirmations. modifier onlymanyowners(bytes32 _operation) { if (confirmAndCheck(_operation)) _; } // METHODS // constructor is given number of sigs required to do protected "onlymanyowners" transactions // as well as the selection of addresses capable of confirming them. constructor(address[] _owners, uint _required) public { m_numOwners = _owners.length;// + 1; //m_owners[1] = uint(msg.sender); //m_ownerIndex[uint(msg.sender)] = 1; for (uint i = 0; i < _owners.length; ++i) { m_owners[1 + i] = uint(_owners[i]); m_ownerIndex[uint(_owners[i])] = 1 + i; } m_required = _required; } // Revokes a prior confirmation of the given operation function revoke(bytes32 _operation) external { uint ownerIndex = m_ownerIndex[uint(msg.sender)]; // make sure they're an owner if (ownerIndex == 0) return; uint ownerIndexBit = 2**ownerIndex; PendingState storage pending = m_pending[_operation]; if (pending.ownersDone & ownerIndexBit > 0) { pending.yetNeeded++; pending.ownersDone -= ownerIndexBit; emit Revoke(msg.sender, _operation); } } // Replaces an owner `_from` with another `_to`. function changeOwner(address _from, address _to) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external { if (isOwner(_to)) return; uint ownerIndex = m_ownerIndex[uint(_from)]; if (ownerIndex == 0) return; clearPending(); m_owners[ownerIndex] = uint(_to); m_ownerIndex[uint(_from)] = 0; m_ownerIndex[uint(_to)] = ownerIndex; emit OwnerChanged(_from, _to); } function addOwner(address _owner) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external { if (isOwner(_owner)) return; clearPending(); if (m_numOwners >= c_maxOwners) reorganizeOwners(); if (m_numOwners >= c_maxOwners) return; m_numOwners++; m_owners[m_numOwners] = uint(_owner); m_ownerIndex[uint(_owner)] = m_numOwners; emit OwnerAdded(_owner); } function removeOwner(address _owner) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external { uint ownerIndex = m_ownerIndex[uint(_owner)]; if (ownerIndex == 0) return; if (m_required > m_numOwners - 1) return; m_owners[ownerIndex] = 0; m_ownerIndex[uint(_owner)] = 0; clearPending(); reorganizeOwners(); //make sure m_numOwner is equal to the number of owners and always points to the optimal free slot emit OwnerRemoved(_owner); } function changeRequirement(uint _newRequired) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external { if (_newRequired > m_numOwners) return; m_required = _newRequired; clearPending(); emit RequirementChanged(_newRequired); } function isOwner(address _addr) public view returns (bool) { return m_ownerIndex[uint(_addr)] > 0; } function hasConfirmed(bytes32 _operation, address _owner) public view returns (bool) { PendingState storage pending = m_pending[_operation]; uint ownerIndex = m_ownerIndex[uint(_owner)]; // make sure they're an owner if (ownerIndex == 0) return false; // determine the bit to set for this owner. uint ownerIndexBit = 2**ownerIndex; if (pending.ownersDone & ownerIndexBit == 0) { return false; } else { return true; } } // INTERNAL METHODS function confirmAndCheck(bytes32 _operation) internal returns (bool) { // determine what index the present sender is: uint ownerIndex = m_ownerIndex[uint(msg.sender)]; // make sure they're an owner if (ownerIndex == 0) return; PendingState storage pending = m_pending[_operation]; // if we're not yet working on this operation, switch over and reset the confirmation status. if (pending.yetNeeded == 0) { // reset count of confirmations needed. pending.yetNeeded = m_required; // reset which owners have confirmed (none) - set our bitmap to 0. pending.ownersDone = 0; pending.index = m_pendingIndex.length++; m_pendingIndex[pending.index] = _operation; } // determine the bit to set for this owner. uint ownerIndexBit = 2**ownerIndex; // make sure we (the message sender) haven't confirmed this operation previously. if (pending.ownersDone & ownerIndexBit == 0) { emit Confirmation(msg.sender, _operation); // ok - check if count is enough to go ahead. if (pending.yetNeeded <= 1) { // enough confirmations: reset and run interior. delete m_pendingIndex[m_pending[_operation].index]; delete m_pending[_operation]; return true; } else { // not enough: record that this owner in particular confirmed. pending.yetNeeded--; pending.ownersDone |= ownerIndexBit; } } } function reorganizeOwners() private returns (bool) { uint free = 1; while (free < m_numOwners) { while (free < m_numOwners && m_owners[free] != 0) free++; while (m_numOwners > 1 && m_owners[m_numOwners] == 0) m_numOwners--; if (free < m_numOwners && m_owners[m_numOwners] != 0 && m_owners[free] == 0) { m_owners[free] = m_owners[m_numOwners]; m_ownerIndex[m_owners[free]] = free; m_owners[m_numOwners] = 0; } } } function clearPending() internal { uint length = m_pendingIndex.length; for (uint i = 0; i < length; ++i) { if (m_pendingIndex[i] != 0) { delete m_pending[m_pendingIndex[i]]; } } delete m_pendingIndex; } // FIELDS // the number of owners that must confirm the same operation before it is run. uint public m_required; // pointer used to find a free slot in m_owners uint public m_numOwners; // list of owners uint[256] m_owners; uint constant c_maxOwners = 250; // index on the list of owners to allow reverse lookup mapping(uint => uint) m_ownerIndex; // the ongoing operations. mapping(bytes32 => PendingState) m_pending; bytes32[] m_pendingIndex; } // inheritable "property" contract that enables methods to be protected by placing a linear limit (specifiable) // on a particular resource per calendar day. is multiowned to allow the limit to be altered. resource that method // uses is specified in the modifier. contract daylimit is multiowned { // MODIFIERS // simple modifier for daily limit. modifier limitedDaily(uint _value) { if (underLimit(_value)) _; } // METHODS // constructor - stores initial daily limit and records the present day's index. constructor(uint _limit) public { m_dailyLimit = _limit; m_lastDay = today(); } // (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today. function setDailyLimit(uint _newLimit) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external { m_dailyLimit = _newLimit; } // (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today. function resetSpentToday() onlymanyowners(keccak256(abi.encodePacked(msg.data))) external { m_spentToday = 0; } // INTERNAL METHODS // checks to see if there is at least `_value` left from the daily limit today. if there is, subtracts it and // returns true. otherwise just returns false. function underLimit(uint _value) internal onlyowner returns (bool) { // reset the spend limit if we're on a different day to last time. if (today() > m_lastDay) { m_spentToday = 0; m_lastDay = today(); } // check to see if there's enough left - if so, subtract and return true. if (m_spentToday + _value >= m_spentToday && m_spentToday + _value <= m_dailyLimit) { m_spentToday += _value; return true; } return false; } // determines today's index. function today() private view returns (uint) { return block.timestamp / 1 days; } // FIELDS uint public m_dailyLimit; uint public m_spentToday; uint public m_lastDay; } // interface contract for multisig proxy contracts; see below for docs. contract multisig { // EVENTS // logged events: // Funds has arrived into the wallet (record how much). event Deposit(address from, uint value); // Single transaction going out of the wallet (record who signed for it, how much, and to whom it's going). event SingleTransact(address owner, uint value, address to); // Multi-sig transaction going out of the wallet (record who signed for it last, the operation hash, how much, and to whom it's going). event MultiTransact(address owner, bytes32 operation, uint value, address to); // Confirmation still needed for a transaction. event ConfirmationERC20Needed(bytes32 operation, address initiator, uint value, address to, ERC20Basic token); event ConfirmationETHNeeded(bytes32 operation, address initiator, uint value, address to); // FUNCTIONS // TODO: document function changeOwner(address _from, address _to) external; //function execute(address _to, uint _value, bytes _data) external returns (bytes32); //function confirm(bytes32 _h) public returns (bool); } // usage: // bytes32 h = Wallet(w).from(oneOwner).transact(to, value, data); // Wallet(w).from(anotherOwner).confirm(h); contract Wallet is multisig, multiowned, daylimit { uint public version = 3; // TYPES // Transaction structure to remember details of transaction lest it need be saved for a later call. struct Transaction { address to; uint value; address token; } // METHODS // constructor - just pass on the owner array to the multiowned and // the limit to daylimit constructor(address[] _owners, uint _required, uint _daylimit) multiowned(_owners, _required) daylimit(_daylimit) public { } // kills the contract sending everything to `_to`. function kill(address _to) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external { selfdestruct(_to); } // gets called when no other function matches function() public payable { // just being sent some cash? if (msg.value > 0) emit Deposit(msg.sender, msg.value); } // Outside-visible transact entry point. Executes transacion immediately if below daily spend limit. // If not, goes into multisig process. We provide a hash on return to allow the sender to provide // shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value // and _data arguments). They still get the option of using them if they want, anyways. function transferETH(address _to, uint _value) external onlyowner returns (bytes32 _r) { // first, take the opportunity to check that we're under the daily limit. if (underLimit(_value)) { emit SingleTransact(msg.sender, _value, _to); // yes - just execute the call. _to.transfer(_value); return 0; } // determine our operation hash. _r = keccak256(abi.encodePacked(msg.data, block.number)); if (!confirmETH(_r) && m_txs[_r].to == 0) { m_txs[_r].to = _to; m_txs[_r].value = _value; emit ConfirmationETHNeeded(_r, msg.sender, _value, _to); } } // confirm a transaction through just the hash. we use the previous transactions map, m_txs, in order // to determine the body of the transaction from the hash provided. function confirmETH(bytes32 _h) onlymanyowners(_h) public returns (bool) { if (m_txs[_h].to != 0) { m_txs[_h].to.transfer(m_txs[_h].value); emit MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to); delete m_txs[_h]; return true; } } function transferERC20(address _to, uint _value, address _token) external onlyowner returns (bytes32 _r) { // first, take the opportunity to check that we're under the daily limit. if (underLimit(_value)) { emit SingleTransact(msg.sender, _value, _to); // yes - just execute the call. ERC20Basic token = ERC20Basic(_token); token.transfer(_to, _value); return 0; } // determine our operation hash. _r = keccak256(abi.encodePacked(msg.data, block.number)); if (!confirmERC20(_r) && m_txs[_r].to == 0) { m_txs[_r].to = _to; m_txs[_r].value = _value; m_txs[_r].token = _token; emit ConfirmationERC20Needed(_r, msg.sender, _value, _to, token); } } function confirmERC20(bytes32 _h) onlymanyowners(_h) public returns (bool) { if (m_txs[_h].to != 0) { ERC20Basic token = ERC20Basic(m_txs[_h].token); token.transfer(m_txs[_h].to, m_txs[_h].value); emit MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to); delete m_txs[_h]; return true; } } // INTERNAL METHODS function clearPending() internal { uint length = m_pendingIndex.length; for (uint i = 0; i < length; ++i) delete m_txs[m_pendingIndex[i]]; super.clearPending(); } // FIELDS // pending transactions we have at present. mapping (bytes32 => Transaction) m_txs; }
0x6080604052600436106101115763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663173825d981146101575780632f54bf6e146101785780634123cb6b146101ad57806352375093146101d457806354fd4d50146101e95780635c52c2f5146101fe578063659010e7146102135780637065cb4814610228578063746c9171146102495780637b1a49091461025e5780637de1a6311461028257806397e10a791461029a578063b20d30a9146102c5578063b75c7dc6146102dd578063ba51a6df146102f5578063c2cf73261461030d578063cbf0b0c014610331578063f00d4b5d14610352578063f1736d8614610379578063fa47c5641461038e575b6000341115610155576040805133815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b005b34801561016357600080fd5b50610155600160a060020a03600435166103a6565b34801561018457600080fd5b50610199600160a060020a03600435166104f3565b604080519115158252519081900360200190f35b3480156101b957600080fd5b506101c2610514565b60408051918252519081900360200190f35b3480156101e057600080fd5b506101c261051a565b3480156101f557600080fd5b506101c2610521565b34801561020a57600080fd5b50610155610528565b34801561021f57600080fd5b506101c26105c4565b34801561023457600080fd5b50610155600160a060020a03600435166105cb565b34801561025557600080fd5b506101c261071a565b34801561026a57600080fd5b506101c2600160a060020a0360043516602435610720565b34801561028e57600080fd5b50610199600435610914565b3480156102a657600080fd5b506101c2600160a060020a036004358116906024359060443516610a40565b3480156102d157600080fd5b50610155600435610cb4565b3480156102e957600080fd5b50610155600435610d4d565b34801561030157600080fd5b50610155600435610de5565b34801561031957600080fd5b50610199600435600160a060020a0360243516610eca565b34801561033d57600080fd5b50610155600160a060020a0360043516610f2e565b34801561035e57600080fd5b50610155600160a060020a0360043581169060243516610fcc565b34801561038557600080fd5b506101c2611124565b34801561039a57600080fd5b5061019960043561112b565b60008036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083106103fe5780518252601f1990920191602091820191016103df565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610434816112c2565b156104ee57600160a060020a038316600090815261010260205260409020549150811515610461576104ee565b60018054036000541115610474576104ee565b6000600283610100811061048457fe5b0155600160a060020a038316600090815261010260205260408120556104a861140e565b6104b061148d565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a15b505050565b600160a060020a03811660009081526101026020526040812054115b919050565b60015481565b6101075481565b6101085481565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b6020831061057f5780518252601f199092019160209182019101610560565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206105b5816112c2565b156105c1576000610106555b50565b6101065481565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083106106225780518252601f199092019160209182019101610603565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610658816112c2565b1561071657610666826104f3565b1561067057610716565b61067861140e565b60015460fa1161068c5761068a61148d565b505b60015460fa1161069b57610716565b60018054810190819055600160a060020a0383169060029061010081106106be57fe5b0155600154600160a060020a03831660008181526101026020908152604091829020939093558051918252517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3929181900390910190a15b5050565b60005481565b600061072b336104f3565b1561090e57610739826115a9565b156107c6576040805133815260208101849052600160a060020a0385168183015290517f4f6201f683343e96e9541a12726d3e99f43268c4dd78e66bed2bf05299ce5d9e9181900360600190a1604051600160a060020a0384169083156108fc029084906000818181858888f193505050501580156107bc573d6000803e3d6000fd5b506000905061090e565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b602083106108255780518252601f199092019160209182019101610806565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905061085d81610914565b158015610880575060008181526101096020526040902054600160a060020a0316155b1561090e57600081815261010960209081526040918290208054600160a060020a03871673ffffffffffffffffffffffffffffffffffffffff1990911681178255600190910185905582518481523392810192909252818301859052606082015290517fe8822e02b75091990be9e62536ea43bfedba392d5801cecae8473f992f262dc49181900360800190a15b92915050565b600081610920816112c2565b15610a3a5760008381526101096020526040902054600160a060020a031615610a3a576000838152610109602052604080822080546001909101549151600160a060020a039091169282156108fc02929190818181858888f1935050505015801561098f573d6000803e3d6000fd5b506000838152610109602090815260409182902060018101549054835133815292830187905282840191909152600160a060020a0316606082015290517f73586c7e29af20c2cfb512293fb21f274d22b3fa0df53f2bb28977be93d545129181900360800190a1600083815261010960205260408120805473ffffffffffffffffffffffffffffffffffffffff19908116825560018083019390935560029091018054909116905591505b50919050565b600080610a4c336104f3565b15610cac57610a5a846115a9565b15610b4a576040805133815260208101869052600160a060020a0387168183015290517f4f6201f683343e96e9541a12726d3e99f43268c4dd78e66bed2bf05299ce5d9e9181900360600190a150604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018690529151849283169163a9059cbb9160448083019260209291908290030181600087803b158015610b1457600080fd5b505af1158015610b28573d6000803e3d6000fd5b505050506040513d6020811015610b3e57600080fd5b5060009250610cac9050565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610ba95780518252601f199092019160209182019101610b8a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209150610be18261112b565b158015610c04575060008281526101096020526040902054600160a060020a0316155b15610cac5760008281526101096020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038a81169182178455600184018a905560029093018054909216888416179091558351868152339381019390935282840188905260608301528316608082015290517fadd50a5aea0e28cb887644e8a41c86a278d70c9099697194c51299514f5b843c9160a0908290030190a15b509392505050565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310610d0b5780518252601f199092019160209182019101610cec565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610d41816112c2565b15610716575061010555565b33600090815261010260205260408120549080821515610d6c57610ddf565b50506000828152610103602052604081206001810154600284900a929083161115610ddf57805460019081018255810180548390039055604080513381526020810186905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b50505050565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310610e3c5780518252601f199092019160209182019101610e1d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610e72816112c2565b1561071657600154821115610e8657610716565b6000829055610e9361140e565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b600082815261010360209081526040808320600160a060020a038516845261010290925282205482811515610f025760009350610f25565b8160020a90508083600101541660001415610f205760009350610f25565b600193505b50505092915050565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310610f855780518252601f199092019160209182019101610f66565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610fbb816112c2565b156107165781600160a060020a0316ff5b60008036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083106110245780518252601f199092019160209182019101611005565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902061105a816112c2565b15610ddf57611068836104f3565b1561107257610ddf565b600160a060020a03841660009081526101026020526040902054915081151561109a57610ddf565b6110a261140e565b600160a060020a03831660028361010081106110ba57fe5b0155600160a060020a0380851660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a150505050565b6101055481565b60008082611138816112c2565b156112bb5760008481526101096020526040902054600160a060020a0316156112bb576000848152610109602090815260408083206002810154815460019092015483517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810191909152925191169550859363a9059cbb93604480850194919392918390030190829087803b1580156111e557600080fd5b505af11580156111f9573d6000803e3d6000fd5b505050506040513d602081101561120f57600080fd5b50506000848152610109602090815260409182902060018101549054835133815292830188905282840191909152600160a060020a0316606082015290517f73586c7e29af20c2cfb512293fb21f274d22b3fa0df53f2bb28977be93d545129181900360800190a1600084815261010960205260408120805473ffffffffffffffffffffffffffffffffffffffff19908116825560018083019390935560029091018054909116905592505b5050919050565b336000908152610102602052604081205481808215156112e157611406565b600085815261010360205260409020805490925015156113405760008054835560018084019190915561010480549161131c919083016116a6565b600283018190556101048054879290811061133357fe5b6000918252602090912001555b8260020a9050808260010154166000141561140657604080513381526020810187905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a181546001106113f35760008581526101036020526040902060020154610104805490919081106113bc57fe5b6000918252602080832090910182905586825261010390526040812081815560018082018390556002909101919091559350611406565b8154600019018255600182018054821790555b505050919050565b6101045460005b818110156114855761010960006101048381548110151561143257fe5b600091825260208083209091015483528201929092526040018120805473ffffffffffffffffffffffffffffffffffffffff19908116825560018083019390935560029091018054909116905501611415565b610716611619565b600060015b6001548110156115a5575b600154811080156114bc575060028161010081106114b757fe5b015415155b156114c95760010161149d565b600180541180156114ea575060015460029061010081106114e657fe5b0154155b156114fe57600180546000190190556114c9565b600154811080156115205750600154600290610100811061151b57fe5b015415155b80156115395750600281610100811061153557fe5b0154155b156115a057600154600290610100811061154f57fe5b0154600282610100811061155f57fe5b0155806101026000600283610100811061157557fe5b0154815260200190815260200160002081905550600060026001546101008110151561159d57fe5b01555b611492565b5090565b60006115b4336104f3565b1561050f57610107546115c561169c565b11156115de576000610106556115d961169c565b610107555b61010654828101108015906115fb57506101055482610106540111155b156116115750610106805482019055600161050f565b506000919050565b6101045460005b8181101561168f5761010480548290811061163757fe5b600091825260209091200154156116875761010360006101048381548110151561165d57fe5b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101611620565b61071661010460006116ca565b6201518042045b90565b8154818355818111156104ee576000838152602090206104ee9181019083016116e4565b50805460008255906000526020600020908101906105c191905b6116a391905b808211156115a557600081556001016116ea5600a165627a7a7230582010ba787702b0696008ba5a6f20895ed0981cf212a3371dcafd759f4232e0b4140029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,163
0x400970cb5945251f0beefd6fbe91ffc4484d0255
/** *Submitted for verification at Etherscan.io on 2021-07-16 */ pragma solidity =0.8.0; 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 INimbusRouter { function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed from, address indexed to); constructor() { owner = msg.sender; emit OwnershipTransferred(address(0), owner); } modifier onlyOwner { require(msg.sender == owner, "Ownable: Caller is not the owner"); _; } function transferOwnership(address transferOwner) public onlyOwner { require(transferOwner != newOwner); newOwner = transferOwner; } function acceptOwnership() virtual public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = 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) { 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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); 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) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function average(uint256 a, uint256 b) internal pure returns (uint256) { return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrt(uint y) internal 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; } } } 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; } } 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); 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"); (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ReentrancyGuard { /// @dev counter to allow mutex lock with only one SSTORE operation uint256 private _guardCounter; constructor () { // The counter starts at one to prevent changing it from zero to a non-zero // value, which is a more expensive operation. _guardCounter = 1; } modifier nonReentrant() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call"); } } interface IStakingRewards { function earned(address account) external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function stake(uint256 amount) external; function stakeFor(uint256 amount, address user) external; function getReward() external; function withdraw(uint256 nonce) external; function withdrawAndGetReward(uint256 nonce) external; } interface IERC20Permit { function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; } contract StakingRewardFixedAPY is IStakingRewards, ReentrancyGuard, Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public immutable rewardsToken; IERC20 public immutable stakingToken; INimbusRouter public swapRouter; uint256 public rewardRate; uint256 public constant rewardDuration = 365 days; mapping(address => uint256) public weightedStakeDate; mapping(address => mapping(uint256 => uint256)) public stakeAmounts; mapping(address => mapping(uint256 => uint256)) public stakeAmountsRewardEquivalent; mapping(address => uint256) public stakeNonces; uint256 private _totalSupply; uint256 private _totalSupplyRewardEquivalent; mapping(address => uint256) private _balances; mapping(address => uint256) private _balancesRewardEquivalent; event RewardUpdated(uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); event Rescue(address to, uint amount); event RescueToken(address to, address token, uint amount); constructor( address _rewardsToken, address _stakingToken, address _swapRouter, uint _rewardRate ) { rewardsToken = IERC20(_rewardsToken); stakingToken = IERC20(_stakingToken); swapRouter = INimbusRouter(_swapRouter); rewardRate = _rewardRate; } function totalSupply() external view override returns (uint256) { return _totalSupply; } function totalSupplyRewardEquivalent() external view returns (uint256) { return _totalSupplyRewardEquivalent; } function balanceOf(address account) external view override returns (uint256) { return _balances[account]; } function balanceOfRewardEquivalent(address account) external view returns (uint256) { return _balancesRewardEquivalent[account]; } function earned(address account) public view override returns (uint256) { return (_balancesRewardEquivalent[account].mul(block.timestamp.sub(weightedStakeDate[account])).mul(rewardRate)) / (100 * rewardDuration); } function stakeWithPermit(uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant { require(amount > 0, "Cannot stake 0"); // permit IERC20Permit(address(stakingToken)).permit(msg.sender, address(this), amount, deadline, v, r, s); _stake(amount, msg.sender); } function stake(uint256 amount) external override nonReentrant { require(amount > 0, "StakingRewardFixedAPY: Cannot stake 0"); _stake(amount, msg.sender); } function stakeFor(uint256 amount, address user) external override nonReentrant { require(amount > 0, "StakingRewardFixedAPY: Cannot stake 0"); _stake(amount, user); } function _stake(uint256 amount, address user) private { stakingToken.safeTransferFrom(msg.sender, address(this), amount); uint amountRewardEquivalent = getEquivalentAmount(amount); _totalSupply = _totalSupply.add(amount); _totalSupplyRewardEquivalent = _totalSupplyRewardEquivalent.add(amountRewardEquivalent); uint previousAmount = _balances[user]; uint newAmount = previousAmount.add(amount); weightedStakeDate[user] = (weightedStakeDate[user].mul(previousAmount) / newAmount).add(block.timestamp.mul(amount) / newAmount); _balances[user] = newAmount; uint stakeNonce = stakeNonces[user]++; stakeAmounts[user][stakeNonce] = amount; stakeAmountsRewardEquivalent[user][stakeNonce] = amountRewardEquivalent; _balancesRewardEquivalent[user] = _balancesRewardEquivalent[user].add(amountRewardEquivalent); emit Staked(user, amount); } //A user can withdraw its staking tokens even if there is no rewards tokens on the contract account function withdraw(uint256 nonce) public override nonReentrant { require(stakeAmounts[msg.sender][nonce] > 0, "StakingRewardFixedAPY: This stake nonce was withdrawn"); uint amount = stakeAmounts[msg.sender][nonce]; uint amountRewardEquivalent = stakeAmountsRewardEquivalent[msg.sender][nonce]; _totalSupply = _totalSupply.sub(amount); _totalSupplyRewardEquivalent = _totalSupplyRewardEquivalent.sub(amountRewardEquivalent); _balances[msg.sender] = _balances[msg.sender].sub(amount); _balancesRewardEquivalent[msg.sender] = _balancesRewardEquivalent[msg.sender].sub(amountRewardEquivalent); stakingToken.safeTransfer(msg.sender, amount); stakeAmounts[msg.sender][nonce] = 0; stakeAmountsRewardEquivalent[msg.sender][nonce] = 0; emit Withdrawn(msg.sender, amount); } function getReward() public override nonReentrant { uint256 reward = earned(msg.sender); if (reward > 0) { weightedStakeDate[msg.sender] = block.timestamp; rewardsToken.safeTransfer(msg.sender, reward); emit RewardPaid(msg.sender, reward); } } function withdrawAndGetReward(uint256 nonce) external override { getReward(); withdraw(nonce); } function getEquivalentAmount(uint amount) public view returns (uint) { address[] memory path = new address[](2); uint equivalent; if (stakingToken != rewardsToken) { path[0] = address(stakingToken); path[1] = address(rewardsToken); equivalent = swapRouter.getAmountsOut(amount, path)[1]; } else { equivalent = amount; } return equivalent; } function updateRewardAmount(uint256 reward) external onlyOwner { rewardRate = reward; emit RewardUpdated(reward); } function updateSwapRouter(address newSwapRouter) external onlyOwner { require(newSwapRouter != address(0), "StakingRewardFixedAPY: Address is zero"); swapRouter = INimbusRouter(newSwapRouter); } function rescue(address to, address token, uint256 amount) external onlyOwner { require(to != address(0), "StakingRewardFixedAPY: Cannot rescue to the zero address"); require(amount > 0, "StakingRewardFixedAPY: Cannot rescue 0"); require(token != address(stakingToken), "StakingRewardFixedAPY: Cannot rescue staking token"); //owner can rescue rewardsToken if there is spare unused tokens on staking contract balance IERC20(token).safeTransfer(to, amount); emit RescueToken(to, address(token), amount); } function rescue(address payable to, uint256 amount) external onlyOwner { require(to != address(0), "StakingRewardFixedAPY: Cannot rescue to the zero address"); require(amount > 0, "StakingRewardFixedAPY: Cannot rescue 0"); to.transfer(amount); emit Rescue(to, amount); } }
0x608060405234801561001057600080fd5b50600436106101ce5760003560e01c806386a9d8a811610104578063c31c9c07116100a2578063ecd9ba8211610071578063ecd9ba8214610365578063f2fde38b14610378578063f44c407a1461038b578063f520e7e51461039e576101ce565b8063c31c9c071461033a578063c9eadb8614610342578063d1af0c7d14610355578063d4ee1d901461035d576101ce565b8063a694fc3a116100de578063a694fc3a146102ee578063ac348bb214610301578063b98b677f14610314578063baee99c214610327576101ce565b806386a9d8a8146102c05780638da5cb5b146102d35780638edc7f2d146102db576101ce565b806351746bb21161017157806372f702f31161014b57806372f702f31461028857806379ba50971461029d5780637a4e4ecf146102a55780637b0a47ee146102b8576101ce565b806351746bb21461024f578063673434b21461026257806370a0823114610275576101ce565b80631cb1f5b6116101ad5780631cb1f5b61461021957806320ff430b146102215780632e1a7d4d146102345780633d18b91214610247576101ce565b80628cc262146101d357806315c2ba14146101fc57806318160ddd14610211575b600080fd5b6101e66101e136600461191c565b6103a6565b6040516101f39190612087565b60405180910390f35b61020f61020a366004611a8f565b610436565b005b6101e66104d0565b6101e66104d6565b61020f61022f366004611963565b6104dc565b61020f610242366004611a8f565b61069b565b61020f610893565b61020f61025d366004611aa7565b6109a2565b6101e661027036600461191c565b610a3d565b6101e661028336600461191c565b610a65565b610290610a8d565b6040516101f39190611b5c565b61020f610ab1565b61020f6102b3366004611938565b610b6d565b6101e6610cc6565b6101e66102ce36600461191c565b610ccc565b610290610cde565b6101e66102e93660046119a3565b610cfa565b61020f6102fc366004611a8f565b610d17565b6101e661030f3660046119a3565b610dad565b61020f61032236600461191c565b610dca565b6101e661033536600461191c565b610eaf565b610290610ec1565b6101e6610350366004611a8f565b610edd565b610290611190565b6102906111b4565b61020f610373366004611ad6565b6111d0565b61020f61038636600461191c565b61131e565b61020f610399366004611a8f565b6113de565b6101e66113ef565b60006103b76301e133806064612144565b60045473ffffffffffffffffffffffffffffffffffffffff84166000908152600560205260409020546104269190610420906103f49042906113f7565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600c602052604090205490611447565b90611447565b610430919061210b565b92915050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611c22565b60405180910390fd5b60048190556040517fcb94909754d27c309adf4167150f1f7aa04de40b6a0e6bb98b2ae80a2bf438f6906104c5908390612087565b60405180910390a150565b60095490565b600a5490565b60015473ffffffffffffffffffffffffffffffffffffffff16331461052d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611c22565b73ffffffffffffffffffffffffffffffffffffffff831661057a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611ceb565b600081116105b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611f02565b7f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b7273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561063a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611e48565b61065b73ffffffffffffffffffffffffffffffffffffffff831684836114a6565b7faabf44ab9d5bef08d1b60f287a337f0d11a248e49741ad189b429e47e98ba91083838360405161068e93929190611ba3565b60405180910390a1505050565b60016000808282546106ad91906120f3565b90915550506000805433825260066020908152604080842085855290915290912054610705576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611deb565b3360008181526006602090815260408083208684528252808320549383526007825280832086845290915290205460095461074090836113f7565b600955600a5461075090826113f7565b600a55336000908152600b602052604090205461076d90836113f7565b336000908152600b6020908152604080832093909355600c9052205461079390826113f7565b336000818152600c60205260409020919091556107e8907f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b7273ffffffffffffffffffffffffffffffffffffffff1690846114a6565b33600081815260066020908152604080832088845282528083208390558383526007825280832088845290915280822091909155517f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d59061084a908590612087565b60405180910390a25050600054811461088f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790612019565b5050565b60016000808282546108a591906120f3565b909155505060008054906108b8336103a6565b9050801561096357336000818152600560205260409020429055610914907f000000000000000000000000eb58343b36c7528f23caae63a15024024131004973ffffffffffffffffffffffffffffffffffffffff1690836114a6565b3373ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04868260405161095a9190612087565b60405180910390a25b50600054811461099f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790612019565b50565b60016000808282546109b491906120f3565b9091555050600054826109f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611f5f565b6109fd8383611547565b6000548114610a38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790612019565b505050565b73ffffffffffffffffffffffffffffffffffffffff166000908152600c602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff166000908152600b602052604090205490565b7f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b7281565b60025473ffffffffffffffffffffffffffffffffffffffff163314610ad557600080fd5b60025460015460405173ffffffffffffffffffffffffffffffffffffffff92831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360028054600180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610bbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611c22565b73ffffffffffffffffffffffffffffffffffffffff8216610c0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611ceb565b60008111610c45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611f02565b60405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f19350505050158015610c88573d6000803e3d6000fd5b507f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af28282604051610cba929190611b7d565b60405180910390a15050565b60045481565b60086020526000908152604090205481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b600660209081526000928352604080842090915290825290205481565b6001600080828254610d2991906120f3565b909155505060005481610d68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611f5f565b610d728233611547565b600054811461088f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790612019565b600760209081526000928352604080842090915290825290205481565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611c22565b73ffffffffffffffffffffffffffffffffffffffff8116610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611c57565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60056020526000908152604090205481565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b6040805160028082526060820183526000928392919060208301908036833701905050905060007f000000000000000000000000eb58343b36c7528f23caae63a15024024131004973ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b7273ffffffffffffffffffffffffffffffffffffffff1614611186577f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b7282600081518110610fd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f000000000000000000000000eb58343b36c7528f23caae63a15024024131004982600181518110611067577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526003546040517fd06ca61f00000000000000000000000000000000000000000000000000000000815291169063d06ca61f906110cc9087908690600401612090565b60006040518083038186803b1580156110e457600080fd5b505afa1580156110f8573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261113e91908101906119b5565b600181518110611177577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101519050611189565b50825b9392505050565b7f000000000000000000000000eb58343b36c7528f23caae63a15024024131004981565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60016000808282546111e291906120f3565b909155505060005485611221576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611cb4565b6040517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b72169063d505accf9061129f90339030908b908b908b908b908b90600401611bd4565b600060405180830381600087803b1580156112b957600080fd5b505af11580156112cd573d6000803e3d6000fd5b505050506112db8633611547565b6000548114611316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790612019565b505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611c22565b60025473ffffffffffffffffffffffffffffffffffffffff8281169116141561139757600080fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6113e6610893565b61099f8161069b565b6301e1338081565b600082821115611433576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611db4565b600061143f8385612181565b949350505050565b60008261145657506000610430565b60006114628385612144565b90508261146f858361210b565b14611189576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611ea5565b610a388363a9059cbb60e01b84846040516024016114c5929190611b7d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261175a565b61158973ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b72163330856118ac565b600061159483610edd565b6009549091506115a490846118cd565b600955600a546115b490826118cd565b600a5573ffffffffffffffffffffffffffffffffffffffff82166000908152600b6020526040812054906115e882866118cd565b9050611644816115f84288611447565b611602919061210b565b73ffffffffffffffffffffffffffffffffffffffff861660009081526005602052604090205483906116349086611447565b61163e919061210b565b906118cd565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260056020908152604080832093909355600b8152828220849055600890529081208054908261168e83612198565b9091555073ffffffffffffffffffffffffffffffffffffffff8616600081815260066020908152604080832085845282528083208b9055838352600782528083208584528252808320899055928252600c905220549091506116f090856118cd565b73ffffffffffffffffffffffffffffffffffffffff86166000818152600c6020526040908190209290925590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d9061174a908990612087565b60405180910390a2505050505050565b6117798273ffffffffffffffffffffffffffffffffffffffff16611916565b6117af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790612050565b6000808373ffffffffffffffffffffffffffffffffffffffff16836040516117d79190611b23565b6000604051808303816000865af19150503d8060008114611814576040519150601f19603f3d011682016040523d82523d6000602084013e611819565b606091505b509150915081611855576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611d7f565b8051156118a657808060200190518101906118709190611a6f565b6118a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611fbc565b50505050565b6118a6846323b872dd60e01b8585856040516024016114c593929190611ba3565b6000806118da83856120f3565b905083811015611189576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048790611d48565b3b151590565b60006020828403121561192d578081fd5b81356111898161222f565b6000806040838503121561194a578081fd5b82356119558161222f565b946020939093013593505050565b600080600060608486031215611977578081fd5b83356119828161222f565b925060208401356119928161222f565b929592945050506040919091013590565b6000806040838503121561194a578182fd5b600060208083850312156119c7578182fd5b825167ffffffffffffffff808211156119de578384fd5b818501915085601f8301126119f1578384fd5b815181811115611a0357611a03612200565b83810260405185828201018181108582111715611a2257611a22612200565b604052828152858101935084860182860187018a1015611a40578788fd5b8795505b83861015611a62578051855260019590950194938601938601611a44565b5098975050505050505050565b600060208284031215611a80578081fd5b81518015158114611189578182fd5b600060208284031215611aa0578081fd5b5035919050565b60008060408385031215611ab9578182fd5b823591506020830135611acb8161222f565b809150509250929050565b600080600080600060a08688031215611aed578081fd5b8535945060208601359350604086013560ff81168114611b0b578182fd5b94979396509394606081013594506080013592915050565b60008251815b81811015611b435760208186018101518583015201611b29565b81811115611b515782828501525b509190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff97881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6020808252818101527f4f776e61626c653a2043616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526026908201527f5374616b696e6752657761726446697865644150593a2041646472657373206960408201527f73207a65726f0000000000000000000000000000000000000000000000000000606082015260800190565b6020808252600e908201527f43616e6e6f74207374616b652030000000000000000000000000000000000000604082015260600190565b60208082526038908201527f5374616b696e6752657761726446697865644150593a2043616e6e6f7420726560408201527f7363756520746f20746865207a65726f20616464726573730000000000000000606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526035908201527f5374616b696e6752657761726446697865644150593a2054686973207374616b60408201527f65206e6f6e6365207761732077697468647261776e0000000000000000000000606082015260800190565b60208082526032908201527f5374616b696e6752657761726446697865644150593a2043616e6e6f7420726560408201527f73637565207374616b696e6720746f6b656e0000000000000000000000000000606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f5374616b696e6752657761726446697865644150593a2043616e6e6f7420726560408201527f7363756520300000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f5374616b696e6752657761726446697865644150593a2043616e6e6f7420737460408201527f616b652030000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b90815260200190565b60006040820184835260206040818501528185518084526060860191508287019350845b818110156120e657845173ffffffffffffffffffffffffffffffffffffffff16835293830193918301916001016120b4565b5090979650505050505050565b60008219821115612106576121066121d1565b500190565b60008261213f577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561217c5761217c6121d1565b500290565b600082821015612193576121936121d1565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156121ca576121ca6121d1565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461099f57600080fdfea26469706673582212201e7ac8eb14c771bd0f523311b7c4ed90e0373ec15b96361264a4715ffad1ef4d64736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,164
0xd9a947789974bad9be77e45c2b327174a9c59d71
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.7.0; // File: 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) { // 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; } } // File: FrozenChecker.sol /** * @title FrozenChecker * @dev Check account by frozen rules */ library FrozenChecker { using SafeMath for uint256; /** * Rule for each address */ struct Rule { uint256 timeT; uint8 initPercent; uint256[] periods; uint8[] percents; } function check(Rule storage self, uint256 totalFrozenValue) internal view returns (uint256) { if (totalFrozenValue == uint256(0)) { return 0; } //uint8 temp = self.initPercent; if (self.timeT == uint256(0) || self.timeT > block.timestamp) { return totalFrozenValue.sub(totalFrozenValue.mul(self.initPercent).div(100)); } for (uint256 i = 0; i < self.periods.length.sub(1); i = i.add(1)) { if (block.timestamp >= self.timeT.add(self.periods[i]) && block.timestamp < self.timeT.add(self.periods[i.add(1)])) { return totalFrozenValue.sub(totalFrozenValue.mul(self.percents[i]).div(100)); } } if (block.timestamp >= self.timeT.add(self.periods[self.periods.length.sub(1)])) { return totalFrozenValue.sub(totalFrozenValue.mul(self.percents[self.periods.length.sub(1)]).div(100)); } } } // File: FrozenValidator.sol library FrozenValidator { using SafeMath for uint256; using FrozenChecker for FrozenChecker.Rule; struct Validator { mapping(address => IndexValue) data; KeyFlag[] keys; uint256 size; } struct IndexValue { uint256 keyIndex; FrozenChecker.Rule rule; mapping (address => uint256) frozenBalances; } struct KeyFlag { address key; bool deleted; } function addRule(Validator storage self, address key, uint8 initPercent, uint256[] memory periods, uint8[] memory percents) internal returns (bool replaced) { //require(self.size <= 10); require(key != address(0)); require(periods.length == percents.length); require(periods.length > 0); require(periods[0] == uint256(0)); require(initPercent <= percents[0]); for (uint256 i = 1; i < periods.length; i = i.add(1)) { require(periods[i.sub(1)] < periods[i]); require(percents[i.sub(1)] <= percents[i]); } require(percents[percents.length.sub(1)] == 100); FrozenChecker.Rule memory rule = FrozenChecker.Rule(0, initPercent, periods, percents); uint256 keyIndex = self.data[key].keyIndex; self.data[key].rule = rule; if (keyIndex > 0) { return true; } else { //keyIndex = self.keys.length++; keyIndex = self.keys.length; self.keys.push(); self.data[key].keyIndex = keyIndex.add(1); self.keys[keyIndex].key = key; self.size++; return false; } } function removeRule(Validator storage self, address key) internal returns (bool success) { uint256 keyIndex = self.data[key].keyIndex; if (keyIndex == 0) { return false; } delete self.data[key]; self.keys[keyIndex.sub(1)].deleted = true; self.size--; return true; } function containRule(Validator storage self, address key) internal view returns (bool) { return self.data[key].keyIndex > 0; } function addTimeT(Validator storage self, address addr, uint256 timeT) internal returns (bool) { require(timeT > block.timestamp); self.data[addr].rule.timeT = timeT; return true; } function addFrozenBalance(Validator storage self, address from, address to, uint256 value) internal returns (uint256) { self.data[from].frozenBalances[to] = self.data[from].frozenBalances[to].add(value); return self.data[from].frozenBalances[to]; } function validate(Validator storage self, address addr) internal view returns (uint256) { uint256 frozenTotal = 0; for (uint256 i = iterateStart(self); iterateValid(self, i); i = iterateNext(self, i)) { address ruleaddr = iterateGet(self, i); FrozenChecker.Rule storage rule = self.data[ruleaddr].rule; frozenTotal = frozenTotal.add(rule.check(self.data[ruleaddr].frozenBalances[addr])); } return frozenTotal; } function iterateStart(Validator storage self) internal view returns (uint256 keyIndex) { return iterateNext(self, uint256(-1)); } function iterateValid(Validator storage self, uint256 keyIndex) internal view returns (bool) { return keyIndex < self.keys.length; } function iterateNext(Validator storage self, uint256 keyIndex) internal view returns (uint256) { keyIndex++; while (keyIndex < self.keys.length && self.keys[keyIndex].deleted) { keyIndex++; } return keyIndex; } function iterateGet(Validator storage self, uint256 keyIndex) internal view returns (address) { return self.keys[keyIndex].key; } } // File: YottaCoin.sol contract YottaCoin { using SafeMath for uint256; using FrozenValidator for FrozenValidator.Validator; mapping (address => uint256) internal balances; mapping (address => mapping (address => uint256)) internal allowed; //-------------------------------- Basic Info -------------------------------------// string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; //-------------------------------- Basic Info -------------------------------------// //-------------------------------- Admin Info -------------------------------------// address payable public admin; //Admin address /** * @dev Change admin address * @param newAdmin New admin address */ function changeAdmin(address payable newAdmin) public returns (bool) { require(msg.sender == admin); require(newAdmin != address(0)); uint256 balAdmin = balances[admin]; balances[newAdmin] = balances[newAdmin].add(balAdmin); balances[admin] = 0; admin = newAdmin; emit Transfer(admin, newAdmin, balAdmin); return true; } //-------------------------------- Admin Info -------------------------------------// //-------------------------- Events & Constructor ------------------------------// event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); event Mint(address indexed target, uint256 value); event Burn(address indexed target, uint256 value); // constructor constructor(string memory tokenName, string memory tokenSymbol, uint8 tokenDecimals) { name = tokenName; symbol = tokenSymbol; decimals = tokenDecimals; totalSupply = 0; admin = msg.sender; // balances[msg.sender] = 0; // emit Transfer(address(0x0), msg.sender, totalTokenSupply); } //-------------------------- Events & Constructor ------------------------------// //------------------------------- Mint & Burn ----------------------------------// function mint(address target, uint256 value) public returns (bool) { require(msg.sender == admin); require(!frozenAccount[target]); require(block.timestamp > frozenTimestamp[target]); balances[target] = balances[target].add(value); totalSupply = totalSupply.add(value); emit Mint(target, value); emit Transfer(address(0), target, value); return true; } function burn(address target, uint256 value) public returns (bool) { require(msg.sender == admin); require(!frozenAccount[target]); require(block.timestamp > frozenTimestamp[target]); require(totalSupply>=value); require(balances[target].sub(value)>=validator.validate(target)); balances[target] = balances[target].sub(value); totalSupply = totalSupply.sub(value); emit Burn(target, value); emit Transfer(target, address(0), value); return true; } //------------------------------- Mint & Burn ----------------------------------// //------------------------------ Account lock -----------------------------------// // 同一个账户满足任意冻结条件均被冻结 mapping (address => bool) frozenAccount; //无限期冻结的账户 mapping (address => uint256) frozenTimestamp; // 有限期冻结的账户 /** * 查询账户是否存在锁定时间戳 */ function getFrozenTimestamp(address _target) public view returns (uint256) { return frozenTimestamp[_target]; } /** * 查询账户是否被锁定 */ function getFrozenAccount(address _target) public view returns (bool) { return frozenAccount[_target]; } /** * 锁定账户 */ function freeze(address _target, bool _freeze) public returns (bool) { require(msg.sender == admin); require(_target != admin); frozenAccount[_target] = _freeze; return true; } /** * 通过时间戳锁定账户 */ function freezeWithTimestamp(address _target, uint256 _timestamp) public returns (bool) { require(msg.sender == admin); require(_target != admin); frozenTimestamp[_target] = _timestamp; return true; } /** * 批量锁定账户 */ function multiFreeze(address[] memory _targets, bool[] memory _freezes) public returns (bool) { require(msg.sender == admin); require(_targets.length == _freezes.length); uint256 len = _targets.length; require(len > 0); for (uint256 i = 0; i < len; i = i.add(1)) { address _target = _targets[i]; require(_target != admin); bool _freeze = _freezes[i]; frozenAccount[_target] = _freeze; } return true; } /** * 批量通过时间戳锁定账户 */ function multiFreezeWithTimestamp(address[] memory _targets, uint256[] memory _timestamps) public returns (bool) { require(msg.sender == admin); require(_targets.length == _timestamps.length); uint256 len = _targets.length; require(len > 0); for (uint256 i = 0; i < len; i = i.add(1)) { address _target = _targets[i]; require(_target != admin); uint256 _timestamp = _timestamps[i]; frozenTimestamp[_target] = _timestamp; } return true; } //------------------------------ Account lock -----------------------------------// //-------------------------- Frozen rules ------------------------------// FrozenValidator.Validator validator; function addRule(address addr, uint8 initPercent, uint256[] memory periods, uint8[] memory percents) public returns (bool) { require(msg.sender == admin); return validator.addRule(addr, initPercent, periods, percents); } function addTimeT(address addr, uint256 timeT) public returns (bool) { require(msg.sender == admin); return validator.addTimeT(addr, timeT); } function removeRule(address addr) public returns (bool) { require(msg.sender == admin); return validator.removeRule(addr); } //-------------------------- Frozen rules ------------------------------// //------------------------- Standard ERC20 Interfaces --------------------------// function multiTransfer(address[] memory _tos, uint256[] memory _values) public returns (bool) { require(!frozenAccount[msg.sender]); require(block.timestamp > frozenTimestamp[msg.sender]); require(_tos.length == _values.length); uint256 len = _tos.length; require(len > 0); uint256 amount = 0; for (uint256 i = 0; i < len; i = i.add(1)) { amount = amount.add(_values[i]); } require(amount <= balances[msg.sender].sub(validator.validate(msg.sender))); for (uint256 j = 0; j < len; j = j.add(1)) { address _to = _tos[j]; if (validator.containRule(msg.sender) && msg.sender != _to) { validator.addFrozenBalance(msg.sender, _to, _values[j]); } balances[_to] = balances[_to].add(_values[j]); balances[msg.sender] = balances[msg.sender].sub(_values[j]); emit Transfer(msg.sender, _to, _values[j]); } return true; } function transfer(address _to, uint256 _value) public returns (bool) { transferfix(_to, _value); return true; } function transferfix(address _to, uint256 _value) public { require(!frozenAccount[msg.sender]); require(block.timestamp > frozenTimestamp[msg.sender]); require(balances[msg.sender].sub(_value) >= validator.validate(msg.sender)); if (validator.containRule(msg.sender) && msg.sender != _to) { validator.addFrozenBalance(msg.sender, _to, _value); } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(!frozenAccount[_from]); require(block.timestamp > frozenTimestamp[_from]); require(_value <= balances[_from].sub(validator.validate(_from))); require(_value <= allowed[_from][msg.sender]); if (validator.containRule(_from) && _from != _to) { validator.addFrozenBalance(_from, _to, _value); } balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @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]; //.sub(validator.validate(_owner)); } //------------------------- Standard ERC20 Interfaces --------------------------// function lockedBalanceOf(address _target) public view returns (uint256) { return validator.validate(_target); } function kill() public { require(msg.sender == admin); selfdestruct(admin); } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80639dc29fac116100de578063d54c8a5611610097578063dd62ed3e11610071578063dd62ed3e14610d8b578063df21950f14610e03578063e6ad5bc714610e5d578063f851a44014610eb55761018e565b8063d54c8a5614610b77578063d70907b014610bc5578063d950c43214610c295761018e565b80639dc29fac14610829578063a2c8a9271461088d578063a9059cbb146108f1578063bf120ae514610955578063c4977807146109bb578063c878dad914610a155761018e565b806340c10f191161014b57806370a082311161012557806370a08231146105655780638f283970146105bd57806395d89b411461061757806399f9b55e1461069a5761018e565b806340c10f191461049f57806341c0e1b514610503578063593557361461050d5761018e565b806306fdde0314610193578063095ea7b31461021657806318160ddd1461027a5780631e89d5451461029857806323b872dd146103fa578063313ce5671461047e575b600080fd5b61019b610ee9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101db5780820151818401526020810190506101c0565b50505050905090810190601f1680156102085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102626004803603604081101561022c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f87565b60405180821515815260200191505060405180910390f35b610282611079565b6040518082815260200191505060405180910390f35b6103e2600480360360408110156102ae57600080fd5b81019080803590602001906401000000008111156102cb57600080fd5b8201836020820111156102dd57600080fd5b803590602001918460208302840111640100000000831117156102ff57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561035f57600080fd5b82018360208201111561037157600080fd5b8035906020019184602083028401116401000000008311171561039357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061107f565b60405180821515815260200191505060405180910390f35b6104666004803603606081101561041057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611492565b60405180821515815260200191505060405180910390f35b61048661193f565b604051808260ff16815260200191505060405180910390f35b6104eb600480360360408110156104b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611952565b60405180821515815260200191505060405180910390f35b61050b611bbc565b005b61054f6004803603602081101561052357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c51565b6040518082815260200191505060405180910390f35b6105a76004803603602081101561057b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c6e565b6040518082815260200191505060405180910390f35b6105ff600480360360208110156105d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cb6565b60405180821515815260200191505060405180910390f35b61061f611f7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561065f578082015181840152602081019050610644565b50505050905090810190601f16801561068c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610811600480360360808110156106b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803590602001906401000000008111156106fa57600080fd5b82018360208201111561070c57600080fd5b8035906020019184602083028401116401000000008311171561072e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561078e57600080fd5b8201836020820111156107a057600080fd5b803590602001918460208302840111640100000000831117156107c257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061201a565b60405180821515815260200191505060405180910390f35b6108756004803603604081101561083f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061209a565b60405180821515815260200191505060405180910390f35b6108d9600480360360408110156108a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612383565b60405180821515815260200191505060405180910390f35b61093d6004803603604081101561090757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506123fd565b60405180821515815260200191505060405180910390f35b6109a36004803603604081101561096b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050612413565b60405180821515815260200191505060405180910390f35b6109fd600480360360208110156109d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061252b565b60405180821515815260200191505060405180910390f35b610b5f60048036036040811015610a2b57600080fd5b8101908080359060200190640100000000811115610a4857600080fd5b820183602082011115610a5a57600080fd5b80359060200191846020830284011164010000000083111715610a7c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610adc57600080fd5b820183602082011115610aee57600080fd5b80359060200191846020830284011164010000000083111715610b1057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050612581565b60405180821515815260200191505060405180910390f35b610bc360048036036040811015610b8d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612714565b005b610c1160048036036040811015610bdb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612a20565b60405180821515815260200191505060405180910390f35b610d7360048036036040811015610c3f57600080fd5b8101908080359060200190640100000000811115610c5c57600080fd5b820183602082011115610c6e57600080fd5b80359060200191846020830284011164010000000083111715610c9057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610cf057600080fd5b820183602082011115610d0257600080fd5b80359060200191846020830284011164010000000083111715610d2457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050612b25565b60405180821515815260200191505060405180910390f35b610ded60048036036040811015610da157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ca5565b6040518082815260200191505060405180910390f35b610e4560048036036020811015610e1957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d2c565b60405180821515815260200191505060405180910390f35b610e9f60048036036020811015610e7357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612da3565b6040518082815260200191505060405180910390f35b610ebd612dec565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f7f5780601f10610f5457610100808354040283529160200191610f7f565b820191906000526020600020905b815481529060010190602001808311610f6257829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60055481565b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110d857600080fd5b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421161112357600080fd5b815183511461113157600080fd5b6000835190506000811161114457600080fd5b6000805b828110156111935761117685828151811061115f57fe5b602002602001015183612e1290919063ffffffff16565b915061118c600182612e1290919063ffffffff16565b9050611148565b506111f86111ab336009612e2990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6990919063ffffffff16565b81111561120457600080fd5b60005b8281101561148557600086828151811061121d57fe5b6020026020010151905061123b336009612f8090919063ffffffff16565b801561127357508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156112a5576112a3338288858151811061128957fe5b60200260200101516009612fd1909392919063ffffffff16565b505b6113098683815181106112b457fe5b60200260200101516000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e1290919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113af86838151811061135a57fe5b60200260200101516000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef88858151811061144c57fe5b60200260200101516040518082815260200191505060405180910390a35061147e600182612e1290919063ffffffff16565b9050611207565b5060019250505092915050565b6000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156114eb57600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421161153657600080fd5b61159a61154d856009612e2990919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6990919063ffffffff16565b8211156115a657600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561162f57600080fd5b611643846009612f8090919063ffffffff16565b801561167b57508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561169a576116988484846009612fd1909392919063ffffffff16565b505b6116eb826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6990919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e1290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061184f82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6990919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119ae57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a0557600080fd5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544211611a5057600080fd5b611aa1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e1290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611af882600554612e1290919063ffffffff16565b6005819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c1657600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000611c67826009612e2990919063ffffffff16565b9050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d1257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d4c57600080fd5b6000806000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611e02816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e1290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000806000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36001915050919050565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120125780601f10611fe757610100808354040283529160200191612012565b820191906000526020600020905b815481529060010190602001808311611ff557829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461207657600080fd5b61209085858585600961317890949392919063ffffffff16565b9050949350505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120f657600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561214d57600080fd5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421161219857600080fd5b8160055410156121a757600080fd5b6121bb836009612e2990919063ffffffff16565b61220c836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6990919063ffffffff16565b101561221757600080fd5b612268826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122bf82600554612f6990919063ffffffff16565b6005819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146123df57600080fd5b6123f5838360096135489092919063ffffffff16565b905092915050565b60006124098383612714565b6001905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461246f57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156124ca57600080fd5b81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146125dd57600080fd5b81518351146125eb57600080fd5b600083519050600081116125fe57600080fd5b60005b8181101561270857600085828151811061261757fe5b60200260200101519050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561267c57600080fd5b600085838151811061268a57fe5b6020026020010151905080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050612701600182612e1290919063ffffffff16565b9050612601565b50600191505092915050565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561276b57600080fd5b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442116127b657600080fd5b6127ca336009612e2990919063ffffffff16565b61281b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6990919063ffffffff16565b101561282657600080fd5b61283a336009612f8090919063ffffffff16565b801561287257508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156128915761288f3383836009612fd1909392919063ffffffff16565b505b6128e2816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6990919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612975816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e1290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612a7c57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612ad757600080fd5b81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612b8157600080fd5b8151835114612b8f57600080fd5b60008351905060008111612ba257600080fd5b60005b81811015612c99576000858281518110612bbb57fe5b60200260200101519050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612c2057600080fd5b6000858381518110612c2e57fe5b6020026020010151905080600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050612c92600182612e1290919063ffffffff16565b9050612ba5565b50600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612d8857600080fd5b612d9c8260096135ad90919063ffffffff16565b9050919050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000818301905082811015612e2357fe5b92915050565b600080600090506000612e3b85613702565b90505b612e488582613735565b15612f5e576000612e598683613749565b905060008660000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001019050612f49612f3a8860000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361379090919063ffffffff16565b85612e1290919063ffffffff16565b93505050612f578582613a29565b9050612e3e565b508091505092915050565b600082821115612f7557fe5b818303905092915050565b6000808360000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411905092915050565b6000613067828660000160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e1290919063ffffffff16565b8560000160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508460000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050949350505050565b60008073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156131b357600080fd5b81518351146131c157600080fd5b60008351116131cf57600080fd5b6000836000815181106131de57fe5b6020026020010151146131f057600080fd5b816000815181106131fd57fe5b602002602001015160ff168460ff16111561321757600080fd5b6000600190505b83518110156132d35783818151811061323357fe5b602002602001015184613250600184612f6990919063ffffffff16565b8151811061325a57fe5b60200260200101511061326c57600080fd5b82818151811061327857fe5b602002602001015160ff1683613298600184612f6990919063ffffffff16565b815181106132a257fe5b602002602001015160ff1611156132b857600080fd5b6132cc600182612e1290919063ffffffff16565b905061321e565b506064826132ec60018551612f6990919063ffffffff16565b815181106132f657fe5b602002602001015160ff161461330b57600080fd5b613313613ad0565b6040518060800160405280600081526020018660ff16815260200185815260200184815250905060008760000160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050818860000160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000820151816000015560208201518160010160006101000a81548160ff021916908360ff160217905550604082015181600201908051906020019061340f929190613afb565b50606082015181600301908051906020019061342c929190613b48565b5090505060008111156134445760019250505061353f565b8760010180549050905087600101600181600181540180825580915050039060005260206000205050613481600182612e1290919063ffffffff16565b8860000160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550868860010182815481106134d957fe5b9060005260206000200160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600201600081548092919060010191905055506000925050505b95945050505050565b600042821161355657600080fd5b818460000160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160000181905550600190509392505050565b6000808360000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050600081141561360a5760009150506136fc565b8360000160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160009055600182016000808201600090556001820160006101000a81549060ff02191690556002820160006136859190613bef565b6003820160006136959190613c10565b505050506001846001016136b3600184612f6990919063ffffffff16565b815481106136bd57fe5b9060005260206000200160000160146101000a81548160ff02191690831515021790555083600201600081548092919060019003919050555060019150505b92915050565b600061372e827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613a29565b9050919050565b600082600101805490508210905092915050565b600082600101828154811061375a57fe5b9060005260206000200160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b6000808214156137a35760009050613a23565b6000836000015414806137b95750428360000154115b156138115761380a6137fb60646137ed8660010160009054906101000a900460ff1660ff1686613a8b90919063ffffffff16565b613abc90919063ffffffff16565b83612f6990919063ffffffff16565b9050613a23565b60005b61382f60018560020180549050612f6990919063ffffffff16565b8110156139475761386684600201828154811061384857fe5b90600052602060002001548560000154612e1290919063ffffffff16565b42101580156138b657506138b38460020161388b600184612e1290919063ffffffff16565b8154811061389557fe5b90600052602060002001548560000154612e1290919063ffffffff16565b42105b1561392c5761392461391560646139078760030185815481106138d557fe5b90600052602060002090602091828204019190069054906101000a900460ff1660ff1687613a8b90919063ffffffff16565b613abc90919063ffffffff16565b84612f6990919063ffffffff16565b915050613a23565b613940600182612e1290919063ffffffff16565b9050613814565b506139928360020161396a60018660020180549050612f6990919063ffffffff16565b8154811061397457fe5b90600052602060002001548460000154612e1290919063ffffffff16565b4210613a2257613a1b613a0c60646139fe866003016139c260018960020180549050612f6990919063ffffffff16565b815481106139cc57fe5b90600052602060002090602091828204019190069054906101000a900460ff1660ff1686613a8b90919063ffffffff16565b613abc90919063ffffffff16565b83612f6990919063ffffffff16565b9050613a23565b5b92915050565b600081806001019250505b826001018054905082108015613a705750826001018281548110613a5457fe5b9060005260206000200160000160149054906101000a900460ff165b15613a82578180600101925050613a34565b81905092915050565b600080831415613a9e5760009050613ab6565b818302905081838281613aad57fe5b0414613ab557fe5b5b92915050565b6000818381613ac757fe5b04905092915050565b604051806080016040528060008152602001600060ff16815260200160608152602001606081525090565b828054828255906000526020600020908101928215613b37579160200282015b82811115613b36578251825591602001919060010190613b1b565b5b509050613b449190613c38565b5090565b82805482825590600052602060002090601f01602090048101928215613bde5791602002820160005b83821115613baf57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302613b71565b8015613bdc5782816101000a81549060ff0219169055600101602081600001049283019260010302613baf565b505b509050613beb9190613c55565b5090565b5080546000825590600052602060002090810190613c0d9190613c38565b50565b50805460008255601f016020900490600052602060002090810190613c359190613c38565b50565b5b80821115613c51576000816000905550600101613c39565b5090565b5b80821115613c7957600081816101000a81549060ff021916905550600101613c56565b509056fea26469706673582212204395a9af44ba2ed97c3865ca557be5e91c887869c9a0b5e31f8ef30853d8a42264736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,165
0xabe421aee9fe65ac7196616828fb9bd174079bac
/* DOGEBOOK - The new social media platform. https://t.me/dogebookerc https://twitter.com/dogebookerc Tokenomics: - 10 million total supply - 5% Marketing Tax - 5% Development Tax */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract DOGEBOOK is Context, IERC20, Ownable {/////////////////////////////////////////////////////////// using SafeMath for uint256; string private constant _name = "DOGEBOOK";////////////////////////// string private constant _symbol = "DOGEBOOK";////////////////////////////////////////////////////////////////////////// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0;//////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnBuy = 10;////////////////////////////////////////////////////////////////////// //Sell Fee uint256 private _redisFeeOnSell = 0;///////////////////////////////////////////////////////////////////// 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) private cooldown; address payable private _developmentAddress = payable(0x67299082258B129d2bb2dd9fD2fF42fe08C4466f);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0xcC58Bb91348dB177F5ee03BBE7D6e196B91953E5);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 200000 * 10**9; //1% uint256 public _maxWalletSize = 200000 * 10**9; //1% uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4% 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f046146104ea578063dd62ed3e1461050a578063ea1644d514610550578063f2fde38b1461057057600080fd5b8063a2a957bb14610465578063a9059cbb14610485578063bfd79284146104a5578063c3c8cd80146104d557600080fd5b80638f70ccf7116100d15780638f70ccf71461040f5780638f9a55c01461042f57806395d89b41146101f357806398a5c3151461044557600080fd5b806374010ece146103bb5780637d1db4a5146103db5780638da5cb5b146103f157600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103515780636fc3eaec1461037157806370a0823114610386578063715018a6146103a657600080fd5b8063313ce567146102f557806349bd5a5e146103115780636b9990531461033157600080fd5b80631694505e116101a05780631694505e1461026357806318160ddd1461029b57806323b872dd146102bf5780632fd689e3146102df57600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023357600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab4565b610590565b005b3480156101ff57600080fd5b506040805180820182526008815267444f4745424f4f4b60c01b6020820152905161022a9190611bde565b60405180910390f35b34801561023f57600080fd5b5061025361024e366004611a0a565b61063d565b604051901515815260200161022a565b34801561026f57600080fd5b50601454610283906001600160a01b031681565b6040516001600160a01b03909116815260200161022a565b3480156102a757600080fd5b50662386f26fc100005b60405190815260200161022a565b3480156102cb57600080fd5b506102536102da3660046119ca565b610654565b3480156102eb57600080fd5b506102b160185481565b34801561030157600080fd5b506040516009815260200161022a565b34801561031d57600080fd5b50601554610283906001600160a01b031681565b34801561033d57600080fd5b506101f161034c36600461195a565b6106bd565b34801561035d57600080fd5b506101f161036c366004611b7b565b610708565b34801561037d57600080fd5b506101f1610750565b34801561039257600080fd5b506102b16103a136600461195a565b61079b565b3480156103b257600080fd5b506101f16107bd565b3480156103c757600080fd5b506101f16103d6366004611b95565b610831565b3480156103e757600080fd5b506102b160165481565b3480156103fd57600080fd5b506000546001600160a01b0316610283565b34801561041b57600080fd5b506101f161042a366004611b7b565b610860565b34801561043b57600080fd5b506102b160175481565b34801561045157600080fd5b506101f1610460366004611b95565b6108a8565b34801561047157600080fd5b506101f1610480366004611bad565b6108d7565b34801561049157600080fd5b506102536104a0366004611a0a565b610915565b3480156104b157600080fd5b506102536104c036600461195a565b60106020526000908152604090205460ff1681565b3480156104e157600080fd5b506101f1610922565b3480156104f657600080fd5b506101f1610505366004611a35565b610976565b34801561051657600080fd5b506102b1610525366004611992565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055c57600080fd5b506101f161056b366004611b95565b610a25565b34801561057c57600080fd5b506101f161058b36600461195a565b610a54565b6000546001600160a01b031633146105c35760405162461bcd60e51b81526004016105ba90611c31565b60405180910390fd5b60005b8151811015610639576001601060008484815181106105f557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063181611d44565b9150506105c6565b5050565b600061064a338484610b3e565b5060015b92915050565b6000610661848484610c62565b6106b384336106ae85604051806060016040528060288152602001611da1602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061119e565b610b3e565b5060019392505050565b6000546001600160a01b031633146106e75760405162461bcd60e51b81526004016105ba90611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107325760405162461bcd60e51b81526004016105ba90611c31565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078557506013546001600160a01b0316336001600160a01b0316145b61078e57600080fd5b47610798816111d8565b50565b6001600160a01b03811660009081526002602052604081205461064e9061125d565b6000546001600160a01b031633146107e75760405162461bcd60e51b81526004016105ba90611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461085b5760405162461bcd60e51b81526004016105ba90611c31565b601655565b6000546001600160a01b0316331461088a5760405162461bcd60e51b81526004016105ba90611c31565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108d25760405162461bcd60e51b81526004016105ba90611c31565b601855565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016105ba90611c31565b600893909355600a91909155600955600b55565b600061064a338484610c62565b6012546001600160a01b0316336001600160a01b0316148061095757506013546001600160a01b0316336001600160a01b0316145b61096057600080fd5b600061096b3061079b565b9050610798816112e1565b6000546001600160a01b031633146109a05760405162461bcd60e51b81526004016105ba90611c31565b60005b82811015610a1f5781600560008686858181106109d057634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109e5919061195a565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1781611d44565b9150506109a3565b50505050565b6000546001600160a01b03163314610a4f5760405162461bcd60e51b81526004016105ba90611c31565b601755565b6000546001600160a01b03163314610a7e5760405162461bcd60e51b81526004016105ba90611c31565b6001600160a01b038116610ae35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ba565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ba05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ba565b6001600160a01b038216610c015760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ba565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ba565b6001600160a01b038216610d285760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ba565b60008111610d8a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ba565b6000546001600160a01b03848116911614801590610db657506000546001600160a01b03838116911614155b1561109757601554600160a01b900460ff16610e4f576000546001600160a01b03848116911614610e4f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ba565b601654811115610ea15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ba565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee357506001600160a01b03821660009081526010602052604090205460ff16155b610f3b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ba565b6015546001600160a01b03838116911614610fc05760175481610f5d8461079b565b610f679190611cd6565b10610fc05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ba565b6000610fcb3061079b565b601854601654919250821015908210610fe45760165491505b808015610ffb5750601554600160a81b900460ff16155b801561101557506015546001600160a01b03868116911614155b801561102a5750601554600160b01b900460ff165b801561104f57506001600160a01b03851660009081526005602052604090205460ff16155b801561107457506001600160a01b03841660009081526005602052604090205460ff16155b1561109457611082826112e1565b47801561109257611092476111d8565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110d957506001600160a01b03831660009081526005602052604090205460ff165b8061110b57506015546001600160a01b0385811691161480159061110b57506015546001600160a01b03848116911614155b1561111857506000611192565b6015546001600160a01b03858116911614801561114357506014546001600160a01b03848116911614155b1561115557600854600c55600954600d555b6015546001600160a01b03848116911614801561118057506014546001600160a01b03858116911614155b1561119257600a54600c55600b54600d555b610a1f84848484611486565b600081848411156111c25760405162461bcd60e51b81526004016105ba9190611bde565b5060006111cf8486611d2d565b95945050505050565b6012546001600160a01b03166108fc6111f28360026114b4565b6040518115909202916000818181858888f1935050505015801561121a573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112358360026114b4565b6040518115909202916000818181858888f19350505050158015610639573d6000803e3d6000fd5b60006006548211156112c45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ba565b60006112ce6114f6565b90506112da83826114b4565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138b57600080fd5b505afa15801561139f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c39190611976565b816001815181106113e457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461140a9130911684610b3e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611443908590600090869030904290600401611c66565b600060405180830381600087803b15801561145d57600080fd5b505af1158015611471573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061149357611493611519565b61149e848484611547565b80610a1f57610a1f600e54600c55600f54600d55565b60006112da83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163e565b600080600061150361166c565b909250905061151282826114b4565b9250505090565b600c541580156115295750600d54155b1561153057565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611559876116aa565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158b9087611707565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ba9086611749565b6001600160a01b0389166000908152600260205260409020556115dc816117a8565b6115e684836117f2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162b91815260200190565b60405180910390a3505050505050505050565b6000818361165f5760405162461bcd60e51b81526004016105ba9190611bde565b5060006111cf8486611cee565b6006546000908190662386f26fc1000061168682826114b4565b8210156116a157505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c78a600c54600d54611816565b92509250925060006116d76114f6565b905060008060006116ea8e87878761186b565b919e509c509a509598509396509194505050505091939550919395565b60006112da83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061119e565b6000806117568385611cd6565b9050838110156112da5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ba565b60006117b26114f6565b905060006117c083836118bb565b306000908152600260205260409020549091506117dd9082611749565b30600090815260026020526040902055505050565b6006546117ff9083611707565b60065560075461180f9082611749565b6007555050565b6000808080611830606461182a89896118bb565b906114b4565b90506000611843606461182a8a896118bb565b9050600061185b826118558b86611707565b90611707565b9992985090965090945050505050565b600080808061187a88866118bb565b9050600061188888876118bb565b9050600061189688886118bb565b905060006118a8826118558686611707565b939b939a50919850919650505050505050565b6000826118ca5750600061064e565b60006118d68385611d0e565b9050826118e38583611cee565b146112da5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ba565b803561194581611d8b565b919050565b8035801515811461194557600080fd5b60006020828403121561196b578081fd5b81356112da81611d8b565b600060208284031215611987578081fd5b81516112da81611d8b565b600080604083850312156119a4578081fd5b82356119af81611d8b565b915060208301356119bf81611d8b565b809150509250929050565b6000806000606084860312156119de578081fd5b83356119e981611d8b565b925060208401356119f981611d8b565b929592945050506040919091013590565b60008060408385031215611a1c578182fd5b8235611a2781611d8b565b946020939093013593505050565b600080600060408486031215611a49578283fd5b833567ffffffffffffffff80821115611a60578485fd5b818601915086601f830112611a73578485fd5b813581811115611a81578586fd5b8760208260051b8501011115611a95578586fd5b602092830195509350611aab918601905061194a565b90509250925092565b60006020808385031215611ac6578182fd5b823567ffffffffffffffff80821115611add578384fd5b818501915085601f830112611af0578384fd5b813581811115611b0257611b02611d75565b8060051b604051601f19603f83011681018181108582111715611b2757611b27611d75565b604052828152858101935084860182860187018a1015611b45578788fd5b8795505b83861015611b6e57611b5a8161193a565b855260019590950194938601938601611b49565b5098975050505050505050565b600060208284031215611b8c578081fd5b6112da8261194a565b600060208284031215611ba6578081fd5b5035919050565b60008060008060808587031215611bc2578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c0a57858101830151858201604001528201611bee565b81811115611c1b5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cb55784516001600160a01b031683529383019391830191600101611c90565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ce957611ce9611d5f565b500190565b600082611d0957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2857611d28611d5f565b500290565b600082821015611d3f57611d3f611d5f565b500390565b6000600019821415611d5857611d58611d5f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122007bccad13ac7472f21ae5a9e154a820d14266f60a48c214bd624444819deaace64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,166
0x08e4f70109ccc5135f50cc359d24cb7686247df4
pragma solidity ^0.4.19; /** * @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; } } /** * @title Eliptic curve signature operations * * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d */ library ECRecovery { /** * @dev Recover signer address from a message by using his signature * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param sig bytes signature, the signature is generated using web3.eth.sign() */ function recover(bytes32 hash, bytes sig) public pure returns (address) { bytes32 r; bytes32 s; uint8 v; //Check the signature length if (sig.length != 65) { return (address(0)); } // Divide the signature in r, s and v variables assembly { r := mload(add(sig, 32)) s := mload(add(sig, 64)) v := byte(0, mload(add(sig, 96))) } // Version of signature should be 27 or 28, but 0 and 1 are also possible versions if (v < 27) { v += 27; } // If the version is correct return the signer address if (v != 27 && v != 28) { return (address(0)); } else { return ecrecover(hash, v, r, s); } } } /// @title Unidirectional Ether payment channels contract. contract Unidirectional { using SafeMath for uint256; struct PaymentChannel { address sender; address receiver; uint256 value; // Total amount of money deposited to the channel. uint32 settlingPeriod; // How many blocks to wait for the receiver to claim her funds, after sender starts settling. uint256 settlingUntil; // Starting with this block number, anyone can settle the channel. } mapping (bytes32 => PaymentChannel) public channels; event DidOpen(bytes32 indexed channelId, address indexed sender, address indexed receiver, uint256 value); event DidDeposit(bytes32 indexed channelId, uint256 deposit); event DidClaim(bytes32 indexed channelId); event DidStartSettling(bytes32 indexed channelId); event DidSettle(bytes32 indexed channelId); /*** ACTIONS AND CONSTRAINTS ***/ /// @notice Open a new channel between `msg.sender` and `receiver`, and do an initial deposit to the channel. /// @param channelId Unique identifier of the channel to be created. /// @param receiver Receiver of the funds, counter-party of `msg.sender`. /// @param settlingPeriod Number of blocks to wait for receiver to `claim` her funds after the sender starts settling period (see `startSettling`). /// After that period is over anyone could call `settle`, and move all the channel funds to the sender. function open(bytes32 channelId, address receiver, uint32 settlingPeriod) public payable { require(isAbsent(channelId)); channels[channelId] = PaymentChannel({ sender: msg.sender, receiver: receiver, value: msg.value, settlingPeriod: settlingPeriod, settlingUntil: 0 }); DidOpen(channelId, msg.sender, receiver, msg.value); } /// @notice Ensure `origin` address can deposit money into the channel identified by `channelId`. /// @dev Constraint `deposit` call. /// @param channelId Identifier of the channel. /// @param origin Caller of `deposit` function. function canDeposit(bytes32 channelId, address origin) public view returns(bool) { PaymentChannel memory channel = channels[channelId]; bool isSender = channel.sender == origin; return isOpen(channelId) && isSender; } /// @notice Add more money to the contract. /// @param channelId Identifier of the channel. function deposit(bytes32 channelId) public payable { require(canDeposit(channelId, msg.sender)); channels[channelId].value += msg.value; DidDeposit(channelId, msg.value); } /// @notice Ensure `origin` address can start settling the channel identified by `channelId`. /// @dev Constraint `startSettling` call. /// @param channelId Identifier of the channel. /// @param origin Caller of `startSettling` function. function canStartSettling(bytes32 channelId, address origin) public view returns(bool) { PaymentChannel memory channel = channels[channelId]; bool isSender = channel.sender == origin; return isOpen(channelId) && isSender; } /// @notice Sender initiates settling of the contract. /// @dev Actually set `settlingUntil` field of the PaymentChannel structure. /// @param channelId Identifier of the channel. function startSettling(bytes32 channelId) public { require(canStartSettling(channelId, msg.sender)); PaymentChannel storage channel = channels[channelId]; channel.settlingUntil = block.number + channel.settlingPeriod; DidStartSettling(channelId); } /// @notice Ensure one can settle the channel identified by `channelId`. /// @dev Check if settling period is over by comparing `settlingUntil` to a current block number. /// @param channelId Identifier of the channel. function canSettle(bytes32 channelId) public view returns(bool) { PaymentChannel memory channel = channels[channelId]; bool isWaitingOver = isSettling(channelId) && block.number >= channel.settlingUntil; return isSettling(channelId) && isWaitingOver; } /// @notice Move the money to sender, and close the channel. /// After the settling period is over, and receiver has not claimed the funds, anyone could call that. /// @param channelId Identifier of the channel. function settle(bytes32 channelId) public { require(canSettle(channelId)); PaymentChannel storage channel = channels[channelId]; channel.sender.transfer(channel.value); delete channels[channelId]; DidSettle(channelId); } /// @notice Ensure `origin` address can claim `payment` amount on channel identified by `channelId`. /// @dev Check if `signature` is made by sender part of the channel, and is for payment promise (see `paymentDigest`). /// @param channelId Identifier of the channel. /// @param payment Amount claimed. /// @param origin Caller of `claim` function. /// @param signature Signature for the payment promise. function canClaim(bytes32 channelId, uint256 payment, address origin, bytes signature) public view returns(bool) { PaymentChannel memory channel = channels[channelId]; bool isReceiver = origin == channel.receiver; bytes32 hash = recoveryPaymentDigest(channelId, payment); bool isSigned = channel.sender == ECRecovery.recover(hash, signature); return isReceiver && isSigned; } /// @notice Claim the funds, and close the channel. /// @dev Can be claimed by channel receiver only. Guarded by `canClaim`. /// @param channelId Identifier of the channel. /// @param payment Amount claimed. /// @param signature Signature for the payment promise. function claim(bytes32 channelId, uint256 payment, bytes signature) public { require(canClaim(channelId, payment, msg.sender, signature)); PaymentChannel memory channel = channels[channelId]; if (payment >= channel.value) { channel.receiver.transfer(channel.value); } else { channel.receiver.transfer(payment); channel.sender.transfer(channel.value.sub(payment)); } delete channels[channelId]; DidClaim(channelId); } /*** CHANNEL STATE ***/ /// @notice Check if the channel is present: in open or settling state. /// @param channelId Identifier of the channel. function isPresent(bytes32 channelId) public view returns(bool) { return !isAbsent(channelId); } /// @notice Check if the channel is not present. /// @param channelId Identifier of the channel. function isAbsent(bytes32 channelId) public view returns(bool) { PaymentChannel memory channel = channels[channelId]; return channel.sender == 0; } /// @notice Check if the channel is in settling state: waits till the settling period is over. /// @dev It is settling, if `settlingUntil` is set to non-zero. /// @param channelId Identifier of the channel. function isSettling(bytes32 channelId) public view returns(bool) { PaymentChannel memory channel = channels[channelId]; return channel.settlingUntil != 0; } /// @notice Check if the channel is open: present and not settling. /// @param channelId Identifier of the channel. function isOpen(bytes32 channelId) public view returns(bool) { return isPresent(channelId) && !isSettling(channelId); } /*** PAYMENT DIGEST ***/ /// @return Hash of the payment promise to sign. /// @param channelId Identifier of the channel. /// @param payment Amount to send, and to claim later. function paymentDigest(bytes32 channelId, uint256 payment) public view returns(bytes32) { return keccak256(address(this), channelId, payment); } /// @return Actually signed hash of the payment promise, considering "Ethereum Signed Message" prefix. /// @param channelId Identifier of the channel. /// @param payment Amount to send, and to claim later. function recoveryPaymentDigest(bytes32 channelId, uint256 payment) internal view returns(bytes32) { bytes memory prefix = "\x19Ethereum Signed Message:\n32"; return keccak256(prefix, paymentDigest(channelId, payment)); } }
0x6060604052600436106100d95763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662f31e7681146100de5780632f8f0c921461010857806341b6fcf71461012a5780634722361c1461010857806360546602146101555780636683f9ae1461016b5780637964ea87146101815780637a7ebd7b146101df5780637c35be7a14610235578063987757dd1461024b578063ad37908914610261578063b214faa514610277578063ba6cc6c314610282578063e62eea47146102a2578063ec8be5b9146102b8575b600080fd5b34156100e957600080fd5b6100f4600435610320565b604051901515815260200160405180910390f35b341561011357600080fd5b6100f4600435600160a060020a0360243516610332565b341561013557600080fd5b6101436004356024356103c7565b60405190815260200160405180910390f35b341561016057600080fd5b6100f460043561040c565b341561017657600080fd5b6100f4600435610486565b341561018c57600080fd5b6101dd600480359060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506104fa95505050505050565b005b34156101ea57600080fd5b6101f56004356106c3565b604051600160a060020a03958616815293909416602084015260408084019290925263ffffffff166060830152608082019290925260a001905180910390f35b341561024057600080fd5b6100f4600435610705565b341561025657600080fd5b6101dd600435610726565b341561026c57600080fd5b6100f460043561080c565b6101dd6004356108a7565b6101dd600435600160a060020a036024351663ffffffff6044351661090f565b34156102ad57600080fd5b6101dd600435610a46565b34156102c357600080fd5b6100f460048035906024803591600160a060020a03604435169160849060643590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610ab295505050505050565b600061032b8261040c565b1592915050565b600061033c610d32565b6000848152602081905260408082209060a0905190810160409081528254600160a060020a039081168352600184015481166020840152600284015491830191909152600383015463ffffffff1660608301526004909201546080820152925084168251600160a060020a03161490506103b585610705565b80156103be5750805b95945050505050565b6000308383604051600160a060020a03939093166c01000000000000000000000000028352601483019190915260348201526054016040518091039020905092915050565b6000610416610d32565b600083815260208190526040908190209060a0905190810160409081528254600160a060020a0390811683526001840154166020830152600283015490820152600382015463ffffffff166060820152600490910154608082015290508051600160a060020a0316159392505050565b6000610490610d32565b600083815260208190526040908190209060a0905190810160409081528254600160a060020a0390811683526001840154166020830152600283015490820152600382015463ffffffff166060820152600490910154608082019081529091505115159392505050565b610502610d32565b61050e84843385610ab2565b151561051957600080fd5b600084815260208190526040908190209060a0905190810160409081528254600160a060020a03908116835260018401541660208301526002830154908201908152600383015463ffffffff166060830152600490920154608082015291505183106105bf578060200151600160a060020a03166108fc82604001519081150290604051600060405180830381858888f1935050505015156105ba57600080fd5b61063c565b8060200151600160a060020a031683156108fc0284604051600060405180830381858888f1935050505015156105f457600080fd5b8051600160a060020a03166108fc6106178584604001519063ffffffff610c6c16565b9081150290604051600060405180830381858888f19350505050151561063c57600080fd5b600084815260208190526040808220805473ffffffffffffffffffffffffffffffffffffffff19908116825560018201805490911690556002810183905560038101805463ffffffff191690556004019190915584907f3de43c9e481138453c3cfea2781e18a609abb6448556669b257edc7de710fd64905160405180910390a250505050565b60006020819052908152604090208054600182015460028301546003840154600490940154600160a060020a03938416949290931692909163ffffffff169085565b600061071082610320565b8015610720575061032b82610486565b92915050565b60006107318261080c565b151561073c57600080fd5b5060008181526020819052604090819020805460028201549192600160a060020a039091169180156108fc029151600060405180830381858888f19350505050151561078757600080fd5b600082815260208190526040808220805473ffffffffffffffffffffffffffffffffffffffff19908116825560018201805490911690556002810183905560038101805463ffffffff191690556004019190915582907f74fb75c3de2cff5e8a78cf9b1f49a5bea60126b42ed45bb4b2b25b7da03e4d1b905160405180910390a25050565b6000610816610d32565b6000838152602081905260408082209060a0905190810160409081528254600160a060020a0390811683526001840154166020830152600283015490820152600382015463ffffffff1660608201526004909101546080820152915061087b84610486565b801561088b575081608001514310155b905061089684610486565b801561089f5750805b949350505050565b6108b18133610332565b15156108bc57600080fd5b6000818152602081905260409081902060020180543490810190915582917f6f850cda6d6b2f5cca622bc2d4739e4ed917c12d29f9a92b9e6c127abe39842491905190815260200160405180910390a250565b6109188361040c565b151561092357600080fd5b60a06040519081016040908152600160a060020a0333811683528416602080840191909152348284015263ffffffff8416606084015260006080840181905286815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560408201518160020155606082015160038201805463ffffffff191663ffffffff92909216919091179055608082015160049091015550600160a060020a03808316903316847f2f7cfc632227c054da7caaf75268353dba6206f53e9f7a547a193e66ab8c94dc3460405190815260200160405180910390a4505050565b6000610a528233610332565b1515610a5d57600080fd5b5060008181526020819052604090819020600381015463ffffffff16430160048201559082907fd6461a3a92fd600fe23f236b2e25c2fd0c197a66b2f990989f0b210d578f4617905160405180910390a25050565b6000610abc610d32565b600086815260208190526040808220829182919060a0905190810160409081528254600160a060020a03908116835260018401541660208301908152600284015491830191909152600383015463ffffffff1660608301526004909201546080820152945051600160a060020a031687600160a060020a0316149250610b428989610c7e565b915073be7c52c9f88af54f3b29cd472c71a03c7863d1eb6319045a2583886000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff851602815260048101838152604060248301908152909160440183818151815260200191508051906020019080838360005b83811015610bd9578082015183820152602001610bc1565b50505050905090810190601f168015610c065780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b1515610c2357600080fd5b6102c65a03f41515610c3457600080fd5b5050506040518051600160a060020a031690508451600160a060020a0316149050828015610c5f5750805b9998505050505050505050565b600082821115610c7857fe5b50900390565b6000610c88610d60565b60408051908101604052601c81527f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152905080610cc985856103c7565b6040518083805190602001908083835b60208310610cf85780518252601f199092019160209182019101610cd9565b6001836020036101000a03801982511681845116179092525050509190910192835250506020019050604051809103902091505092915050565b60a0604051908101604090815260008083526020830181905290820181905260608201819052608082015290565b602060405190810160405260008152905600a165627a7a7230582054107390e3abdedc00b3ae8b66039c130a5995a3ce03c1875e71bb0084435c460029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
2,167
0xaC3bf6e1fE9Bf1F203Bf07D72F64E95f3ea39BB6
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: IAddressResolver interface IAddressResolver { function key2address(bytes32 key) external view returns(address); function address2key(address addr) external view returns(bytes32); function requireAndKey2Address(bytes32 name, string calldata reason) external view returns(address); function setAddress(bytes32 key, address addr) external; function setMultiAddress(bytes32[] memory keys, address[] memory addrs) external; function setKkAddr(bytes32 k1, bytes32 k2, address addr) external; function setMultiKKAddr(bytes32[] memory k1s, bytes32[] memory k2s, address[] memory addrs) external; function kk2addr(bytes32 k1, bytes32 k2) external view returns(address); function requireKKAddrs(bytes32 k1, bytes32 k2, string calldata reason) external view returns(address); } // Part: IMintProposal interface IMintProposal { function approve( bytes32 _tunnelKey, string memory _txid, uint256 _amount, address to, address trustee, uint256 trusteeCount ) external returns (bool); } // 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/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: MintProposal.sol contract MintProposal is IMintProposal, Ownable { using SafeMath for uint256; bytes32 public constant BORINGDAO = "BoringDAO"; IAddressResolver addrReso; uint public diff=1; constructor(IAddressResolver _addrResovler) public { addrReso = _addrResovler; } struct Proposal { bytes32 tunnelKey; uint256 amount; uint256 voteCount; address creater; bool finished; bool isExist; mapping(address => bool) voteState; address to; string txid; } // mapping(address => bool) voteState; mapping(bytes32 => Proposal) public proposals; function setDiff(uint _diff) public onlyOwner { diff = _diff; } function approve( bytes32 _tunnelKey, string memory _txid, uint256 _amount, address to, address trustee, uint256 trusteeCount ) public override onlyBoringDAO returns (bool) { require(msg.sender == addrReso.key2address(BORINGDAO)); bytes32 pid = keccak256( abi.encodePacked(_tunnelKey, _txid, _amount, to) ); if (proposals[pid].isExist == false) { // new proposal Proposal memory p = Proposal({ tunnelKey: _tunnelKey, to: to, txid: _txid, amount: _amount, creater: trustee, voteCount: 1, finished: false, isExist: true }); proposals[pid] = p; proposals[pid].voteState[trustee] = true; emit VoteMintProposal(_tunnelKey, _txid, _amount, to, trustee, p.voteCount, trusteeCount); } else { // exist proposal Proposal storage p = proposals[pid]; // had voted nothing to do more if(p.voteState[trustee] == true) { return false; } // proposal finished noting to do more if (p.finished) { return false; } p.voteCount = p.voteCount.add(1); p.voteState[trustee] = true; emit VoteMintProposal(_tunnelKey, _txid, _amount, to, trustee, p.voteCount, trusteeCount); } Proposal storage p = proposals[pid]; uint threshold = trusteeCount.mod(3) == 0 ? trusteeCount.mul(2).div(3) : trusteeCount.mul(2).div(3).add(diff); if (p.voteCount >= threshold) { p.finished = true; return true; } else { return false; } } modifier onlyBoringDAO { require(msg.sender == addrReso.key2address(BORINGDAO), "MintProposal::caller is not boringDAO"); _; } event VoteMintProposal( bytes32 _tunnelKey, string _txid, uint256 _amount, address to, address trustee, uint votedCount, uint256 trusteeCount ); }
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063a0d7afb71161005b578063a0d7afb7146101b4578063e4886e05146101ce578063f2fde38b146101d6578063f99021a2146101fc57610088565b806332ed5b121461008d5780633779123314610169578063715018a6146101885780638da5cb5b14610190575b600080fd5b6100aa600480360360208110156100a357600080fd5b50356102db565b60405180898152602001888152602001878152602001866001600160a01b0316815260200185151581526020018415158152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561012757818101518382015260200161010f565b50505050905090810190601f1680156101545780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390f35b6101866004803603602081101561017f57600080fd5b50356103c1565b005b610186610430565b6101986104e4565b604080516001600160a01b039092168252519081900360200190f35b6101bc6104f3565b60408051918252519081900360200190f35b6101bc6104f9565b610186600480360360208110156101ec57600080fd5b50356001600160a01b0316610509565b6102c7600480360360c081101561021257600080fd5b8135919081019060408101602082013564010000000081111561023457600080fd5b82018360208201111561024657600080fd5b8035906020019184600183028401116401000000008311171561026857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505082359350506001600160a01b0360208301358116926040810135909116915060600135610613565b604080519115158252519081900360200190f35b60036020818152600092835260409283902080546001808301546002808501549685015460058601546006870180548b516101009782161597909702600019011693909304601f8101899004890286018901909a5289855294989297966001600160a01b0380831697600160a01b840460ff90811698600160a81b909504169691909316949293909290918301828280156103b75780601f1061038c576101008083540402835291602001916103b7565b820191906000526020600020905b81548152906001019060200180831161039a57829003601f168201915b5050505050905088565b6103c9610cc3565b6000546001600160a01b0390811691161461042b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600255565b610438610cc3565b6000546001600160a01b0390811691161461049a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60025481565b68426f72696e6744414f60b81b81565b610511610cc3565b6000546001600160a01b03908116911614610573576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166105b85760405162461bcd60e51b815260040180806020018281038252602681526020018061100a6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546040805163130852b360e11b815268426f72696e6744414f60b81b600482015290516000926001600160a01b031691632610a566916024808301926020929190829003018186803b15801561066a57600080fd5b505afa15801561067e573d6000803e3d6000fd5b505050506040513d602081101561069457600080fd5b50516001600160a01b031633146106dc5760405162461bcd60e51b8152600401808060200182810382526025815260200180610fe56025913960400191505060405180910390fd5b6001546040805163130852b360e11b815268426f72696e6744414f60b81b600482015290516001600160a01b0390921691632610a56691602480820192602092909190829003018186803b15801561073357600080fd5b505afa158015610747573d6000803e3d6000fd5b505050506040513d602081101561075d57600080fd5b50516001600160a01b0316331461077357600080fd5b6000878787876040516020018085815260200184805190602001908083835b602083106107b15780518252601f199092019160209182019101610792565b51815160209384036101000a600019018019909216911617905292019485525060609290921b6bffffffffffffffffffffffff19168383015250604080516014818503018152603490930181528251928201929092206000818152600392839052929092200154909350600160a81b900460ff1615159150610a8b905057610837610f0b565b6040518061010001604052808a815260200188815260200160018152602001866001600160a01b03168152602001600015158152602001600115158152602001876001600160a01b03168152602001898152509050806003600084815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160030160146101000a81548160ff02191690831515021790555060a08201518160030160156101000a81548160ff02191690831515021790555060c08201518160050160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060e0820151816006019080519060200190610974929190610f51565b50505060008281526003602090815260408083206001600160a01b03808a1680865260049092018452828520805460ff191660011790558583015183518f81529384018d9052908b166060840152608083019190915260a0820181905260c0820188905260e08284018181528d51918401919091528c517ff9965df8085b297cc8d3b2470b8e4cc308baa6509a610b4a4ca862292d6b5edc958f958f958f958f958f9591948f9491926101008501928b01918190849084905b83811015610a45578181015183820152602001610a2d565b50505050905090810190601f168015610a725780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390a150610c23565b60008181526003602090815260408083206001600160a01b0388168452600481019092529091205460ff16151560011415610acb57600092505050610cb9565b6003810154600160a01b900460ff1615610aea57600092505050610cb9565b6002810154610afa906001610cc7565b81600201819055506001816004016000876001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507ff9965df8085b297cc8d3b2470b8e4cc308baa6509a610b4a4ca862292d6b5edc898989898986600201548a6040518088815260200180602001878152602001866001600160a01b03168152602001856001600160a01b03168152602001848152602001838152602001828103825288818151815260200191508051906020019080838360005b83811015610be1578181015183820152602001610bc9565b50505050905090810190601f168015610c0e5780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390a1505b600081815260036020819052604082209190610c40908690610d2a565b15610c7557610c70600254610c6a6003610c6460028a610d6c90919063ffffffff16565b90610dc5565b90610cc7565b610c85565b610c856003610c64876002610d6c565b905080826002015410610cb15750600301805460ff60a01b1916600160a01b1790555060019050610cb9565b600093505050505b9695505050505050565b3390565b600082820183811015610d21576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000610d2183836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250610e07565b600082610d7b57506000610d24565b82820282848281610d8857fe5b0414610d215760405162461bcd60e51b81526004018080602001828103825260218152602001806110306021913960400191505060405180910390fd5b6000610d2183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ea6565b60008183610e935760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e58578181015183820152602001610e40565b50505050905090810190601f168015610e855780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50828481610e9d57fe5b06949350505050565b60008183610ef55760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610e58578181015183820152602001610e40565b506000838581610f0157fe5b0495945050505050565b604080516101008101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c082019290925260e081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610f9257805160ff1916838001178555610fbf565b82800160010185558215610fbf579182015b82811115610fbf578251825591602001919060010190610fa4565b50610fcb929150610fcf565b5090565b5b80821115610fcb5760008155600101610fd056fe4d696e7450726f706f73616c3a3a63616c6c6572206973206e6f7420626f72696e6744414f4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212206e7ac1a707c0ac4a9e55bbe5c77a377198a5f7c3c8ee45f34adeb8098fa7728964736f6c634300060c0033
{"success": true, "error": null, "results": {}}
2,168
0x317fbfdb264b57fcef01867c6218ade697614443
/** *Submitted for verification at Etherscan.io on 2021-11-08 */ // ---------------------------------------------------------------------------- // CHARGE Contract // Name : CHARGE // Symbol : CHG // Decimals : 18 // InitialSupply : 70,000,000 CHG // ---------------------------------------------------------------------------- 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 CHARGE is ERC20 { string public constant name = "CHARGE"; string public constant symbol = "CHG"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 70000000 * (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 Mint(address indexed to, uint256 amount); function mint( address _to, uint256 _amount ) public onlyOwner returns (bool) { super._mint(_to, _amount); emit Mint(_to, _amount); return true; } 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."); require(block.timestamp <= _releaseTime, "TokenTimelock: release time is before current time"); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push( LockInfo(_releaseTime, _amount) ); emit Lock(_holder, _amount, _releaseTime); } function lockAfter(address _holder, uint256 _amount, uint256 _afterTime) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push( LockInfo(now + _afterTime, _amount) ); emit Lock(_holder, _amount, now + _afterTime); } 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"); require(block.timestamp <= _releaseTime, "TokenTimelock: release time is before current time"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push( LockInfo(_releaseTime, _value) ); emit Transfer(owner, _to, _value); emit Lock(_to, _value, _releaseTime); return true; } function transferWithLockAfter(address _to, uint256 _value, uint256 _afterTime) 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(now + _afterTime, _value) ); emit Transfer(owner, _to, _value); emit Lock(_to, _value, now + _afterTime); return true; } function currentTime() public view returns (uint256) { return now; } function afterTime(uint256 _value) public view returns (uint256) { return now + _value; } mapping (address => uint256) public airDropHistory; event AirDrop(address _receiver, uint256 _amount); function airdropToken(address[] memory receivers, uint256[] memory values) onlyOwner public { require(receivers.length != 0); require(receivers.length == values.length); for (uint256 i = 0; i < receivers.length; i++) { address receiver = receivers[i]; uint256 amount = values[i]; transfer(receiver, amount); airDropHistory[receiver] += amount; emit AirDrop(receiver, amount); } } }
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80638456cb591161011a578063a9059cbb116100ad578063de6baccb1161007c578063de6baccb1461073c578063df0345861461076e578063e2ab691d14610794578063e5839836146107c6578063f2fde38b146107ec576101fb565b8063a9059cbb146106b4578063ccd28a4c146106e0578063d18e81b314610706578063dd62ed3e1461070e576101fb565b8063927a4a7b116100e9578063927a4a7b1461062257806395d89b41146106545780639dc29fac1461065c578063a457c2d714610688576101fb565b80638456cb591461059e5780638a57af6b146105a65780638d1fdf2f146105d85780638da5cb5b146105fe576101fb565b80633f4ba83a11610192578063554652ce11610161578063554652ce1461041d5780635c975abb1461054457806370a082311461054c5780637eee288d14610572576101fb565b80633f4ba83a1461037c57806340c10f191461038657806345c8b1a6146103b257806346cf1bb5146103d8576101fb565b806323b872dd116101ce57806323b872dd146102f4578063313ce5671461032a578063378dc3dc146103485780633950935114610350576101fb565b806304859ceb1461020057806306fdde031461022f578063095ea7b3146102ac57806318160ddd146102ec575b600080fd5b61021d6004803603602081101561021657600080fd5b5035610812565b60408051918252519081900360200190f35b610237610817565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610271578181015183820152602001610259565b50505050905090810190601f16801561029e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102d8600480360360408110156102c257600080fd5b506001600160a01b03813516906020013561083c565b604080519115158252519081900360200190f35b61021d610852565b6102d86004803603606081101561030a57600080fd5b506001600160a01b03813581169160208101359091169060400135610859565b610332610940565b6040805160ff9092168252519081900360200190f35b61021d610945565b6102d86004803603604081101561036657600080fd5b506001600160a01b038135169060200135610954565b610384610995565b005b6102d86004803603604081101561039c57600080fd5b506001600160a01b038135169060200135610a82565b610384600480360360208110156103c857600080fd5b50356001600160a01b0316610b28565b610404600480360360408110156103ee57600080fd5b506001600160a01b038135169060200135610bd1565b6040805192835260208301919091528051918290030190f35b6103846004803603604081101561043357600080fd5b81019060208101813564010000000081111561044e57600080fd5b82018360208201111561046057600080fd5b8035906020019184602083028401116401000000008311171561048257600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156104d257600080fd5b8201836020820111156104e457600080fd5b8035906020019184602083028401116401000000008311171561050657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610c4a945050505050565b6102d8610d62565b61021d6004803603602081101561056257600080fd5b50356001600160a01b0316610d72565b6103846004803603604081101561058857600080fd5b506001600160a01b038135169060200135610e0c565b6103846110b5565b610384600480360360608110156105bc57600080fd5b506001600160a01b03813516906020810135906040013561119e565b610384600480360360208110156105ee57600080fd5b50356001600160a01b03166112fd565b6106066113a9565b604080516001600160a01b039092168252519081900360200190f35b6102d86004803603606081101561063857600080fd5b506001600160a01b0381351690602081013590604001356113b8565b6102376115b1565b6103846004803603604081101561067257600080fd5b506001600160a01b0381351690602001356115d3565b6102d86004803603604081101561069e57600080fd5b506001600160a01b0381351690602001356116cc565b6102d8600480360360408110156106ca57600080fd5b506001600160a01b038135169060200135611708565b61021d600480360360208110156106f657600080fd5b50356001600160a01b03166117da565b61021d6117ec565b61021d6004803603604081101561072457600080fd5b506001600160a01b03813581169160200135166117f0565b6102d86004803603606081101561075257600080fd5b506001600160a01b03813516906020810135906040013561181b565b61021d6004803603602081101561078457600080fd5b50356001600160a01b0316611a53565b610384600480360360608110156107aa57600080fd5b506001600160a01b038135169060208101359060400135611a6e565b6102d8600480360360208110156107dc57600080fd5b50356001600160a01b0316611c08565b6103846004803603602081101561080257600080fd5b50356001600160a01b0316611c26565b420190565b604051806040016040528060068152602001600160d01b654348415247450281525081565b6000610849338484611c83565b50600192915050565b6002545b90565b600354600090600160a01b900460ff16156108b35760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156109245760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b61092d84611d75565b610938848484611f98565b949350505050565b601281565b6a39e7139a8c08fa0600000081565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610849918590610990908663ffffffff611fea16565b611c83565b6003546001600160a01b031633146109e65760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff16610a475760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546000906001600160a01b03163314610ad65760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610ae08383612047565b6040805183815290516001600160a01b038516917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a250600192915050565b6003546001600160a01b03163314610b795760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b0382166000908152600560205260408120805482919084908110610bf857fe5b600091825260208083206002909202909101546001600160a01b038716835260059091526040909120805485908110610c2d57fe5b906000526020600020906002020160010154915091509250929050565b6003546001600160a01b03163314610c9b5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b8151610ca657600080fd5b8051825114610cb457600080fd5b60005b8251811015610d5d576000838281518110610cce57fe5b602002602001015190506000838381518110610ce657fe5b60200260200101519050610cfa8282611708565b506001600160a01b0382166000818152600660209081526040918290208054850190558151928352820183905280517f2a2f3a6f457f222229acc6b14376a5d3f4344fae935675150a096e2f1056bd989281900390910190a15050600101610cb7565b505050565b600354600160a01b900460ff1681565b600080805b6001600160a01b038416600090815260056020526040902054811015610deb576001600160a01b03841660009081526005602052604090208054610de1919083908110610dc057fe5b90600052602060002090600202016001015483611fea90919063ffffffff16565b9150600101610d77565b50610e0581610df985612128565b9063ffffffff611fea16565b9392505050565b6003546001600160a01b03163314610e5d5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610ecc5760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610f2e919083908110610ef557fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff611fea16565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610f8257fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610fcd57fe5b60009182526020808320600160029093020191909101929092556001600160a01b03841681526005909152604090205460001901811461108c576001600160a01b03821660009081526005602052604090208054600019810190811061102f57fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061106d57fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610d5d90600019830161246a565b6003546001600160a01b031633146111065760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff161561115d5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b031633146111ef5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b816111f984612128565b101561124a5760408051600160e51b62461bcd0281526020600482015260156024820152600160591b742130b630b731b29034b9903a37b79039b6b0b6361702604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054611273908363ffffffff61214316565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186524287018082528184018981528354600181810186559487529585902092516002909602909201948555905193909101929092558351868152908101919091528251919260008051602061253983398151915292918290030190a2505050565b6003546001600160a01b0316331461134e5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b6003546000906001600160a01b0316331461140c5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841661145d5760408051600160e51b62461bcd02815260206004820152600d6024820152600160981b6c77726f6e67206164647265737302604482015290519081900360640190fd5b600354611472906001600160a01b0316612128565b8311156114c15760408051600160e51b62461bcd0281526020600482015260126024820152600160701b714e6f7420656e6f7567682062616c616e636502604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546114ec908463ffffffff61214316565b600380546001600160a01b03908116600090815260208181526040808320959095558883168083526005825285832086518088018852428a0181528084018b815282546001818101855593875295859020915160029096029091019485555193019290925592548451888152945191949216926000805160206124f8833981519152928290030190a360408051848152428401602082015281516001600160a01b03871692600080516020612539833981519152928290030190a25060019392505050565b604051806040016040528060038152602001600160e81b624348470281525081565b6003546001600160a01b031633146116245760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b61162d82612128565b81111561167f5760408051600160e51b62461bcd0281526020600482015260156024820152600160591b742130b630b731b29034b9903a37b79039b6b0b6361702604482015290519081900360640190fd5b61168982826121a3565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610849918590610990908663ffffffff61214316565b3360009081526004602052604081205460ff16156117705760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff16156117c75760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6117d033611d75565b610e05838361226d565b60066020526000908152604090205481565b4290565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b0316331461186f5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0384166118c05760408051600160e51b62461bcd02815260206004820152600d6024820152600160981b6c77726f6e67206164647265737302604482015290519081900360640190fd5b6003546118d5906001600160a01b0316612128565b8311156119245760408051600160e51b62461bcd0281526020600482015260126024820152600160701b714e6f7420656e6f7567682062616c616e636502604482015290519081900360640190fd5b8142111561196657604051600160e51b62461bcd0281526004018080602001828103825260328152602001806125a26032913960400191505060405180910390fd5b6003546001600160a01b0316600090815260208190526040902054611991908463ffffffff61214316565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b815282546001818101855593875295859020915160029096029091019485555193019290925592548451888152945191949216926000805160206124f8833981519152928290030190a3604080518481526020810184905281516001600160a01b03871692600080516020612539833981519152928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b03163314611abf5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b81611ac984612128565b1015611b1a5760408051600160e51b62461bcd0281526020600482015260156024820152600160591b742130b630b731b29034b9903a37b79039b6b0b6361702604482015290519081900360640190fd5b80421115611b5c57604051600160e51b62461bcd0281526004018080602001828103825260328152602001806125a26032913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b85908363ffffffff61214316565b6001600160a01b03841660008181526020818152604080832094909455600581528382208451808601865286815280830188815282546001818101855593865294849020915160029095029091019384555192019190915582518581529081018490528251919260008051602061253983398151915292918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b03163314611c775760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b611c808161227a565b50565b6001600160a01b038316611ccb57604051600160e51b62461bcd02815260040180806020018281038252602481526020018061257e6024913960400191505060405180910390fd5b6001600160a01b038216611d1357604051600160e51b62461bcd0281526004018080602001828103825260228152602001806124d66022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b038216600090815260056020526040902054811015611f94576001600160a01b0382166000908152600560205260409020805442919083908110611dbf57fe5b90600052602060002090600202016000015411611f8c576001600160a01b03821660009081526005602052604090208054611dff919083908110610ef557fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110611e5357fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110611e9e57fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114611f61576001600160a01b038216600090815260056020526040902080546000198101908110611f0057fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110611f3e57fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b0382166000908152600560205260409020805490611f8a90600019830161246a565b505b600101611d78565b5050565b6000611fa5848484612334565b6001600160a01b038416600090815260016020908152604080832033808552925290912054611fe0918691610990908663ffffffff61214316565b5060019392505050565b600082820183811015610e055760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0382166120a55760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6002546120b8908263ffffffff611fea16565b6002556001600160a01b0382166000908152602081905260409020546120e4908263ffffffff611fea16565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391926000805160206124f88339815191529281900390910190a35050565b6001600160a01b031660009081526020819052604090205490565b60008282111561219d5760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b0382166121eb57604051600160e51b62461bcd0281526004018080602001828103825260218152602001806125186021913960400191505060405180910390fd5b6002546121fe908263ffffffff61214316565b6002556001600160a01b03821660009081526020819052604090205461222a908263ffffffff61214316565b6001600160a01b038316600081815260208181526040808320949094558351858152935191936000805160206124f8833981519152929081900390910190a35050565b6000610849338484612334565b6001600160a01b0381166122d85760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661237c57604051600160e51b62461bcd0281526004018080602001828103825260258152602001806125596025913960400191505060405180910390fd5b6001600160a01b0382166123c457604051600160e51b62461bcd0281526004018080602001828103825260238152602001806124b36023913960400191505060405180910390fd5b6001600160a01b0383166000908152602081905260409020546123ed908263ffffffff61214316565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612422908263ffffffff611fea16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716926000805160206124f883398151915292918290030190a3505050565b815481835581811115610d5d57600083815260209020610d5d916108569160029182028101918502015b808211156124ae5760008082556001820155600201612494565b509056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737349eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373546f6b656e54696d656c6f636b3a2072656c656173652074696d65206973206265666f72652063757272656e742074696d65a165627a7a72305820acb9f3545fee42df269b84dba0db7274fbe05c79ba5351369d46acca96dad8d40029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
2,169
0x5515c767d03c33251187bb04de3419cc7e4c0e0a
pragma solidity ^0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @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; } } /** * @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, Ownable { using SafeMath for uint256; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; uint256 totalSupply_; address public firstMile; modifier onlyFirstMile() { require(firstMile == msg.sender); _; } function setFirstMile(address _address) external onlyOwner { firstMile = _address; } /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public onlyFirstMile 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 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 onlyFirstMile returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public onlyFirstMile 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 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 onlyFirstMile 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 onlyFirstMile 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 Mintable token * @dev Simple ERC20 Token example, with mintable token creation * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @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 ) public hasMintPermission canMint 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() public onlyOwner canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract ConvertibleToken is MintableToken { string public name = "Convertible Token for KEYO"; string public symbol = "CT-KEYO"; uint8 public decimals = 18; }
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010b57806306fdde0314610134578063095ea7b3146101be5780630a93e28c146101e257806318160ddd1461021357806323b872dd1461023a578063313ce5671461026457806340c10f191461028f57806366188463146102b357806370a08231146102d7578063715018a6146102f85780637d64bcb41461030f5780638da5cb5b1461032457806395d89b4114610339578063a9059cbb1461034e578063b16f58fb14610372578063d73dd62314610393578063dd62ed3e146103b7578063f2fde38b146103de575b600080fd5b34801561011757600080fd5b506101206103ff565b604080519115158252519081900360200190f35b34801561014057600080fd5b50610149610420565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018357818101518382015260200161016b565b50505050905090810190601f1680156101b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ca57600080fd5b50610120600160a060020a03600435166024356104ae565b3480156101ee57600080fd5b506101f761052f565b60408051600160a060020a039092168252519081900360200190f35b34801561021f57600080fd5b5061022861053e565b60408051918252519081900360200190f35b34801561024657600080fd5b50610120600160a060020a0360043581169060243516604435610544565b34801561027057600080fd5b506102796106d5565b6040805160ff9092168252519081900360200190f35b34801561029b57600080fd5b50610120600160a060020a03600435166024356106de565b3480156102bf57600080fd5b50610120600160a060020a03600435166024356107f9565b3480156102e357600080fd5b50610228600160a060020a0360043516610905565b34801561030457600080fd5b5061030d610920565b005b34801561031b57600080fd5b5061012061098c565b34801561033057600080fd5b506101f7610a30565b34801561034557600080fd5b50610149610a3f565b34801561035a57600080fd5b50610120600160a060020a0360043516602435610a9a565b34801561037e57600080fd5b5061030d600160a060020a0360043516610b95565b34801561039f57600080fd5b50610120600160a060020a0360043516602435610bdb565b3480156103c357600080fd5b50610228600160a060020a0360043581169060243516610c8e565b3480156103ea57600080fd5b5061030d600160a060020a0360043516610cb9565b60045474010000000000000000000000000000000000000000900460ff1681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104a65780601f1061047b576101008083540402835291602001916104a6565b820191906000526020600020905b81548152906001019060200180831161048957829003601f168201915b505050505081565b600454600090600160a060020a031633146104c857600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600454600160a060020a031681565b60035490565b600454600090600160a060020a0316331461055e57600080fd5b600160a060020a03841660009081526001602052604090205482111561058357600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156105b357600080fd5b600160a060020a03831615156105c857600080fd5b600160a060020a0384166000908152600160205260409020546105f1908363ffffffff610cdc16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610626908363ffffffff610cf316565b600160a060020a03808516600090815260016020908152604080832094909455918716815260028252828120338252909152205461066a908363ffffffff610cdc16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60075460ff1681565b60008054600160a060020a031633146106f657600080fd5b60045474010000000000000000000000000000000000000000900460ff161561071e57600080fd5b600354610731908363ffffffff610cf316565b600355600160a060020a03831660009081526001602052604090205461075d908363ffffffff610cf316565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b6004546000908190600160a060020a0316331461081557600080fd5b50336000908152600260209081526040808320600160a060020a038716845290915290205480831061086a57336000908152600260209081526040808320600160a060020a038816845290915281205561089f565b61087a818463ffffffff610cdc16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600054600160a060020a0316331461093757600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60008054600160a060020a031633146109a457600080fd5b60045474010000000000000000000000000000000000000000900460ff16156109cc57600080fd5b6004805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600054600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104a65780601f1061047b576101008083540402835291602001916104a6565b600454600090600160a060020a03163314610ab457600080fd5b33600090815260016020526040902054821115610ad057600080fd5b600160a060020a0383161515610ae557600080fd5b33600090815260016020526040902054610b05908363ffffffff610cdc16565b3360009081526001602052604080822092909255600160a060020a03851681522054610b37908363ffffffff610cf316565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600054600160a060020a03163314610bac57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600454600090600160a060020a03163314610bf557600080fd5b336000908152600260209081526040808320600160a060020a0387168452909152902054610c29908363ffffffff610cf316565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600054600160a060020a03163314610cd057600080fd5b610cd981610d0c565b50565b60008083831115610cec57600080fd5b5050900390565b600082820183811015610d0557600080fd5b9392505050565b600160a060020a0381161515610d2157600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820bee52e787bd404257801c974558c4244f8bde5e6b0426940d1fe50d88432929c0029
{"success": true, "error": null, "results": {}}
2,170
0xe7d7b37e72510309db27c460378f957b1b04bd5d
pragma solidity ^0.4.19; /** * @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 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 Owned { address private Owner; function Owned() public{ Owner = msg.sender; } function IsOwner(address addr) view public returns(bool) { return Owner == addr; } function TransferOwner(address newOwner) public onlyOwner { Owner = newOwner; } function Terminate() public onlyOwner { selfdestruct(Owner); } modifier onlyOwner(){ require(msg.sender == Owner); _; } } contract EMPR is Owned { using SafeMath for uint256; string public constant name = "empowr"; string public constant symbol = "EMPR"; uint256 public constant decimals = 18; // 18 is the most common number of decimal places bool private tradeable; uint256 private currentSupply; mapping(address => uint256) private balances; mapping(address => mapping(address=> uint256)) private allowed; mapping(address => bool) private lockedAccounts; /* Incoming Ether */ event ReceivedEth(address indexed _from, uint256 _value); //this is the fallback function () payable public { emit ReceivedEth(msg.sender, msg.value); } event TransferredEth(address indexed _to, uint256 _value); function FoundationTransfer(address _to, uint256 amtEth, uint256 amtToken) public onlyOwner { require(address(this).balance >= amtEth && balances[this] >= amtToken ); if(amtEth >0) { _to.transfer(amtEth); emit TransferredEth(_to, amtEth); } if(amtToken > 0) { require(balances[_to] + amtToken > balances[_to]); balances[this] -= amtToken; balances[_to] += amtToken; emit Transfer(this, _to, amtToken); } } /* End Incoming Ether */ function EMPR( ) public { uint256 initialTotalSupply = 500000000; balances[this] = initialTotalSupply * (10**decimals); currentSupply = initialTotalSupply * (10**decimals); emit Transfer(address(0), this, currentSupply); } uint256 constant startTime = 1525132800; // Date.UTC(2018, 4, 1) as seconds uint256 constant startAmt = 95000000; uint256 _lastDayPaid = 0; uint256 _currentMonth = 0; uint256 factor = 10000000; event DayMinted(uint256 day,uint256 val, uint256 now); function DailyMint() public { uint256 day = (now-startTime)/(60*60*24); require(startTime <= now); require(day >= _lastDayPaid); uint256 month = _lastDayPaid/30; if(month > _currentMonth){ _currentMonth += 1; factor = (factor * 99)/100; } uint256 todaysPayout = (((factor * startAmt )/10000000)/30)* (10**decimals); balances[this] +=todaysPayout; currentSupply += todaysPayout; emit Transfer(address(0), this, todaysPayout); emit DayMinted(_lastDayPaid, todaysPayout, now); _lastDayPaid+=1; } function lastDayPaid() public view returns(uint256){ return _lastDayPaid; } function MintToken(uint256 amt) public onlyOwner { currentSupply += amt; balances[this] += amt; emit Transfer(address(0), this, amt); } function DestroyToken(uint256 amt) public onlyOwner { require ( balances[this] >= amt); currentSupply -= amt; balances[this] -= amt; emit Transfer(this,address(0), amt); } event SoldToken(address _buyer, uint256 _value, string note); function BuyToken(address _buyer, uint256 _value, string note) public onlyOwner { require(balances[this] >= _value && balances[_buyer] + _value > balances[_buyer]); emit SoldToken( _buyer, _value, note); balances[this] -= _value; balances[_buyer] += _value; emit Transfer(this, _buyer, _value); } function LockAccount(address toLock) public onlyOwner { lockedAccounts[toLock] = true; } function UnlockAccount(address toUnlock) public onlyOwner { delete lockedAccounts[toUnlock]; } function SetTradeable(bool t) public onlyOwner { tradeable = t; } function IsTradeable() public view returns(bool) { return tradeable; } function totalSupply() constant public returns (uint256) { return currentSupply; } function balanceOf(address _owner) constant public returns (uint256 balance) { return balances[_owner]; } function transfer(address _to, uint256 _value) public notLocked returns (bool success) { require(tradeable); if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { emit Transfer( msg.sender, _to, _value); balances[msg.sender] -= _value; balances[_to] += _value; return true; } else { return false; } } function transferFrom(address _from, address _to, uint _value)public notLocked returns (bool success) { require(!lockedAccounts[_from] && !lockedAccounts[_to]); require(tradeable); if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { emit Transfer( _from, _to, _value); balances[_from] -= _value; allowed[_from][msg.sender] -= _value; balances[_to] += _value; return true; } else { return false; } } /** * @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; } event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); modifier notLocked(){ require (!lockedAccounts[msg.sender]); _; } }
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063052977811461018e57806306fdde03146101b15780630730a3221461023f578063095ea7b31461028a57806318160ddd146102e457806323b872dd1461030d5780632e42b01214610386578063313ce567146103bf578063321de1d4146103e85780635daf8a711461046d578063661884631461049057806370a08231146104ea578063858ac4d8146105375780638aa99826146105705780638e3bd6fa1461059d5780639445eb3a146105c257806395d89b41146105d7578063a9059cbb14610665578063b9c97a44146106bf578063d73dd623146106f8578063d9da76de14610752578063dd0860a814610767578063dd62ed3e146107b8578063ef43143714610824575b3373ffffffffffffffffffffffffffffffffffffffff167f52a6cdf67c40ce333b3d846e4e143db87f71dd7935612a4cafcf6ba76047ca1f346040518082815260200191505060405180910390a2005b341561019957600080fd5b6101af600480803590602001909190505061084d565b005b34156101bc57600080fd5b6101c461096e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102045780820151818401526020810190506101e9565b50505050905090810190601f1680156102315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024a57600080fd5b610288600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080359060200190919050506109a7565b005b341561029557600080fd5b6102ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ca7565b604051808215151515815260200191505060405180910390f35b34156102ef57600080fd5b6102f7610d99565b6040518082815260200191505060405180910390f35b341561031857600080fd5b61036c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610da3565b604051808215151515815260200191505060405180910390f35b341561039157600080fd5b6103bd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111c1565b005b34156103ca57600080fd5b6103d2611277565b6040518082815260200191505060405180910390f35b34156103f357600080fd5b61046b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061127c565b005b341561047857600080fd5b61048e600480803590602001909190505061158c565b005b341561049b57600080fd5b6104d0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506116fb565b604051808215151515815260200191505060405180910390f35b34156104f557600080fd5b610521600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061198c565b6040518082815260200191505060405180910390f35b341561054257600080fd5b61056e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119d5565b005b341561057b57600080fd5b610583611a73565b604051808215151515815260200191505060405180910390f35b34156105a857600080fd5b6105c060048080351515906020019091905050611a89565b005b34156105cd57600080fd5b6105d5611b01565b005b34156105e257600080fd5b6105ea611b96565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062a57808201518184015260208101905061060f565b50505050905090810190601f1680156106575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561067057600080fd5b6106a5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611bcf565b604051808215151515815260200191505060405180910390f35b34156106ca57600080fd5b6106f6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e2b565b005b341561070357600080fd5b610738600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611ed8565b604051808215151515815260200191505060405180910390f35b341561075d57600080fd5b6107656120d4565b005b341561077257600080fd5b61079e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506122a6565b604051808215151515815260200191505060405180910390f35b34156107c357600080fd5b61080e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506122ff565b6040518082815260200191505060405180910390f35b341561082f57600080fd5b610837612386565b6040518082815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108a857600080fd5b8060016000828254019250508190555080600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6040805190810160405280600681526020017f656d706f7772000000000000000000000000000000000000000000000000000081525081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a0257600080fd5b813073ffffffffffffffffffffffffffffffffffffffff163110158015610a68575080600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515610a7357600080fd5b6000821115610b0b578273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610abc57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff167f83007cefb28dc4cfb49f429f899c69d37f8011db578f48da2f64929a79bf67b3836040518082815260200191505060405180910390a25b6000811115610ca257600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610ba257600080fd5b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610dfe57600080fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015610ea25750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1515610ead57600080fd5b600060149054906101000a900460ff161515610ec857600080fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610f93575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b801561101e5750600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401115b156111b5578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a381600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600190506111ba565b600090505b9392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121c57600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601281565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112d757600080fd5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156113a55750600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401115b15156113b057600080fd5b7f0307f82a1d7930932f894f6f841bd41285da9d1374694c831ad1efa591139316838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561144c578082015181840152602081019050611431565b50505050905090810190601f1680156114795780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115e757600080fd5b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561163557600080fd5b8060016000828254039250508190555080600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561180c576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a0565b61181f838261239090919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a3057600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060149054906101000a900460ff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ae457600080fd5b80600060146101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b5c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6040805190810160405280600481526020017f454d50520000000000000000000000000000000000000000000000000000000081525081565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611c2a57600080fd5b600060149054906101000a900460ff161515611c4557600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611d135750600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401115b15611e20578273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a381600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060019050611e25565b600090505b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e8657600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905550565b6000611f6982600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123a990919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600080600062015180635ae7ae0042038115156120ed57fe5b04925042635ae7ae001115151561210357600080fd5b600554831015151561211457600080fd5b601e60055481151561212257fe5b049150600654821115612159576001600660008282540192505081905550606460636007540281151561215157fe5b046007819055505b6012600a0a601e629896806305a995c06007540281151561217657fe5b0481151561218057fe5b0402905080600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a37f2bd46683d2f09f7082e2121b94af20e57d4ebfc802b67f4bb92d31adf4c1dbc3600554824260405180848152602001838152602001828152602001935050505060405180910390a16001600560008282540192505081905550505050565b60008173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600554905090565b600082821115151561239e57fe5b818303905092915050565b60008082840190508381101515156123bd57fe5b80915050929150505600a165627a7a723058206d651396edf616eb5aaa5868411fa8f4427c55c8eab3b171ea9d50143add980a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
2,171
0x9c135c96e665a2b788f3c31c20317c30e0260d9f
// SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'GENESIS' contract // // Symbol : Gen // Name : GENESIS // Total supply: 1 000 000 000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract GENESIS is BurnableToken { string public constant name = "GENESIS"; string public constant symbol = "Gen"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } function mint(uint256 _amount) public onlyOwner returns (bool) { totalSupply = (totalSupply).add(_amount); balances[owner] +=_amount; return true; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a9059cbb11610066578063a9059cbb146104af578063d73dd62314610513578063dd62ed3e14610577578063f2fde38b146105ef57610100565b806370a082311461035c5780638da5cb5b146103b457806395d89b41146103e8578063a0712d681461046b57610100565b8063313ce567116100d3578063313ce5671461028e578063378dc3dc146102ac57806342966c68146102ca57806366188463146102f857610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d610633565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066c565b60405180821515815260200191505060405180910390f35b6101f461075e565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610764565b60405180821515815260200191505060405180910390f35b610296610a4e565b6040518082815260200191505060405180910390f35b6102b4610a53565b6040518082815260200191505060405180910390f35b6102f6600480360360208110156102e057600080fd5b8101908080359060200190929190505050610a61565b005b6103446004803603604081101561030e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c27565b60405180821515815260200191505060405180910390f35b61039e6004803603602081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb8565b6040518082815260200191505060405180910390f35b6103bc610f01565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103f0610f25565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610430578082015181840152602081019050610415565b50505050905090810190601f16801561045d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104976004803603602081101561048157600080fd5b8101908080359060200190929190505050610f5e565b60405180821515815260200191505060405180910390f35b6104fb600480360360408110156104c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061104b565b60405180821515815260200191505060405180910390f35b61055f6004803603604081101561052957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061121f565b60405180821515815260200191505060405180910390f35b6105d96004803603604081101561058d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061141b565b6040518082815260200191505060405180910390f35b6106316004803603602081101561060557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114a2565b005b6040518060400160405280600781526020017f47454e455349530000000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561079f57600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061087283600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f190919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090783600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095d83826115f190919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a633b9aca000281565b60008111610a6e57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610aba57600080fd5b6000339050610b1182600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f190919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b69826001546115f190919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d38576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dcc565b610d4b83826115f190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f47656e000000000000000000000000000000000000000000000000000000000081525081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fb957600080fd5b610fce8260015461160890919063ffffffff16565b60018190555081600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561108657600080fd5b6110d882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061116d82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160890919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006112b082600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160890919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114fa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561153457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156115fd57fe5b818303905092915050565b60008082840190508381101561161a57fe5b809150509291505056fea264697066735822122049930d0d3038c58c77832e61f02cb5d9aca41e528c92494ec385b56c287c626364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
2,172
0xDd1711f93D05898065d9cF47f99886Cd18cD7C06
/** JOE ROGAN TOKEN Telegram : Https://t.me/JoeRoganERC */ // 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 JOEROGAN is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "JOE ROGAN"; string private constant _symbol = "ROGAN"; 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 = 9; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 9; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x33A041CB49Cf8FaBcACfF823DaF0B959AC6F6bB8); address payable private _marketingAddress = payable(0x33A041CB49Cf8FaBcACfF823DaF0B959AC6F6bB8); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000 * 10**9; uint256 public _maxWalletSize = 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104b057600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105fb565b005b34801561020a57600080fd5b506040805180820190915260098152682527a2902927a3a0a760b91b60208201525b6040516102399190611a24565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a79565b61069a565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611aa5565b6106b1565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601554610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ae6565b61071a565b34801561036d57600080fd5b506101fc61037c366004611b13565b610765565b34801561038d57600080fd5b506101fc6107ad565b3480156103a257600080fd5b506102c16103b1366004611ae6565b6107f8565b3480156103c257600080fd5b506101fc61081a565b3480156103d757600080fd5b506101fc6103e6366004611b2e565b61088e565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ae6565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611b13565b6108bd565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506040805180820190915260058152642927a3a0a760d91b602082015261022c565b3480156104bc57600080fd5b506101fc6104cb366004611b2e565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b47565b610934565b3480156104fc57600080fd5b5061026261050b366004611a79565b610972565b34801561051c57600080fd5b5061026261052b366004611ae6565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b79565b6109d3565b34801561058157600080fd5b506102c1610590366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b2e565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ae6565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c36565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c97565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c36565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c36565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c36565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c36565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c6b565b9050602002016020810190610a349190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c97565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c36565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c36565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611cb2565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461146e565b600081848411156112115760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261149c565b90506112de83826114bf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138157600080fd5b505afa158015611395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b99190611ce1565b816001815181106113cc576113cc611c6b565b6001600160a01b0392831660209182029290920101526014546113f29130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147b5761147b611501565b61148684848461152f565b80610a6e57610a6e600e54600c55600f54600d55565b60008060006114a9611626565b90925090506114b882826114bf565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c541580156115115750600d54155b1561151857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154187611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157390876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a29086611733565b6001600160a01b0389166000908152600260205260409020556115c481611792565b6115ce84836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164182826114bf565b82101561165d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106259190611a24565b50600061121e8486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149c565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b6000806117408385611cb2565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061179c61149c565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114bf565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106ab565b60006118c08385611d91565b9050826118cd8583611d6f565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112de8161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112de82611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112de8161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122005cd427b62ac0508e549863b0f98b354d6df73325ad171912f509b24819c7f7964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,173
0xcc3277446f0e0ca9b8dac67c780f68551828ad1b
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @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) public 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) public 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) public 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) public 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) public 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) public 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) public 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) public pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev savix interest and supply calculations. * */ library SavixSupply { uint256 public constant MAX_UINT256 = 2**256 - 1; uint256 public constant MAX_UINT128 = 2**128 - 1; uint public constant MINTIMEWIN = 7200; // 2 hours uint public constant SECPERDAY = 3600 * 24; uint public constant DECIMALS = 9; struct SupplyWinBoundary { uint256 x1; uint256 x2; uint256 y1; uint256 y2; } function getSupplyWindow(uint256[2][] memory map, uint256 calcTime) internal pure returns (SupplyWinBoundary memory) { SupplyWinBoundary memory winBound; winBound.x1 = 0; winBound.x2 = 0; winBound.y1 = map[0][1]; winBound.y2 = 0; for (uint i=0; i < map.length; i++) { if (map[i][0] == 0) continue; if (calcTime < map[i][0]) { winBound.x2 = map[i][0]; winBound.y2 = map[i][1]; break; } else { winBound.x1 = map[i][0]; winBound.y1 = map[i][1]; } } if (winBound.x2 == 0) winBound.x2 = MAX_UINT128; if (winBound.y2 == 0) winBound.y2 = MAX_UINT128; return winBound; } // function to calculate new Supply with SafeMath for divisions only, shortest (cheapest) form function getAdjustedSupply(uint256[2][] memory map, uint256 transactionTime, uint constGradient) internal pure returns (uint256) { if (transactionTime >= map[map.length-1][0]) { // return (map[map.length-1][1] + constGradient * (SafeMath.sub(transactionTime, map[map.length-1][0]))); ** old version return (map[map.length-1][1] + SafeMath.mul(constGradient, SafeMath.sub(transactionTime, map[map.length-1][0]))); } SupplyWinBoundary memory winBound = getSupplyWindow(map, transactionTime); // return (winBound.y1 + SafeMath.div(winBound.y2 - winBound.y1, winBound.x2 - winBound.x1) * (transactionTime - winBound.x1)); ** old version return (winBound.y1 + SafeMath.div(SafeMath.mul(SafeMath.sub(winBound.y2, winBound.y1), SafeMath.sub(transactionTime, winBound.x1)), SafeMath.sub(winBound.x2, winBound.x1))); } function getDailyInterest(uint256 currentTime, uint256 lastAdjustTime, uint256 currentSupply, uint256 lastSupply) internal pure returns (uint) { if (currentTime <= lastAdjustTime) { return uint128(0); } // ** old version // uint256 InterestSinceLastAdjust = SafeMath.div((currentSupply - lastSupply) * 100, lastSupply); // return (SafeMath.div(InterestSinceLastAdjust * SECPERDAY, currentTime - lastAdjustTime)); return (SafeMath.div(SafeMath.sub(currentSupply, lastSupply) * 100 * 10**DECIMALS * SECPERDAY, SafeMath.mul(SafeMath.sub(currentTime, lastAdjustTime), lastSupply))); } // ** new method // yearlyInterest rate is given in percent with 2 decimals => result has to be divede by 10**9 to get correct number with precision 2 function getYearlyInterest(uint256 currentTime, uint256 lastAdjustTime, uint256 currentSupply, uint256 lastSupply) internal pure returns (uint) { if (currentTime <= lastAdjustTime) { return uint128(0); } return (SafeMath.div(SafeMath.sub(currentSupply, lastSupply) * 100 * 10**DECIMALS * SECPERDAY * 360, SafeMath.mul(SafeMath.sub(currentTime, lastAdjustTime), lastSupply))); } }
0x73cc3277446f0e0ca9b8dac67c780f68551828ad1b30146080604052600436106100615760003560e01c80632e0f26251461006657806333a581d21461008457806352631aea146100a2578063587b75a3146100c0578063f472559d146100de575b600080fd5b61006e6100fc565b6040518082815260200191505060405180910390f35b61008c610101565b6040518082815260200191505060405180910390f35b6100aa610125565b6040518082815260200191505060405180910390f35b6100c8610139565b6040518082815260200191505060405180910390f35b6100e661013f565b6040518082815260200191505060405180910390f35b600981565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6fffffffffffffffffffffffffffffffff81565b611c2081565b620151808156fea2646970667358221220e4d13c58364136971f6a15289dd99db25cf149fca970bc3cc6e4dfe57313140164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
2,174
0x8c04af9490966d446e2529c14bf90e528aff4714
/* _ _________ _______ _______ |\ /|( ( /|\__ __/( ___ )|\ /|( ____ \ | ) ( || \ ( | ) ( | ( ) || ) ( || ( \/ | | | || \ | | | | | | | || | | || (__ | | | || (\ \) | | | | | | || | | || __) | | | || | \ | | | | | /\| || | | || ( | (___) || ) \ |___) (___| (_\ \ || (___) || (____/\ (_______)|/ )_)\_______/(____\/_)(_______)(_______/ _______ _ _______ ( ___ )( ( /|( ____ \ | ( ) || \ ( || ( \/ | | | || \ | || (__ | | | || (\ \) || __) | | | || | \ || ( | (___) || ) \ || (____/\ (_______)|/ )_)(_______/ _______ _______ _________ _______ ( ____ )|\ /|( ___ )\__ __/( ___ ) | ( )|| ) ( || ( ) | ) ( | ( ) | | (____)|| (___) || | | | | | | | | | | _____)| ___ || | | | | | | | | | | ( | ( ) || | | | | | | | | | | ) | ) ( || (___) | | | | (___) | |/ |/ \|(_______) )_( (_______) https://uniqueone.photo */ pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; } /** * @dev Remove an account's access to this role. */ function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; } /** * @dev Check if an account has this role. * @return bool */ function has(Role storage role, address account) internal view returns (bool) { require(account != address(0), "Roles: account is the zero address"); return role.bearer[account]; } } contract OperatorRole is Context { using Roles for Roles.Role; event OperatorAdded(address indexed account); event OperatorRemoved(address indexed account); Roles.Role private _operators; constructor () internal { } modifier onlyOperator() { require(isOperator(_msgSender()), "OperatorRole: caller does not have the Operator role"); _; } function isOperator(address account) public view returns (bool) { return _operators.has(account); } function _addOperator(address account) internal { _operators.add(account); emit OperatorAdded(account); } function _removeOperator(address account) internal { _operators.remove(account); emit OperatorRemoved(account); } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract OwnableOperatorRole is Ownable, OperatorRole { function addOperator(address account) public onlyOwner { _addOperator(account); } function removeOperator(address account) public onlyOwner { _removeOperator(account); } } contract ERC1155SaleNonceHolder is OwnableOperatorRole { // keccak256(token, owner, tokenId) => nonce mapping(bytes32 => uint256) public nonces; // keccak256(token, owner, tokenId, nonce) => completed amount mapping(bytes32 => uint256) public completed; function getNonce(address token, uint256 tokenId, address owner) view public returns (uint256) { return nonces[getNonceKey(token, tokenId, owner)]; } function setNonce(address token, uint256 tokenId, address owner, uint256 nonce) public onlyOperator { nonces[getNonceKey(token, tokenId, owner)] = nonce; } function getNonceKey(address token, uint256 tokenId, address owner) pure public returns (bytes32) { return keccak256(abi.encodePacked(token, tokenId, owner)); } function getCompleted(address token, uint256 tokenId, address owner, uint256 nonce) view public returns (uint256) { return completed[getCompletedKey(token, tokenId, owner, nonce)]; } function setCompleted(address token, uint256 tokenId, address owner, uint256 nonce, uint256 _completed) public onlyOperator { completed[getCompletedKey(token, tokenId, owner, nonce)] = _completed; } function getCompletedKey(address token, uint256 tokenId, address owner, uint256 nonce) pure public returns (bytes32) { return keccak256(abi.encodePacked(token, tokenId, owner, nonce)); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80638da5cb5b11610097578063ac8a584a11610066578063ac8a584a146102df578063e157b58c14610305578063f2fde38b1461033f578063f6419d9614610365576100f5565b80638da5cb5b146102705780638f32d59b146102945780639870d7fe1461029c5780639e317f12146102c2576100f5565b80634bd49ccb116100d35780634bd49ccb146101b45780636d70f7ae146101f4578063715018a61461022e5780637ad2ec8514610236576100f5565b806308345fbf146100fa5780631702c4bd146101365780634a15b6621461017e575b600080fd5b6101346004803603608081101561011057600080fd5b506001600160a01b0381358116916020810135916040820135169060600135610382565b005b61016c6004803603606081101561014c57600080fd5b506001600160a01b038135811691602081013591604090910135166103f4565b60408051918252519081900360200190f35b61016c6004803603606081101561019457600080fd5b506001600160a01b03813581169160208101359160409091013516610443565b610134600480360360a08110156101ca57600080fd5b506001600160a01b038135811691602081013591604082013516906060810135906080013561046c565b61021a6004803603602081101561020a57600080fd5b50356001600160a01b03166104db565b604080519115158252519081900360200190f35b6101346104f4565b61016c6004803603608081101561024c57600080fd5b506001600160a01b0381358116916020810135916040820135169060600135610585565b6102786105b0565b604080516001600160a01b039092168252519081900360200190f35b61021a6105bf565b610134600480360360208110156102b257600080fd5b50356001600160a01b03166105e3565b61016c600480360360208110156102d857600080fd5b5035610636565b610134600480360360208110156102f557600080fd5b50356001600160a01b0316610648565b61016c6004803603608081101561031b57600080fd5b506001600160a01b0381358116916020810135916040820135169060600135610698565b6101346004803603602081101561035557600080fd5b50356001600160a01b03166106f0565b61016c6004803603602081101561037b57600080fd5b5035610740565b61039261038d610752565b6104db565b6103cd5760405162461bcd60e51b81526004018080602001828103825260348152602001806109fc6034913960400191505060405180910390fd5b80600260006103dd8787876103f4565b815260208101919091526040016000205550505050565b604080516bffffffffffffffffffffffff19606095861b811660208084019190915260348301959095529290941b90911660548401528051604881850301815260689093019052815191012090565b6000600260006104548686866103f4565b81526020019081526020016000205490509392505050565b61047761038d610752565b6104b25760405162461bcd60e51b81526004018080602001828103825260348152602001806109fc6034913960400191505060405180910390fd5b80600360006104c388888888610698565b81526020810191909152604001600020555050505050565b60006104ee60018363ffffffff61075616565b92915050565b6104fc6105bf565b61053b576040805162461bcd60e51b81526020600482018190526024820152600080516020610a51833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006003600061059787878787610698565b8152602001908152602001600020549050949350505050565b6000546001600160a01b031690565b600080546001600160a01b03166105d4610752565b6001600160a01b031614905090565b6105eb6105bf565b61062a576040805162461bcd60e51b81526020600482018190526024820152600080516020610a51833981519152604482015290519081900360640190fd5b610633816107bd565b50565b60026020526000908152604090205481565b6106506105bf565b61068f576040805162461bcd60e51b81526020600482018190526024820152600080516020610a51833981519152604482015290519081900360640190fd5b61063381610805565b604080516bffffffffffffffffffffffff19606096871b811660208084019190915260348301969096529390951b90921660548501526068808501919091528151808503909101815260889093019052815191012090565b6106f86105bf565b610737576040805162461bcd60e51b81526020600482018190526024820152600080516020610a51833981519152604482015290519081900360640190fd5b6106338161084d565b60036020526000908152604090205481565b3390565b60006001600160a01b03821661079d5760405162461bcd60e51b8152600401808060200182810382526022815260200180610a716022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b6107ce60018263ffffffff6108ed16565b6040516001600160a01b038216907fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d90600090a250565b61081660018263ffffffff61096e16565b6040516001600160a01b038216907f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d90600090a250565b6001600160a01b0381166108925760405162461bcd60e51b81526004018080602001828103825260268152602001806109d66026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6108f78282610756565b15610949576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6109788282610756565b6109b35760405162461bcd60e51b8152600401808060200182810382526021815260200180610a306021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff1916905556fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204f70657261746f7220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373a265627a7a723158200e70ca5f7b06cfad48d88f62216ea14d31653cc1c4d8409d7401557531293a3e64736f6c63430005100032
{"success": true, "error": null, "results": {}}
2,175
0x35f06858577b526a9351C6d42c89748281b6FE30
pragma solidity ^0.4.16; 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 TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 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 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); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20() public { totalSupply = 21000000 * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = "COSS Exchange Liquidity Token"; // Set the name for display purposes symbol = "CELT"; // Set the symbol for display purposes _transfer(msg.sender, this, 10000000 * 10 ** uint256(decimals)); } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; 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 { _transfer(msg.sender, _to, _value); } /** * 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; 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; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public 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 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); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract MyAdvancedToken is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ function MyAdvancedToken() TokenERC20() public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(_from, _to, _value); } /// @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; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /// @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 public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract 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; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * 10 ** uint256(decimals) / sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * 10 ** uint256(decimals) / sellPrice ); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } }
0x60606040523615610126576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461012b57806306fdde0314610157578063095ea7b3146101e657806318160ddd1461024057806323b872dd14610269578063313ce567146102e257806342966c68146103115780634b7503341461034c57806370a082311461037557806379c65068146103c257806379cc6790146104045780638620410b1461045e5780638da5cb5b1461048757806395d89b41146104dc578063a6f2ae3a1461056b578063a9059cbb14610575578063b414d4b6146105b7578063cae9ca5114610608578063dd62ed3e146106a5578063e4849b3214610711578063e724529c14610734578063f2fde38b14610778575b600080fd5b341561013657600080fd5b61015560048080359060200190919080359060200190919050506107b1565b005b341561016257600080fd5b61016a610820565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ab5780820151818401525b60208101905061018f565b50505050905090810190601f1680156101d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f157600080fd5b610226600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108be565b604051808215151515815260200191505060405180910390f35b341561024b57600080fd5b61025361094c565b6040518082815260200191505060405180910390f35b341561027457600080fd5b6102c8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610952565b604051808215151515815260200191505060405180910390f35b34156102ed57600080fd5b6102f5610a80565b604051808260ff1660ff16815260200191505060405180910390f35b341561031c57600080fd5b6103326004808035906020019091905050610a93565b604051808215151515815260200191505060405180910390f35b341561035757600080fd5b61035f610b98565b6040518082815260200191505060405180910390f35b341561038057600080fd5b6103ac600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b9e565b6040518082815260200191505060405180910390f35b34156103cd57600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bb6565b005b341561040f57600080fd5b610444600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d29565b604051808215151515815260200191505060405180910390f35b341561046957600080fd5b610471610f44565b6040518082815260200191505060405180910390f35b341561049257600080fd5b61049a610f4a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104e757600080fd5b6104ef610f6f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105305780820151818401525b602081019050610514565b50505050905090810190601f16801561055d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61057361100d565b005b341561058057600080fd5b6105b5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611025565b005b34156105c257600080fd5b6105ee600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611035565b604051808215151515815260200191505060405180910390f35b341561061357600080fd5b61068b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611055565b604051808215151515815260200191505060405180910390f35b34156106b057600080fd5b6106fb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111d4565b6040518082815260200191505060405180910390f35b341561071c57600080fd5b61073260048080359060200190919050506111f9565b005b341561073f57600080fd5b610776600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506112b6565b005b341561078357600080fd5b6107af600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113dd565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561080c57600080fd5b81600781905550806008819055505b5b5050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108b65780601f1061088b576101008083540402835291602001916108b6565b820191906000526020600020905b81548152906001019060200180831161089957829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190505b92915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109df57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610a7484848461147d565b600190505b9392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610ae357600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600190505b919050565b60075481565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1157600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b5b5050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610d7957600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e0457600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600190505b92915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110055780601f10610fda57610100808354040283529160200191611005565b820191906000526020600020905b815481529060010190602001808311610fe857829003601f168201915b505050505081565b60006008543402905061102130338361147d565b5b50565b61103033838361147d565b5b5050565b60096020528060005260406000206000915054906101000a900460ff1681565b60008084905061106585856108be565b156111cb578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111605780820151818401525b602081019050611144565b50505050905090810190601f16801561118d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15156111ae57600080fd5b6102c65a03f115156111bf57600080fd5b505050600191506111cc565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b600754600360009054906101000a900460ff1660ff16600a0a820281151561121d57fe5b043073ffffffffffffffffffffffffffffffffffffffff16311015151561124357600080fd5b61124e33308361147d565b3373ffffffffffffffffffffffffffffffffffffffff166108fc600754600360009054906101000a900460ff1660ff16600a0a840281151561128c57fe5b049081150290604051600060405180830381858888f1935050505015156112b257600080fd5b5b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131157600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143857600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b60008273ffffffffffffffffffffffffffffffffffffffff16141515156114a357600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156114f157600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015151561158057600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156115d957600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561163257600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b5050505600a165627a7a723058203b25346f014903ef93348cc92de201a5347ed68daf52a189150b554827fe90ec0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
2,176
0x4b84f61a8ec3b81a1a12a660403e8e87f8507a65
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ // SPDX-License-Identifier: Unlicensed //10000CULT // Telegram: https//t.me/CULT100000 ( 5 of zero) //Supply: 10,000 // 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 CULT10000 is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "10000CULT"; string private constant _symbol = "10000CULT"; 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 = 10000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 0; 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(0x65Ce5c2C79c7442928a71Da40aFDF62922F97D2B); address payable private _marketingAddress = payable(0x65Ce5c2C79c7442928a71Da40aFDF62922F97D2B); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000001 * 10**9; uint256 public _maxWalletSize = 1000000001 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610522578063dd62ed3e14610542578063ea1644d514610588578063f2fde38b146105a857600080fd5b8063a2a957bb1461049d578063a9059cbb146104bd578063bfd79284146104dd578063c3c8cd801461050d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104475780638f9a55c01461046757806395d89b41146101fe57806398a5c3151461047d57600080fd5b80637d1db4a5146103e65780637f2feddc146103fc5780638da5cb5b1461042957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037c57806370a0823114610391578063715018a6146103b157806374010ece146103c657600080fd5b8063313ce5671461030057806349bd5a5e1461031c5780636b9990531461033c5780636d8aa8f81461035c57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102ca5780632fd689e3146102ea57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461191c565b6105c8565b005b34801561020a57600080fd5b5060408051808201825260098152680c4c0c0c0c10d5531560ba1b6020820152905161023691906119e1565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a36565b610667565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b506509184e72a0005b604051908152602001610236565b3480156102d657600080fd5b5061025f6102e5366004611a62565b61067e565b3480156102f657600080fd5b506102bc60185481565b34801561030c57600080fd5b5060405160098152602001610236565b34801561032857600080fd5b5060155461028f906001600160a01b031681565b34801561034857600080fd5b506101fc610357366004611aa3565b6106e7565b34801561036857600080fd5b506101fc610377366004611ad0565b610732565b34801561038857600080fd5b506101fc61077a565b34801561039d57600080fd5b506102bc6103ac366004611aa3565b6107c5565b3480156103bd57600080fd5b506101fc6107e7565b3480156103d257600080fd5b506101fc6103e1366004611aeb565b61085b565b3480156103f257600080fd5b506102bc60165481565b34801561040857600080fd5b506102bc610417366004611aa3565b60116020526000908152604090205481565b34801561043557600080fd5b506000546001600160a01b031661028f565b34801561045357600080fd5b506101fc610462366004611ad0565b61088a565b34801561047357600080fd5b506102bc60175481565b34801561048957600080fd5b506101fc610498366004611aeb565b6108d2565b3480156104a957600080fd5b506101fc6104b8366004611b04565b610901565b3480156104c957600080fd5b5061025f6104d8366004611a36565b61093f565b3480156104e957600080fd5b5061025f6104f8366004611aa3565b60106020526000908152604090205460ff1681565b34801561051957600080fd5b506101fc61094c565b34801561052e57600080fd5b506101fc61053d366004611b36565b6109a0565b34801561054e57600080fd5b506102bc61055d366004611bba565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059457600080fd5b506101fc6105a3366004611aeb565b610a41565b3480156105b457600080fd5b506101fc6105c3366004611aa3565b610a70565b6000546001600160a01b031633146105fb5760405162461bcd60e51b81526004016105f290611bf3565b60405180910390fd5b60005b81518110156106635760016010600084848151811061061f5761061f611c28565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065b81611c54565b9150506105fe565b5050565b6000610674338484610b5a565b5060015b92915050565b600061068b848484610c7e565b6106dd84336106d885604051806060016040528060288152602001611d6c602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ba565b610b5a565b5060019392505050565b6000546001600160a01b031633146107115760405162461bcd60e51b81526004016105f290611bf3565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075c5760405162461bcd60e51b81526004016105f290611bf3565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107af57506013546001600160a01b0316336001600160a01b0316145b6107b857600080fd5b476107c2816111f4565b50565b6001600160a01b0381166000908152600260205260408120546106789061122e565b6000546001600160a01b031633146108115760405162461bcd60e51b81526004016105f290611bf3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108855760405162461bcd60e51b81526004016105f290611bf3565b601655565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016105f290611bf3565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fc5760405162461bcd60e51b81526004016105f290611bf3565b601855565b6000546001600160a01b0316331461092b5760405162461bcd60e51b81526004016105f290611bf3565b600893909355600a91909155600955600b55565b6000610674338484610c7e565b6012546001600160a01b0316336001600160a01b0316148061098157506013546001600160a01b0316336001600160a01b0316145b61098a57600080fd5b6000610995306107c5565b90506107c2816112b2565b6000546001600160a01b031633146109ca5760405162461bcd60e51b81526004016105f290611bf3565b60005b82811015610a3b5781600560008686858181106109ec576109ec611c28565b9050602002016020810190610a019190611aa3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3381611c54565b9150506109cd565b50505050565b6000546001600160a01b03163314610a6b5760405162461bcd60e51b81526004016105f290611bf3565b601755565b6000546001600160a01b03163314610a9a5760405162461bcd60e51b81526004016105f290611bf3565b6001600160a01b038116610aff5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b6001600160a01b038216610c1d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f2565b6001600160a01b038216610d445760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f2565b60008111610da65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f2565b6000546001600160a01b03848116911614801590610dd257506000546001600160a01b03838116911614155b156110b357601554600160a01b900460ff16610e6b576000546001600160a01b03848116911614610e6b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f2565b601654811115610ebd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f2565b6001600160a01b03831660009081526010602052604090205460ff16158015610eff57506001600160a01b03821660009081526010602052604090205460ff16155b610f575760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f2565b6015546001600160a01b03838116911614610fdc5760175481610f79846107c5565b610f839190611c6d565b10610fdc5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f2565b6000610fe7306107c5565b6018546016549192508210159082106110005760165491505b8080156110175750601554600160a81b900460ff16155b801561103157506015546001600160a01b03868116911614155b80156110465750601554600160b01b900460ff165b801561106b57506001600160a01b03851660009081526005602052604090205460ff16155b801561109057506001600160a01b03841660009081526005602052604090205460ff16155b156110b05761109e826112b2565b4780156110ae576110ae476111f4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f557506001600160a01b03831660009081526005602052604090205460ff165b8061112757506015546001600160a01b0385811691161480159061112757506015546001600160a01b03848116911614155b15611134575060006111ae565b6015546001600160a01b03858116911614801561115f57506014546001600160a01b03848116911614155b1561117157600854600c55600954600d555b6015546001600160a01b03848116911614801561119c57506014546001600160a01b03858116911614155b156111ae57600a54600c55600b54600d555b610a3b8484848461142c565b600081848411156111de5760405162461bcd60e51b81526004016105f291906119e1565b5060006111eb8486611c85565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610663573d6000803e3d6000fd5b60006006548211156112955760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f2565b600061129f61145a565b90506112ab838261147d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fa576112fa611c28565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113779190611c9c565b8160018151811061138a5761138a611c28565b6001600160a01b0392831660209182029290920101526014546113b09130911684610b5a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113e9908590600090869030904290600401611cb9565b600060405180830381600087803b15801561140357600080fd5b505af1158015611417573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611439576114396114bf565b6114448484846114ed565b80610a3b57610a3b600e54600c55600f54600d55565b60008060006114676115e4565b9092509050611476828261147d565b9250505090565b60006112ab83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611620565b600c541580156114cf5750600d54155b156114d657565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806114ff8761164e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061153190876116ab565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156090866116ed565b6001600160a01b0389166000908152600260205260409020556115828161174c565b61158c8483611796565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115d191815260200190565b60405180910390a3505050505050505050565b60065460009081906509184e72a0006115fd828261147d565b821015611617575050600654926509184e72a00092509050565b90939092509050565b600081836116415760405162461bcd60e51b81526004016105f291906119e1565b5060006111eb8486611d2a565b600080600080600080600080600061166b8a600c54600d546117ba565b925092509250600061167b61145a565b9050600080600061168e8e87878761180f565b919e509c509a509598509396509194505050505091939550919395565b60006112ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ba565b6000806116fa8385611c6d565b9050838110156112ab5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f2565b600061175661145a565b90506000611764838361185f565b3060009081526002602052604090205490915061178190826116ed565b30600090815260026020526040902055505050565b6006546117a390836116ab565b6006556007546117b390826116ed565b6007555050565b60008080806117d460646117ce898961185f565b9061147d565b905060006117e760646117ce8a8961185f565b905060006117ff826117f98b866116ab565b906116ab565b9992985090965090945050505050565b600080808061181e888661185f565b9050600061182c888761185f565b9050600061183a888861185f565b9050600061184c826117f986866116ab565b939b939a50919850919650505050505050565b60008260000361187157506000610678565b600061187d8385611d4c565b90508261188a8583611d2a565b146112ab5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f2565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c257600080fd5b8035611917816118f7565b919050565b6000602080838503121561192f57600080fd5b823567ffffffffffffffff8082111561194757600080fd5b818501915085601f83011261195b57600080fd5b81358181111561196d5761196d6118e1565b8060051b604051601f19603f83011681018181108582111715611992576119926118e1565b6040529182528482019250838101850191888311156119b057600080fd5b938501935b828510156119d5576119c68561190c565b845293850193928501926119b5565b98975050505050505050565b600060208083528351808285015260005b81811015611a0e578581018301518582016040015282016119f2565b81811115611a20576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a4957600080fd5b8235611a54816118f7565b946020939093013593505050565b600080600060608486031215611a7757600080fd5b8335611a82816118f7565b92506020840135611a92816118f7565b929592945050506040919091013590565b600060208284031215611ab557600080fd5b81356112ab816118f7565b8035801515811461191757600080fd5b600060208284031215611ae257600080fd5b6112ab82611ac0565b600060208284031215611afd57600080fd5b5035919050565b60008060008060808587031215611b1a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b4b57600080fd5b833567ffffffffffffffff80821115611b6357600080fd5b818601915086601f830112611b7757600080fd5b813581811115611b8657600080fd5b8760208260051b8501011115611b9b57600080fd5b602092830195509350611bb19186019050611ac0565b90509250925092565b60008060408385031215611bcd57600080fd5b8235611bd8816118f7565b91506020830135611be8816118f7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c6657611c66611c3e565b5060010190565b60008219821115611c8057611c80611c3e565b500190565b600082821015611c9757611c97611c3e565b500390565b600060208284031215611cae57600080fd5b81516112ab816118f7565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d095784516001600160a01b031683529383019391830191600101611ce4565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d4757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d6657611d66611c3e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b9019a64d3939c80b01985030fe2ddbe71a336f9e59b5725ed604da3dc75c40f64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,177
0xa434cd109542267279bb761271f793e3701441f9
//"SPDX-License-Identifier: MIT" pragma solidity >=0.6.0 <0.8.0; //@title: EASYPumpToken /** * @dev Interface ofƒice 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 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 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 trecipient, uint256 amount) external returns (bool); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev 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; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ abstract contract ERC20Detailed is IERC20 { uint8 private _Tokendecimals; string private _Tokenname; string private _Tokensymbol; constructor(string memory name, string memory symbol, uint8 decimals) public { _Tokendecimals = decimals; _Tokenname = name; _Tokensymbol = symbol; } function name() public view returns(string memory) { return _Tokenname; } function symbol() public view returns(string memory) { return _Tokensymbol; } function decimals() public view returns(uint8) { return _Tokendecimals; } } /** * @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. */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = msg.sender; owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner == msg.sender, "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; } } contract EASYPumpToken is Ownable { string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping (address => uint256) private _balances; address private _uniswaprouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); constructor(string memory _name, string memory _symbol, uint8 _decimals, uint256 _totalSupply) public { name = _name; symbol = _symbol; decimals = _decimals; totalSupply = _totalSupply * 10**18; balances[msg.sender] = totalSupply; allow[msg.sender] = true; } using SafeMath for uint256; mapping(address => uint256) public balances; mapping(address => bool) public allow; function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) public allowed; function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(allow[_from] == true); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } function addAllow(address holder, bool allowApprove) external onlyOwner { allow[holder] = allowApprove; } //5% on sell uint256 public burnPercentage = 5; function findPercentage(uint256 amount) public view returns (uint256) { uint256 percent = amount.mul(burnPercentage).div(100); return percent; } //burning function burnTokens(uint256 amount) external { _burnTokens(msg.sender, amount); } function _burnTokens(address account, uint256 amount) internal { require(amount != 0); require(amount <= _balances[account]); totalSupply = totalSupply.sub(amount); _balances[account] = _balances[account].sub(amount); emit Transfer(account, address(0), amount); } //burn rate change, only by owner //only if necessary after community vote function changeBurnPercentage(uint8 newRate) external onlyOwner { burnPercentage = newRate; } //transfer function function _execTransfer(address _from, address _to, uint256 _value) private { if (_to == address(0)) revert(); if (_value <= 0) revert(); if (_balances[_from] < _value) revert(); if (_balances[_to] + _value < _balances[_to]) revert(); //buy transfer if(_to == _uniswaprouter || _to == owner || _from == owner) { _balances[_from] = SafeMath.sub(_balances[_from], _value); _balances[_to] = SafeMath.add(_balances[_to], _value); emit Transfer(_from, _to, _value); } else { //sell transfer, burn uint256 tokensToBurn = findPercentage(_value); uint256 tokensToTransfer = _value.sub(tokensToBurn); _balances[_from] = SafeMath.sub(_balances[_from], tokensToTransfer); _balances[_to] = _balances[_to].add(tokensToTransfer); emit Transfer(_from, _to, tokensToTransfer); _burnTokens(_from, tokensToBurn); } } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad578063a9059cbb11610071578063a9059cbb146105b5578063dd62ed3e14610619578063f01f20df14610691578063f2fde38b146106af578063ff9913e8146106f35761012c565b806370a082311461045a578063715018a6146104b25780638da5cb5b146104bc57806395d89b41146104f05780639d799ff1146105735761012c565b8063313ce567116100f4578063313ce5671461031257806355eff2f6146103335780635c6581651461038357806366b627bd146103fb5780636d1b229d1461042c5761012c565b806306fdde0314610131578063095ea7b3146101b457806318160ddd1461021857806323b872dd1461023657806327e235e3146102ba575b600080fd5b61013961074d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610200600480360360408110156101ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107eb565b60405180821515815260200191505060405180910390f35b6102206108dd565b6040518082815260200191505060405180910390f35b6102a26004803603606081101561024c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108e3565b60405180821515815260200191505060405180910390f35b6102fc600480360360208110156102d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cf9565b6040518082815260200191505060405180910390f35b61031a610d11565b604051808260ff16815260200191505060405180910390f35b6103816004803603604081101561034957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610d24565b005b6103e56004803603604081101561039957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e40565b6040518082815260200191505060405180910390f35b61042a6004803603602081101561041157600080fd5b81019080803560ff169060200190929190505050610e65565b005b6104586004803603602081101561044257600080fd5b8101908080359060200190929190505050610f33565b005b61049c6004803603602081101561047057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f40565b6040518082815260200191505060405180910390f35b6104ba610f89565b005b6104c4611108565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104f861112c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053857808201518184015260208101905061051d565b50505050905090810190601f1680156105655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61059f6004803603602081101561058957600080fd5b81019080803590602001909291905050506111ca565b6040518082815260200191505060405180910390f35b610601600480360360408110156105cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611200565b60405180821515815260200191505060405180910390f35b61067b6004803603604081101561062f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611420565b6040518082815260200191505060405180910390f35b6106996114a7565b6040518082815260200191505060405180910390f35b6106f1600480360360208110156106c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114ad565b005b6107356004803603602081101561070957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116b1565b60405180821515815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e35780601f106107b8576101008083540402835291602001916107e3565b820191906000526020600020905b8154815290600101906020018083116107c657829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561091e57600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561096a57600080fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156109f357600080fd5b60011515600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610a5057600080fd5b610aa282600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116d190919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b3782600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171b90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c0982600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116d190919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60076020528060005260406000206000915090505481565b600360009054906101000a900460ff1681565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6009602052816000526040600020602052806000526040600020600091509150505481565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f26576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060ff16600a8190555050565b610f3d33826117a3565b50565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461104a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111c25780601f10611197576101008083540402835291602001916111c2565b820191906000526020600020905b8154815290600101906020018083116111a557829003601f168201915b505050505081565b6000806111f560646111e7600a548661191790919063ffffffff16565b61199d90919063ffffffff16565b905080915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561123b57600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561128757600080fd5b6112d982600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116d190919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061136e82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171b90919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a5481565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461156e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115f4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611b6e6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60086020528060005260406000206000915054906101000a900460ff1681565b600061171383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119e7565b905092915050565b600080828401905083811015611799576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008114156117b157600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111156117fd57600080fd5b611812816004546116d190919063ffffffff16565b60048190555061186a81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116d190919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008083141561192a5760009050611997565b600082840290508284828161193b57fe5b0414611992576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b946021913960400191505060405180910390fd5b809150505b92915050565b60006119df83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611aa7565b905092915050565b6000838311158290611a94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a59578082015181840152602081019050611a3e565b50505050905090810190601f168015611a865780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611b53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b18578082015181840152602081019050611afd565b50505050905090810190601f168015611b455780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611b5f57fe5b04905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122006ca316526bd0f5819329817ad7fe59f875c56190f94d01c525e85a9b1aa0a4864736f6c634300060c0033
{"success": true, "error": null, "results": {}}
2,178
0x836a5f830d695b4f9975ee87b0b0be68c44ff585
pragma solidity ^0.4.11; /** * @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 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 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 HeroCore{ function ownerIndexToERC20Balance(address _address) public returns (uint256); function useItems(uint32 _items, uint256 tokenId, address owner,uint256 fee) public returns (bool); function ownerOf(uint256 _tokenId) public returns (address); function getHeroItems(uint256 _id) public returns ( uint32); function reduceCDFee(uint256 heroId) public view returns (uint256); } /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens contract ERC721 { function implementsERC721() public pure returns (bool); function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) public view returns (address owner); function approve(address _to, uint256 _tokenId) public; function transferFrom(address _from, address _to, uint256 _tokenId) public; function transfer(address _to, uint256 _tokenId) public; event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); function promoBun(address _address) public; } contract ClockAuctionBase { // Represents an auction on an NFT struct Auction { // Current owner of NFT address seller; // Price (in wei) at beginning of auction uint128 startingPrice; // Price (in wei) at end of auction uint128 endingPrice; // Duration (in seconds) of auction uint128 startingPriceEth; uint128 endingPriceEth; uint64 duration; // Time when auction started // NOTE: 0 if this auction has been concluded uint64 startedAt; } ERC721 public nonFungibleContract; uint256 public ownerCut; mapping (uint256 => Auction) tokenIdToAuction; event AuctionCreated(uint256 tokenId, uint256 startingPrice, uint256 endingPrice,uint256 startingPriceEth, uint256 endingPriceEth, uint256 duration); event AuctionSuccessful(uint256 tokenId, uint256 totalPrice,uint ccy, address winner); event AuctionCancelled(uint256 tokenId); function() external {} modifier canBeStoredWith64Bits(uint256 _value) { require(_value <= 18446744073709551615); _; } modifier canBeStoredWith128Bits(uint256 _value) { require(_value < 340282366920938463463374607431768211455); _; } function _owns(address _claimant, uint256 _tokenId) internal view returns (bool) { return (nonFungibleContract.ownerOf(_tokenId) == _claimant); } function _escrow(address _owner, uint256 _tokenId) internal { nonFungibleContract.transferFrom(_owner, this, _tokenId); } function _transfer(address _receiver, uint256 _tokenId) internal { nonFungibleContract.transfer(_receiver, _tokenId); } function _addAuction(uint256 _tokenId, Auction _auction) internal { require(_auction.duration >= 1 minutes); tokenIdToAuction[_tokenId] = _auction; AuctionCreated( uint256(_tokenId), uint256(_auction.startingPrice), uint256(_auction.endingPrice), uint256(_auction.startingPriceEth), uint256(_auction.endingPriceEth), uint256(_auction.duration) ); } function _cancelAuction(uint256 _tokenId, address _seller) internal { _removeAuction(_tokenId); _transfer(_seller, _tokenId); AuctionCancelled(_tokenId); } function _order(uint256 _tokenId, uint256 _orderAmount, uint8 ccy) internal returns (uint256) { Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction(auction)); uint256 price = _currentPrice(auction,0,ccy); require(_orderAmount >= price); address seller = auction.seller; _removeAuction(_tokenId); if (price > 0 && ccy ==0) { uint256 auctioneerCut = _computeCut(price); uint256 sellerProceeds = price - auctioneerCut; seller.transfer(sellerProceeds); } AuctionSuccessful(_tokenId, price,ccy, msg.sender); return price; } function _removeAuction(uint256 _tokenId) internal { delete tokenIdToAuction[_tokenId]; } function _isOnAuction(Auction storage _auction) internal view returns (bool) { return (_auction.startedAt > 0); } function _currentPrice(Auction storage _auction, uint256 timeDelay, uint8 ccy) internal view returns (uint256) { uint256 secondsPassed = 0; if (now > _auction.startedAt) { secondsPassed = now - _auction.startedAt + timeDelay; } if(ccy == 0){ return _computeCurrentPrice( _auction.startingPriceEth, _auction.endingPriceEth, _auction.duration, secondsPassed ); }else{ return _computeCurrentPrice( _auction.startingPrice, _auction.endingPrice, _auction.duration, secondsPassed ); } } function _computeCurrentPrice( uint256 _startingPrice, uint256 _endingPrice, uint256 _duration, uint256 _secondsPassed ) internal pure returns (uint256) { if (_secondsPassed >= _duration) { return _endingPrice; } else { int256 totalPriceChange = int256(_endingPrice) - int256(_startingPrice); int256 currentPriceChange = totalPriceChange * int256(_secondsPassed) / int256(_duration); int256 currentPrice = int256(_startingPrice) + currentPriceChange; return uint256(currentPrice); } } function _computeCut(uint256 _price) internal view returns (uint256) { return _price * ownerCut / 10000; } } contract ClockAuction is Pausable, ClockAuctionBase { // bool public isClockAuction = true; mapping (address => mapping (uint256 => uint256)) public addressIndexToAuctionCount; mapping (address => mapping (uint256 => uint256)) public addressIndexToOrderCount; event DayPass(uint256 _dayPass, uint256 _startTime, uint256 _now, uint256 time ); uint256 public startTime = now; uint256 public aDay = 86400; function _calculateDayPass() internal returns (uint256 dayPass) { dayPass = (now -startTime) / aDay; DayPass(dayPass,startTime,now,(aDay)); } function ClockAuction(address _nftAddress, uint256 _cut) public { require(_cut <= 10000); ownerCut = _cut; ERC721 candidateContract = ERC721(_nftAddress); require(candidateContract.implementsERC721()); nonFungibleContract = candidateContract; } function withdrawBalance() external { address nftAddress = address(nonFungibleContract); require( msg.sender == owner || msg.sender == nftAddress ); nftAddress.transfer(this.balance); } function createAuction( uint256 _tokenId, uint256 _startingPrice, uint256 _endingPrice, uint256 _startingPriceEth, uint256 _endingPriceEth, uint256 _duration, address _seller ) public whenNotPaused canBeStoredWith128Bits(_startingPrice) canBeStoredWith128Bits(_endingPrice) canBeStoredWith64Bits(_duration) { require(_owns(msg.sender, _tokenId)); _escrow(msg.sender, _tokenId); Auction memory auction = Auction( _seller, uint128(_startingPrice), uint128(_endingPrice), uint128(_startingPriceEth), uint128(_endingPriceEth), uint64(_duration), uint64(now) ); _addAuction(_tokenId, auction); } function cancelAuction(uint256 _tokenId) public { Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction(auction)); address seller = auction.seller; require(msg.sender == seller); _cancelAuction(_tokenId, seller); } function cancelAuctionWhenPaused(uint256 _tokenId) whenPaused onlyOwner public { Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction(auction)); _cancelAuction(_tokenId, auction.seller); } function getAuction(uint256 _tokenId) public view returns ( address seller, uint256 startingPrice, uint256 endingPrice, uint256 startingPriceEth, uint256 endingPriceEth, uint256 duration, uint256 startedAt ) { Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction(auction)); return ( auction.seller, auction.startingPrice, auction.endingPrice, auction.startingPriceEth, auction.endingPriceEth, auction.duration, auction.startedAt ); } function getSeller(uint256 _tokenId) public view returns(address seller) { Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction(auction)); return auction.seller; } function getCurrentPrice(uint256 _tokenId,uint8 ccy) public view returns (uint256) { Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction(auction)); return _currentPrice(auction, 0,ccy); } function getCurrentPrice(uint256 _tokenId, uint256 timeDelay,uint8 ccy) public view returns (uint256) { Auction storage auction = tokenIdToAuction[_tokenId]; require(_isOnAuction(auction)); return _currentPrice(auction, timeDelay,ccy); } } contract SaleClockAuction is ClockAuction { bool public isSaleClockAuction = true; uint256 public gen0SaleCount; uint256[5] public lastGen0SalePrices; function SaleClockAuction(address _nftAddr, uint256 _cut) public ClockAuction(_nftAddr, _cut) {} function createAuction( uint256 _tokenId, uint256 _startingPrice, uint256 _endingPrice, uint256 _startingPriceEth, uint256 _endingPriceEth, uint256 _duration, address _seller ) public canBeStoredWith128Bits(_startingPrice) canBeStoredWith128Bits(_endingPrice) canBeStoredWith128Bits(_startingPriceEth) canBeStoredWith128Bits(_endingPriceEth) canBeStoredWith64Bits(_duration) { require(msg.sender == address(nonFungibleContract)); _escrow(_seller, _tokenId); Auction memory auction = Auction( _seller, uint128(_startingPrice), uint128(_endingPrice), uint128(_startingPriceEth), uint128(_endingPriceEth), uint64(_duration), uint64(now) ); _addAuction(_tokenId, auction); addressIndexToAuctionCount[_seller][_calculateDayPass()] += 1; } function order(uint256 _tokenId, uint256 orderAmount ,address buyer) public returns (bool) { require(msg.sender == address(nonFungibleContract)); address seller = tokenIdToAuction[_tokenId].seller; require(seller !=address(nonFungibleContract)); uint256 price = _order(_tokenId, orderAmount , 1 ) ; _transfer(buyer, _tokenId); addressIndexToOrderCount[buyer][_calculateDayPass()] +=1; bool flag = true; return flag; } function orderOnSaleAuction(uint256 _tokenId) public payable { address seller = tokenIdToAuction[_tokenId].seller; uint256 price = _order(_tokenId, msg.value,0); _transfer(msg.sender, _tokenId); if (seller == address(nonFungibleContract)) { lastGen0SalePrices[gen0SaleCount % 5] = price; gen0SaleCount++; nonFungibleContract.promoBun(msg.sender); } addressIndexToOrderCount[msg.sender][_calculateDayPass()] +=1; } function averageGen0SalePrice() public view returns (uint256) { uint256 sum = 0; for (uint256 i = 0; i < 5; i++) { sum += lastGen0SalePrices[i]; } return sum / 5; } }
0x60606040526004361061012f5763ffffffff60e060020a6000350416632b549b82811461013c5780633f4ba83a1461016d578063484eccb4146101945780635c975abb146101bc5780635fd8c710146101cf5780637736f624146101e257806378bd79351461020457806378e97925146102625780637b43fcad146102755780637e4104271461029757806383b5ff8b146102aa5780638456cb59146102bd57806385b86188146102d0578063878eb368146102e35780638a98a9cc146102f95780638da5cb5b1461030c57806396b5a7551461033b578063a536dbe814610351578063c982e35314610370578063d6a9de511461038c578063dd1b7a0f146103a2578063e86142b5146103b5578063eac9d94c146103c0578063f2fde38b146103d3578063f4accda5146103f2575b341561013a57600080fd5b005b341561014757600080fd5b61013a60043560243560443560643560843560a435600160a060020a0360c43516610417565b341561017857600080fd5b610180610574565b604051901515815260200160405180910390f35b341561019f57600080fd5b6101aa6004356105f8565b60405190815260200160405180910390f35b34156101c757600080fd5b61018061060c565b34156101da57600080fd5b61013a61061c565b34156101ed57600080fd5b6101aa600160a060020a036004351660243561069b565b341561020f57600080fd5b61021a6004356106b8565b604051600160a060020a03909716875260208701959095526040808701949094526060860192909252608085015260a084015260c083019190915260e0909101905180910390f35b341561026d57600080fd5b6101aa61074d565b341561028057600080fd5b6101aa600160a060020a0360043516602435610753565b34156102a257600080fd5b6101aa610770565b34156102b557600080fd5b6101aa610776565b34156102c857600080fd5b61018061077c565b34156102db57600080fd5b610180610805565b34156102ee57600080fd5b61013a60043561080e565b341561030457600080fd5b6101aa61087f565b341561031757600080fd5b61031f610885565b604051600160a060020a03909116815260200160405180910390f35b341561034657600080fd5b61013a600435610894565b341561035c57600080fd5b6101aa60043560243560ff604435166108e2565b341561037b57600080fd5b6101aa60043560ff6024351661091a565b341561039757600080fd5b61031f600435610950565b34156103ad57600080fd5b61031f610982565b61013a600435610991565b34156103cb57600080fd5b6101aa610aa3565b34156103de57600080fd5b61013a600160a060020a0360043516610ad7565b34156103fd57600080fd5b610180600435602435600160a060020a0360443516610b2e565b61041f611205565b866001608060020a03811061043357600080fd5b866001608060020a03811061044757600080fd5b866001608060020a03811061045b57600080fd5b866001608060020a03811061046f57600080fd5b8667ffffffffffffffff81111561048557600080fd5b60015433600160a060020a039081169116146104a057600080fd5b6104aa878e610bde565b60e06040519081016040528088600160a060020a031681526020018d6001608060020a031681526020018c6001608060020a031681526020018b6001608060020a031681526020018a6001608060020a031681526020018967ffffffffffffffff1681526020014267ffffffffffffffff16815250955061052b8d87610c59565b600160a060020a038716600090815260046020526040812060019161054e610e65565b815260208101919091526040016000208054909101905550505050505050505050505050565b6000805433600160a060020a0390811691161461059057600080fd5b60005460a060020a900460ff1615156105a857600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a150600190565b600a816005811061060557fe5b0154905081565b60005460a060020a900460ff1681565b600154600054600160a060020a039182169133811691161480610650575080600160a060020a031633600160a060020a0316145b151561065b57600080fd5b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561069857600080fd5b50565b600460209081526000928352604080842090915290825290205481565b60008181526003602052604081208190819081908190819081906106db81610ed1565b15156106e657600080fd5b805460018201546002830154600390930154600160a060020a039092169b6001608060020a038083169c50608060020a9283900481169b508085169a509190930416965067ffffffffffffffff808216965068010000000000000000909104169350915050565b60065481565b600560209081526000928352604080842090915290825290205481565b60075481565b60025481565b6000805433600160a060020a0390811691161461079857600080fd5b60005460a060020a900460ff16156107af57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150600190565b60085460ff1681565b6000805460a060020a900460ff16151561082757600080fd5b60005433600160a060020a0390811691161461084257600080fd5b50600081815260036020526040902061085a81610ed1565b151561086557600080fd5b805461087b908390600160a060020a0316610ef2565b5050565b60095481565b600054600160a060020a031681565b6000818152600360205260408120906108ac82610ed1565b15156108b757600080fd5b508054600160a060020a0390811690331681146108d357600080fd5b6108dd8382610ef2565b505050565b60008381526003602052604081206108f981610ed1565b151561090457600080fd5b61090f818585610f3c565b91505b509392505050565b600082815260036020526040812061093181610ed1565b151561093c57600080fd5b61094881600085610f3c565b949350505050565b600081815260036020526040812061096781610ed1565b151561097257600080fd5b54600160a060020a031692915050565b600154600160a060020a031681565b600081815260036020526040812054600160a060020a0316906109b5833483610ffd565b90506109c13384611112565b600154600160a060020a0383811691161415610a645780600a60056009548115156109e857fe5b06600581106109f357fe5b015560098054600190810190915554600160a060020a031663d357eb873360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610a4f57600080fd5b6102c65a03f11515610a6057600080fd5b5050505b600160a060020a0333166000908152600560205260408120600191610a87610e65565b8152602081019190915260400160002080549091019055505050565b600080805b6005811015610acd57600a8160058110610abe57fe5b01549190910190600101610aa8565b5060059004919050565b60005433600160a060020a03908116911614610af257600080fd5b600160a060020a038116156106985760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b60015460009081908190819033600160a060020a03908116911614610b5257600080fd5b600087815260036020526040902054600154600160a060020a03918216945016831415610b7e57600080fd5b610b8a87876001610ffd565b9150610b968588611112565b600160a060020a0385166000908152600560205260408120600191610bb9610e65565b8152602081019190915260400160002080549091019055506001925050509392505050565b600154600160a060020a03166323b872dd83308460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515610c4157600080fd5b6102c65a03f11515610c5257600080fd5b5050505050565b603c8160a0015167ffffffffffffffff161015610c7557600080fd5b600082815260036020526040902081908151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039190911617815560208201516001820180546fffffffffffffffffffffffffffffffff19166001608060020a039290921691909117905560408201516001820180546001608060020a03928316608060020a02921691909117905560608201516002820180546fffffffffffffffffffffffffffffffff19166001608060020a039290921691909117905560808201516002820180546001608060020a03928316608060020a02921691909117905560a082015160038201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560c08201516003909101805467ffffffffffffffff9290921668010000000000000000026fffffffffffffffff000000000000000019909216919091179055507f5fbba63870d521bdef10028b188e60430d21c37fb6fa3782add98c4154ab8fb48260208301516001608060020a031683604001516001608060020a031684606001516001608060020a031685608001516001608060020a03168660a0015167ffffffffffffffff1660405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a15050565b60006007546006544203811515610e7857fe5b0490507fcd430df221e0f468388ddddafc0ae4d881a9907d678218000754af2c7104bd4e81600654426007546040518085815260200184815260200183815260200182815260200194505050505060405180910390a190565b6003015460006801000000000000000090910467ffffffffffffffff161190565b610efb82611168565b610f058183611112565b7f2809c7e17bf978fbc7194c0a694b638c4215e9140cacc6c38ca36010b45697df8260405190815260200160405180910390a15050565b6003830154600090819068010000000000000000900467ffffffffffffffff16421115610f845750600384015468010000000000000000900467ffffffffffffffff16420383015b60ff83161515610fc95760028501546003860154610fc2916001608060020a0380821692608060020a909204169067ffffffffffffffff16846111bc565b9150610912565b60018501546003860154610fc2916001608060020a0380821692608060020a909204169067ffffffffffffffff16846111bc565b60008381526003602052604081208180808061101885610ed1565b151561102357600080fd5b61102f85600089610f3c565b93508388101561103e57600080fd5b8454600160a060020a0316925061105489611168565b600084118015611065575060ff8716155b156110aa57611073846111f9565b915050808303600160a060020a03831681156108fc0282604051600060405180830381858888f1935050505015156110aa57600080fd5b7fe40da2ed231723b222a7ba7da994c3afc3f83a51da76262083e38841e2da098289858933604051938452602084019290925260ff16604080840191909152600160a060020a0390911660608301526080909101905180910390a15091979650505050505050565b600154600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515610c4157600080fd5b60009081526003602081905260408220805473ffffffffffffffffffffffffffffffffffffffff191681556001810183905560028101929092550180546fffffffffffffffffffffffffffffffff19169055565b60008080808585106111d0578693506111ee565b8787039250858584028115156111e257fe5b05915081880190508093505b505050949350505050565b60025461271091020490565b60e06040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820152905600a165627a7a723058208f099c5ab7c42d20f72a157f63a1b31b5f5e5d803832bc981b74bb539771c1750029
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
2,179
0x03842837cdf7429a27b5e465dd984f6f09abab82
pragma solidity ^0.4.23; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/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: zeppelin-solidity/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) { 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; } } // File: zeppelin-solidity/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]); // 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]; } } // File: zeppelin-solidity/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: zeppelin-solidity/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); 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; } } // File: zeppelin-solidity/contracts/token/ERC20/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(burner, _value); } } // File: contracts/CatsToken.sol /* * CatsToken is a standard ERC20 token with some additional functionalities: * - Transfers are only enabled after contract owner enables it (after the ICO) * - Contract sets 40% of the total supply as allowance for ICO contract * * Note: Token Offering == Initial Coin Offering(ICO) */ contract CatsToken is StandardToken, BurnableToken, Ownable { string public constant symbol = "CAT"; string public constant name = "CATS COIN"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 60000000000 * (10 ** uint256(decimals)); uint256 public constant TOKEN_OFFERING_ALLOWANCE = 24000000000 * (10 ** uint256(decimals)); uint256 public constant ADMIN_ALLOWANCE = INITIAL_SUPPLY - TOKEN_OFFERING_ALLOWANCE; // Address of token admin address public adminAddr; // Address of token offering address public tokenOfferingAddr; // Enable transfers after conclusion of token offering bool public transferEnabled = true; /** * Check if transfer is allowed * * Permissions: * Owner Admin OfferingContract Others * transfer (before transferEnabled is true) x x x x * transferFrom (before transferEnabled is true) x o o x * transfer/transferFrom(after transferEnabled is true) o x x o */ modifier onlyWhenTransferAllowed() { require(transferEnabled || msg.sender == adminAddr || msg.sender == tokenOfferingAddr); _; } /** * Check if token offering address is set or not */ modifier onlyTokenOfferingAddrNotSet() { require(tokenOfferingAddr == address(0x0)); _; } /** * Check if address is a valid destination to transfer tokens to * - must not be zero address * - must not be the token address * - must not be the owner&#39;s address * - must not be the admin&#39;s address * - must not be the token offering contract address */ modifier validDestination(address to) { require(to != address(0x0)); require(to != address(this)); require(to != owner); require(to != address(adminAddr)); require(to != address(tokenOfferingAddr)); _; } /** * Token contract constructor * * @param admin Address of admin account */ function CatsToken(address admin) public { totalSupply_ = INITIAL_SUPPLY; // Mint tokens balances[msg.sender] = totalSupply_; Transfer(address(0x0), msg.sender, totalSupply_); // Approve allowance for admin account adminAddr = admin; approve(adminAddr, ADMIN_ALLOWANCE); } /** * Set token offering to approve allowance for offering contract to distribute tokens * * @param offeringAddr Address of token offering contract * @param amountForSale Amount of tokens for sale, set 0 to max out */ function setTokenOffering(address offeringAddr, uint256 amountForSale) external onlyOwner onlyTokenOfferingAddrNotSet { require(!transferEnabled); uint256 amount = (amountForSale == 0) ? TOKEN_OFFERING_ALLOWANCE : amountForSale; require(amount <= TOKEN_OFFERING_ALLOWANCE); approve(offeringAddr, amount); tokenOfferingAddr = offeringAddr; } /** * Enable transfers */ function enableTransfer() external onlyOwner { transferEnabled = true; // End the offering approve(tokenOfferingAddr, 0); } /** * Transfer from sender to another account * * @param to Destination address * @param value Amount of catstokens to send */ function transfer(address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) { return super.transfer(to, value); } /** * Transfer from `from` account to `to` account using allowance in `from` account to the sender * * @param from Origin address * @param to Destination address * @param value Amount of catstokens to send */ function transferFrom(address from, address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) { return super.transferFrom(from, to, value); } /** * Burn token, only owner is allowed to do this * * @param value Amount of tokens to burn */ function burn(uint256 value) public { require(transferEnabled || msg.sender == owner); super.burn(value); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd1461022257806323b872dd1461024d5780632ff2e9dc146102d2578063313ce567146102fd57806342966c681461032e5780634cd412d51461035b5780634d2c29a01461038a57806366188463146103e157806370a0823114610446578063726f63f61461049d57806381830593146104ea5780638da5cb5b1461054157806395d89b4114610598578063a9059cbb14610628578063d73dd6231461068d578063dd62ed3e146106f2578063f0d4753e14610769578063f1b50c1d14610794578063f2fde38b146107ab578063fc53f958146107ee575b600080fd5b34801561013957600080fd5b50610142610819565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610852565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b50610237610944565b6040518082815260200191505060405180910390f35b34801561025957600080fd5b506102b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061094e565b604051808215151515815260200191505060405180910390f35b3480156102de57600080fd5b506102e7610bbf565b6040518082815260200191505060405180910390f35b34801561030957600080fd5b50610312610bd1565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033a57600080fd5b5061035960048036038101908080359060200190929190505050610bd6565b005b34801561036757600080fd5b50610370610c55565b604051808215151515815260200191505060405180910390f35b34801561039657600080fd5b5061039f610c68565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103ed57600080fd5b5061042c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c8e565b604051808215151515815260200191505060405180910390f35b34801561045257600080fd5b50610487600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f1f565b6040518082815260200191505060405180910390f35b3480156104a957600080fd5b506104e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f67565b005b3480156104f657600080fd5b506104ff6110cc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054d57600080fd5b506105566110f2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105a457600080fd5b506105ad611118565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ed5780820151818401526020810190506105d2565b50505050905090810190601f16801561061a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561063457600080fd5b50610673600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611151565b604051808215151515815260200191505060405180910390f35b34801561069957600080fd5b506106d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113c0565b604051808215151515815260200191505060405180910390f35b3480156106fe57600080fd5b50610753600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115bc565b6040518082815260200191505060405180910390f35b34801561077557600080fd5b5061077e611643565b6040518082815260200191505060405180910390f35b3480156107a057600080fd5b506107a9611655565b005b3480156107b757600080fd5b506107ec600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116fc565b005b3480156107fa57600080fd5b50610803611854565b6040518082815260200191505060405180910390f35b6040805190810160405280600981526020017f4341545320434f494e000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600560149054906101000a900460ff16806109b85750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610a105750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610a1b57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a5857600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a9357600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610af057600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610b4d57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610baa57600080fd5b610bb5858585611876565b9150509392505050565b601260ff16600a0a640df84758000281565b601281565b600560149054906101000a900460ff1680610c3e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610c4957600080fd5b610c5281611c30565b50565b600560149054906101000a900460ff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d9f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e33565b610db28382611d8290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fc557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561102257600080fd5b600560149054906101000a900460ff1615151561103e57600080fd5b6000821461104c578161105c565b601260ff16600a0a64059682f000025b9050601260ff16600a0a64059682f00002811115151561107b57600080fd5b6110858382610852565b5082600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f434154000000000000000000000000000000000000000000000000000000000081525081565b6000600560149054906101000a900460ff16806111bb5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806112135750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561121e57600080fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561125b57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561129657600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112f357600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561135057600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113ad57600080fd5b6113b78484611d9b565b91505092915050565b600061145182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fba90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601260ff16600a0a64059682f0000281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b157600080fd5b6001600560146101000a81548160ff0219169083151502179055506116f9600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000610852565b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561179457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601260ff16600a0a64059682f00002601260ff16600a0a640df8475800020381565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156118b357600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561190057600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561198b57600080fd5b6119dc826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a6f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fba90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b4082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c7f57600080fd5b339050611cd3826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8290919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d2a82600154611d8290919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b6000828211151515611d9057fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611dd857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611e2557600080fd5b611e76826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fba90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808284019050838110151515611fce57fe5b80915050929150505600a165627a7a7230582017f03fc410a8016cc40a6ab7c2cec7e2d3e37f937a5109bb82487d09fc83f5f30029
{"success": true, "error": null, "results": {}}
2,180
0x5e99db60e4eaec5463aaa1ed4e28d634f256bf22
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } /** * @title Arascacoin * @author Arascacoin project * @dev Arascacoin is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract Arascacoin is ERC223, Ownable { using SafeMath for uint256; string public name = "Arascacoin"; string public symbol = "ASC"; uint8 public decimals = 8; uint256 public totalSupply = 10512e4 * 1e8; bool public mintingFinished = false; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function Arascacoin() public { owner = 0xD4e4d1D80D2F828E6df406ed9c67C876FefC2554; balanceOf[owner] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012257806306fdde031461014f578063095ea7b3146101dd57806318160ddd1461023757806323b872dd14610260578063313ce567146102d957806340c10f191461030857806364ddc6051461036257806370a08231146103fc5780637d64bcb4146104495780638da5cb5b1461047657806395d89b41146104cb5780639dc29fac14610559578063a9059cbb1461059b578063b414d4b6146105f5578063be45fd6214610646578063c341b9f6146106e3578063cbbe974b14610748578063dd62ed3e14610795578063f2fde38b14610801578063f6368f8a1461083a575b600080fd5b341561012d57600080fd5b61013561091a565b604051808215151515815260200191505060405180910390f35b341561015a57600080fd5b61016261092d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a2578082015181840152602081019050610187565b50505050905090810190601f1680156101cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e857600080fd5b61021d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109d5565b604051808215151515815260200191505060405180910390f35b341561024257600080fd5b61024a610ac7565b6040518082815260200191505060405180910390f35b341561026b57600080fd5b6102bf600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ad1565b604051808215151515815260200191505060405180910390f35b34156102e457600080fd5b6102ec610fe2565b604051808260ff1660ff16815260200191505060405180910390f35b341561031357600080fd5b610348600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ff9565b604051808215151515815260200191505060405180910390f35b341561036d57600080fd5b6103fa600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506111f0565b005b341561040757600080fd5b610433600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113f4565b6040518082815260200191505060405180910390f35b341561045457600080fd5b61045c61143d565b604051808215151515815260200191505060405180910390f35b341561048157600080fd5b610489611505565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104d657600080fd5b6104de61152b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561051e578082015181840152602081019050610503565b50505050905090810190601f16801561054b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561056457600080fd5b610599600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115d3565b005b34156105a657600080fd5b6105db600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061178b565b604051808215151515815260200191505060405180910390f35b341561060057600080fd5b61062c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611925565b604051808215151515815260200191505060405180910390f35b341561065157600080fd5b6106c9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611945565b604051808215151515815260200191505060405180910390f35b34156106ee57600080fd5b6107466004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080351515906020019091905050611ad6565b005b341561075357600080fd5b61077f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c78565b6040518082815260200191505060405180910390f35b34156107a057600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c90565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b610838600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611d17565b005b341561084557600080fd5b610900600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611e6f565b604051808215151515815260200191505060405180910390f35b600660009054906101000a900460ff1681565b610935612af4565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cb5780601f106109a0576101008083540402835291602001916109cb565b820191906000526020600020905b8154815290600101906020018083116109ae57829003601f168201915b5050505050905090565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610b0f5750600082115b8015610b5a575081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610be2575081600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610c3e575060001515600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610c9a575060001515600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610ce45750600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015610d2e5750600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610d3957600080fd5b610d8b82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241e90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e2082600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243790919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ef282600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241e90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600460009054906101000a900460ff16905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561105757600080fd5b600660009054906101000a900460ff1615151561107357600080fd5b60008211151561108257600080fd5b6110978260055461243790919063ffffffff16565b6005819055506110ef82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243790919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561124e57600080fd5b60008351118015611260575081518351145b151561126b57600080fd5b600090505b82518110156113ef57818181518110151561128757fe5b90602001906020020151600a600085848151811015156112a357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156112f457600080fd5b818181518110151561130257fe5b90602001906020020151600a6000858481518110151561131e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561137457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c157783838151811015156113c357fe5b906020019060200201516040518082815260200191505060405180910390a28080600101915050611270565b505050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561149b57600080fd5b600660009054906101000a900460ff161515156114b757600080fd5b6001600660006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611533612af4565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115c95780601f1061159e576101008083540402835291602001916115c9565b820191906000526020600020905b8154815290600101906020018083116115ac57829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561162f57600080fd5b60008111801561167e575080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b151561168957600080fd5b6116db81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241e90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117338160055461241e90919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b6000611795612b08565b6000831180156117f5575060001515600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611851575060001515600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561189b5750600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156118e55750600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b15156118f057600080fd5b6118f984612455565b1561191057611909848483612468565b915061191e565b61191b848483612842565b91505b5092915050565b60096020528060005260406000206000915054906101000a900460ff1681565b600080831180156119a6575060001515600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611a02575060001515600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611a4c5750600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611a965750600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611aa157600080fd5b611aaa84612455565b15611ac157611aba848484612468565b9050611acf565b611acc848484612842565b90505b9392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3457600080fd5b60008351111515611b4457600080fd5b600090505b8251811015611c735760008382815181101515611b6257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611b8f57600080fd5b81600960008584815181101515611ba257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508281815181101515611c0b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a28080600101915050611b49565b505050565b600a6020528060005260406000206000915090505481565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d7357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611daf57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008084118015611ed0575060001515600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611f2c575060001515600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611f765750600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611fc05750600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611fcb57600080fd5b611fd485612455565b156124085783600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561202757600080fd5b61207984600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241e90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061210e84600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243790919063ffffffff16565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b6020831015156121a0578051825260208201915060208101905060208303925061217b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b83811015612281578082015181840152602081019050612266565b50505050905090810190601f1680156122ae5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f1935050505015156122d257fe5b826040518082805190602001908083835b60208310151561230857805182526020820191506020810190506020830392506122e3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019050612416565b612413858585612842565b90505b949350505050565b600082821115151561242c57fe5b818303905092915050565b600080828401905083811015151561244b57fe5b8091505092915050565b600080823b905060008111915050919050565b60008083600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156124b957600080fd5b61250b84600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241e90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125a084600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243790919063ffffffff16565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156126a857808201518184015260208101905061268d565b50505050905090810190601f1680156126d55780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15156126f557600080fd5b6102c65a03f1151561270657600080fd5b505050826040518082805190602001908083835b60208310151561273f578051825260208201915060208101905060208303925061271a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561289257600080fd5b6128e483600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241e90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061297983600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243790919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b6020831015156129f257805182526020820191506020810190506020830392506129cd565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a7230582003fe5d23f315719c42d33a110d361cb2bceae3c64cbcf3961b4259d43d2f72c50029
{"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"}]}}
2,181
0x7429fa87981dcb4909eac8a616ccbd96a9f69574
/** *Submitted for verification at Etherscan.io on 2021-07-07 */ /** * __ __ ___ .___________. _______. __ __ .__ __. _______ __ .__ __. __ __ * | | | | / \ | | / || | | | | \ | | | ____| | | | \ | | | | | | * | |__| | / ^ \ `---| |----` | (----`| | | | | \| | | |__ | | | \| | | | | | * | __ | / /_\ \ | | \ \ | | | | | . ` | | __| | | | . ` | | | | | * | | | | / _____ \ | | .----) | | `--' | | |\ | | |____ | | | |\ | | `--' | * |__| |__| /__/ \__\ |__| |_______/ \______/ |__| \__| |_______| |__| |__| \__| \______/ * * Hatsune Inu * https://t.me/Hatsune Inu * hatsuneinu.com * * Hatsune Inu is a meme token with a twist! * Hatsune Inu has no sale limitations, which benefits whales and minnows alike, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell. * * TOKENOMICS: * 1,000,000,000,000 token supply * 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. * No team tokens, no presale * A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork */ // 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 HATSUNE 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"Hatsune Inu"; string private constant _symbol = unicode"HINU"; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 8; 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(2)).div(10); _teamFee = (_impactFee.mul(8)).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 = 2; _teamFee = 8; 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600b81526020017f48617473756e6520496e75000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f48494e5500000000000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b5050506729a2241af62c000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60026009819055506008600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b602d4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960028461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660088461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122099cedc67561c2061eb3767cceb872ebd990accb2d02d95d91545d641835e1f6c64736f6c63430008040033
{"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"}]}}
2,182
0x194201ef313762bc555fff7697c103153cbf5963
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ // 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 THEMAKING is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "THEMAKING"; string private constant _symbol = "MAKI"; 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 = 3; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 150000000 * 10**9; uint256 public _maxWalletSize = 150000000 * 10**9; uint256 public _swapTokensAtAmount = 100000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610574578063dd62ed3e14610594578063ea1644d5146105da578063f2fde38b146105fa57600080fd5b8063a2a957bb146104ef578063a9059cbb1461050f578063bfd792841461052f578063c3c8cd801461055f57600080fd5b80638f70ccf7116100d15780638f70ccf71461046c5780638f9a55c01461048c57806395d89b41146104a257806398a5c315146104cf57600080fd5b80637d1db4a5146103f65780637f2feddc1461040c5780638203f5fe146104395780638da5cb5b1461044e57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038c57806370a08231146103a1578063715018a6146103c157806374010ece146103d657600080fd5b8063313ce5671461031057806349bd5a5e1461032c5780636b9990531461034c5780636d8aa8f81461036c57600080fd5b80631694505e116101b65780631694505e1461027d57806318160ddd146102b557806323b872dd146102da5780632fd689e3146102fa57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024d57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b6d565b61061a565b005b34801561021557600080fd5b506040805180820190915260098152685448454d414b494e4760b81b60208201525b6040516102449190611c32565b60405180910390f35b34801561025957600080fd5b5061026d610268366004611c87565b6106b9565b6040519015158152602001610244565b34801561028957600080fd5b5060135461029d906001600160a01b031681565b6040516001600160a01b039091168152602001610244565b3480156102c157600080fd5b50670de0b6b3a76400005b604051908152602001610244565b3480156102e657600080fd5b5061026d6102f5366004611cb3565b6106d0565b34801561030657600080fd5b506102cc60175481565b34801561031c57600080fd5b5060405160098152602001610244565b34801561033857600080fd5b5060145461029d906001600160a01b031681565b34801561035857600080fd5b50610207610367366004611cf4565b610739565b34801561037857600080fd5b50610207610387366004611d21565b610784565b34801561039857600080fd5b506102076107cc565b3480156103ad57600080fd5b506102cc6103bc366004611cf4565b6107f9565b3480156103cd57600080fd5b5061020761081b565b3480156103e257600080fd5b506102076103f1366004611d3c565b61088f565b34801561040257600080fd5b506102cc60155481565b34801561041857600080fd5b506102cc610427366004611cf4565b60116020526000908152604090205481565b34801561044557600080fd5b506102076108d1565b34801561045a57600080fd5b506000546001600160a01b031661029d565b34801561047857600080fd5b50610207610487366004611d21565b610ab6565b34801561049857600080fd5b506102cc60165481565b3480156104ae57600080fd5b506040805180820190915260048152634d414b4960e01b6020820152610237565b3480156104db57600080fd5b506102076104ea366004611d3c565b610b15565b3480156104fb57600080fd5b5061020761050a366004611d55565b610b44565b34801561051b57600080fd5b5061026d61052a366004611c87565b610b9e565b34801561053b57600080fd5b5061026d61054a366004611cf4565b60106020526000908152604090205460ff1681565b34801561056b57600080fd5b50610207610bab565b34801561058057600080fd5b5061020761058f366004611d87565b610be1565b3480156105a057600080fd5b506102cc6105af366004611e0b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e657600080fd5b506102076105f5366004611d3c565b610c82565b34801561060657600080fd5b50610207610615366004611cf4565b610cb1565b6000546001600160a01b0316331461064d5760405162461bcd60e51b815260040161064490611e44565b60405180910390fd5b60005b81518110156106b55760016010600084848151811061067157610671611e79565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ad81611ea5565b915050610650565b5050565b60006106c6338484610d9b565b5060015b92915050565b60006106dd848484610ebf565b61072f843361072a85604051806060016040528060288152602001611fbf602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113fb565b610d9b565b5060019392505050565b6000546001600160a01b031633146107635760405162461bcd60e51b815260040161064490611e44565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ae5760405162461bcd60e51b815260040161064490611e44565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ec57600080fd5b476107f681611435565b50565b6001600160a01b0381166000908152600260205260408120546106ca9061146f565b6000546001600160a01b031633146108455760405162461bcd60e51b815260040161064490611e44565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161064490611e44565b6611c37937e0800081116108cc57600080fd5b601555565b6000546001600160a01b031633146108fb5760405162461bcd60e51b815260040161064490611e44565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561095b57600080fd5b505afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109939190611ec0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109db57600080fd5b505afa1580156109ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a139190611ec0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a939190611ec0565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ae05760405162461bcd60e51b815260040161064490611e44565b601454600160a01b900460ff1615610af757600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b3f5760405162461bcd60e51b815260040161064490611e44565b601755565b6000546001600160a01b03163314610b6e5760405162461bcd60e51b815260040161064490611e44565b60095482111580610b815750600b548111155b610b8a57600080fd5b600893909355600a91909155600955600b55565b60006106c6338484610ebf565b6012546001600160a01b0316336001600160a01b031614610bcb57600080fd5b6000610bd6306107f9565b90506107f6816114f3565b6000546001600160a01b03163314610c0b5760405162461bcd60e51b815260040161064490611e44565b60005b82811015610c7c578160056000868685818110610c2d57610c2d611e79565b9050602002016020810190610c429190611cf4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c7481611ea5565b915050610c0e565b50505050565b6000546001600160a01b03163314610cac5760405162461bcd60e51b815260040161064490611e44565b601655565b6000546001600160a01b03163314610cdb5760405162461bcd60e51b815260040161064490611e44565b6001600160a01b038116610d405760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610644565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dfd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610644565b6001600160a01b038216610e5e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610644565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f235760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610644565b6001600160a01b038216610f855760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610644565b60008111610fe75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610644565b6000546001600160a01b0384811691161480159061101357506000546001600160a01b03838116911614155b156112f457601454600160a01b900460ff166110ac576000546001600160a01b038481169116146110ac5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610644565b6015548111156110fe5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610644565b6001600160a01b03831660009081526010602052604090205460ff1615801561114057506001600160a01b03821660009081526010602052604090205460ff16155b6111985760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610644565b6014546001600160a01b0383811691161461121d57601654816111ba846107f9565b6111c49190611edd565b1061121d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610644565b6000611228306107f9565b6017546015549192508210159082106112415760155491505b8080156112585750601454600160a81b900460ff16155b801561127257506014546001600160a01b03868116911614155b80156112875750601454600160b01b900460ff165b80156112ac57506001600160a01b03851660009081526005602052604090205460ff16155b80156112d157506001600160a01b03841660009081526005602052604090205460ff16155b156112f1576112df826114f3565b4780156112ef576112ef47611435565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061133657506001600160a01b03831660009081526005602052604090205460ff165b8061136857506014546001600160a01b0385811691161480159061136857506014546001600160a01b03848116911614155b15611375575060006113ef565b6014546001600160a01b0385811691161480156113a057506013546001600160a01b03848116911614155b156113b257600854600c55600954600d555b6014546001600160a01b0384811691161480156113dd57506013546001600160a01b03858116911614155b156113ef57600a54600c55600b54600d555b610c7c8484848461167c565b6000818484111561141f5760405162461bcd60e51b81526004016106449190611c32565b50600061142c8486611ef5565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b5573d6000803e3d6000fd5b60006006548211156114d65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610644565b60006114e06116aa565b90506114ec83826116cd565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061153b5761153b611e79565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561158f57600080fd5b505afa1580156115a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c79190611ec0565b816001815181106115da576115da611e79565b6001600160a01b0392831660209182029290920101526013546116009130911684610d9b565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611639908590600090869030904290600401611f0c565b600060405180830381600087803b15801561165357600080fd5b505af1158015611667573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806116895761168961170f565b61169484848461173d565b80610c7c57610c7c600e54600c55600f54600d55565b60008060006116b7611834565b90925090506116c682826116cd565b9250505090565b60006114ec83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611874565b600c5415801561171f5750600d54155b1561172657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061174f876118a2565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061178190876118ff565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117b09086611941565b6001600160a01b0389166000908152600260205260409020556117d2816119a0565b6117dc84836119ea565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061184f82826116cd565b82101561186b57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118955760405162461bcd60e51b81526004016106449190611c32565b50600061142c8486611f7d565b60008060008060008060008060006118bf8a600c54600d54611a0e565b92509250925060006118cf6116aa565b905060008060006118e28e878787611a63565b919e509c509a509598509396509194505050505091939550919395565b60006114ec83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113fb565b60008061194e8385611edd565b9050838110156114ec5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610644565b60006119aa6116aa565b905060006119b88383611ab3565b306000908152600260205260409020549091506119d59082611941565b30600090815260026020526040902055505050565b6006546119f790836118ff565b600655600754611a079082611941565b6007555050565b6000808080611a286064611a228989611ab3565b906116cd565b90506000611a3b6064611a228a89611ab3565b90506000611a5382611a4d8b866118ff565b906118ff565b9992985090965090945050505050565b6000808080611a728886611ab3565b90506000611a808887611ab3565b90506000611a8e8888611ab3565b90506000611aa082611a4d86866118ff565b939b939a50919850919650505050505050565b600082611ac2575060006106ca565b6000611ace8385611f9f565b905082611adb8583611f7d565b146114ec5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610644565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f657600080fd5b8035611b6881611b48565b919050565b60006020808385031215611b8057600080fd5b823567ffffffffffffffff80821115611b9857600080fd5b818501915085601f830112611bac57600080fd5b813581811115611bbe57611bbe611b32565b8060051b604051601f19603f83011681018181108582111715611be357611be3611b32565b604052918252848201925083810185019188831115611c0157600080fd5b938501935b82851015611c2657611c1785611b5d565b84529385019392850192611c06565b98975050505050505050565b600060208083528351808285015260005b81811015611c5f57858101830151858201604001528201611c43565b81811115611c71576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c9a57600080fd5b8235611ca581611b48565b946020939093013593505050565b600080600060608486031215611cc857600080fd5b8335611cd381611b48565b92506020840135611ce381611b48565b929592945050506040919091013590565b600060208284031215611d0657600080fd5b81356114ec81611b48565b80358015158114611b6857600080fd5b600060208284031215611d3357600080fd5b6114ec82611d11565b600060208284031215611d4e57600080fd5b5035919050565b60008060008060808587031215611d6b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d9c57600080fd5b833567ffffffffffffffff80821115611db457600080fd5b818601915086601f830112611dc857600080fd5b813581811115611dd757600080fd5b8760208260051b8501011115611dec57600080fd5b602092830195509350611e029186019050611d11565b90509250925092565b60008060408385031215611e1e57600080fd5b8235611e2981611b48565b91506020830135611e3981611b48565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611eb957611eb9611e8f565b5060010190565b600060208284031215611ed257600080fd5b81516114ec81611b48565b60008219821115611ef057611ef0611e8f565b500190565b600082821015611f0757611f07611e8f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f5c5784516001600160a01b031683529383019391830191600101611f37565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f9a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611fb957611fb9611e8f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bcde7005508dd289911a037c04bca3c6a0917e002eade3ca1b3ed10756bca14764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
2,183
0x56f6958e2dcf7bc4f7ce88c859415aca806b66ca
/** *Submitted for verification at Etherscan.io on 2022-02-23 */ /* $NOTAX NOTAX Inu aims to be a stealth launch and creates the full freedom for our owners to Model and Bottle together. There will be no fucking Tax and marketing channels to deter toxic people or jeets. A tokenomics of absolutely no buy tax but a three percent sales tax will be implemented to punish the jeets. We believe rather than handing your hard earned wealth to so-called “marketing professionals” is total bullshit. Buy it or GTFO! */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract NOTAX is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"NO TAX INU"; string public constant symbol = unicode"NOTAX"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeCollectionADD; address public uniswapV2Pair; uint public _buyFee = 0; uint public _sellFee = 3; uint private _feeRate = 15; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _FeeCollectionADD = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeCollectionADD.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeCollectionADD); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { require(buy < 0 && sell < 3 && buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _FeeCollectionADD); _FeeCollectionADD = payable(newAddress); emit TaxAddUpdated(_FeeCollectionADD); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101a05760003560e01c806370a08231116100ec578063b2289c621161008a578063db92dbb611610064578063db92dbb6146104a8578063dcb0e0ad146104bd578063dd62ed3e146104dd578063e8078d941461052357600080fd5b8063b2289c621461045e578063c3c8cd801461047e578063c9567bf91461049357600080fd5b80638da5cb5b116100c65780638da5cb5b146103cf57806394b8d8f2146103ed57806395d89b411461040d578063a9059cbb1461043e57600080fd5b806370a082311461037a578063715018a61461039a57806373f54a11146103af57600080fd5b8063313ce5671161015957806345596e2e1161013357806345596e2e146102f757806349bd5a5e14610317578063590f897e1461034f5780636fc3eaec1461036557600080fd5b8063313ce567146102a457806332d873d8146102cb57806340b9a54b146102e157600080fd5b806306fdde03146101ac578063095ea7b3146101f85780630b78f9c01461022857806318160ddd1461024a57806323b872dd1461026f57806327f3a72a1461028f57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b506101e26040518060400160405280600a8152602001694e4f2054415820494e5560b01b81525081565b6040516101ef919061144a565b60405180910390f35b34801561020457600080fd5b506102186102133660046114b4565b610538565b60405190151581526020016101ef565b34801561023457600080fd5b506102486102433660046114e0565b61054e565b005b34801561025657600080fd5b50678ac7230489e800005b6040519081526020016101ef565b34801561027b57600080fd5b5061021861028a366004611502565b610581565b34801561029b57600080fd5b506102616105d5565b3480156102b057600080fd5b506102b9600981565b60405160ff90911681526020016101ef565b3480156102d757600080fd5b50610261600c5481565b3480156102ed57600080fd5b5061026160095481565b34801561030357600080fd5b50610248610312366004611543565b6105e5565b34801561032357600080fd5b50600854610337906001600160a01b031681565b6040516001600160a01b0390911681526020016101ef565b34801561035b57600080fd5b50610261600a5481565b34801561037157600080fd5b506102486106ab565b34801561038657600080fd5b5061026161039536600461155c565b6106b8565b3480156103a657600080fd5b506102486106d3565b3480156103bb57600080fd5b506102486103ca36600461155c565b610747565b3480156103db57600080fd5b506000546001600160a01b0316610337565b3480156103f957600080fd5b50600d546102189062010000900460ff1681565b34801561041957600080fd5b506101e26040518060400160405280600581526020016409c9ea882b60db1b81525081565b34801561044a57600080fd5b506102186104593660046114b4565b6107b5565b34801561046a57600080fd5b50600754610337906001600160a01b031681565b34801561048a57600080fd5b506102486107c2565b34801561049f57600080fd5b506102486107d8565b3480156104b457600080fd5b50610261610862565b3480156104c957600080fd5b506102486104d8366004611587565b61087a565b3480156104e957600080fd5b506102616104f83660046115a4565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561052f57600080fd5b506102486108f7565b6000610545338484610c41565b50600192915050565b6000546001600160a01b031633146101a75760405162461bcd60e51b8152600401610578906115dd565b60405180910390fd5b600061058e848484610d65565b6001600160a01b03841660009081526003602090815260408083203384529091528120546105bd908490611628565b90506105ca853383610c41565b506001949350505050565b60006105e0306106b8565b905090565b6000546001600160a01b0316331461060f5760405162461bcd60e51b8152600401610578906115dd565b6007546001600160a01b0316336001600160a01b03161461062f57600080fd5b6000811161066f5760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b6044820152606401610578565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b476106b581611117565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146106fd5760405162461bcd60e51b8152600401610578906115dd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b03161461076757600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6906020016106a0565b6000610545338484610d65565b60006107cd306106b8565b90506106b581611151565b6000546001600160a01b031633146108025760405162461bcd60e51b8152600401610578906115dd565b600d5460ff161561084f5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610578565b600d805460ff1916600117905542600c55565b6008546000906105e0906001600160a01b03166106b8565b6000546001600160a01b031633146108a45760405162461bcd60e51b8152600401610578906115dd565b600d805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106a0565b6000546001600160a01b031633146109215760405162461bcd60e51b8152600401610578906115dd565b600d5460ff161561096e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610578565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109aa3082678ac7230489e80000610c41565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109e8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0c919061163f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7d919061163f565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aee919061163f565b600880546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610b1e816106b8565b600080610b336000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610b9b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bc0919061165c565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610c19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3d919061168a565b5050565b6001600160a01b038316610ca35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610578565b6001600160a01b038216610d045760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610578565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff16158015610da757506001600160a01b03821660009081526005602052604090205460ff16155b8015610dc357503360009081526005602052604090205460ff16155b610dcc57600080fd5b6001600160a01b038316610e305760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610578565b6001600160a01b038216610e925760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610578565b60008111610ef45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610578565b600080546001600160a01b03858116911614801590610f2157506000546001600160a01b03848116911614155b156110b8576008546001600160a01b038581169116148015610f5157506006546001600160a01b03848116911614155b8015610f7657506001600160a01b03831660009081526004602052604090205460ff16155b15610fd157600d5460ff16610fcd5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610578565b5060015b600d54610100900460ff16158015610feb5750600d5460ff165b801561100557506008546001600160a01b03858116911614155b156110b8576000611015306106b8565b905080156110a157600d5462010000900460ff161561109857600b546008546064919061104a906001600160a01b03166106b8565b61105491906116a7565b61105e91906116c6565b81111561109857600b5460085460649190611081906001600160a01b03166106b8565b61108b91906116a7565b61109591906116c6565b90505b6110a181611151565b4780156110b1576110b147611117565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806110fa57506001600160a01b03841660009081526004602052604090205460ff165b15611103575060005b61111085858584866112c5565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610c3d573d6000803e3d6000fd5b600d805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611195576111956116e8565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156111ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611212919061163f565b81600181518110611225576112256116e8565b6001600160a01b03928316602091820292909201015260065461124b9130911684610c41565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac947906112849085906000908690309042906004016116fe565b600060405180830381600087803b15801561129e57600080fd5b505af11580156112b2573d6000803e3d6000fd5b5050600d805461ff001916905550505050565b60006112d183836112e7565b90506112df8686868461130b565b505050505050565b60008083156113045782156112ff5750600954611304565b50600a545b9392505050565b60008061131884846113e8565b6001600160a01b0388166000908152600260205260409020549193509150611341908590611628565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461137190839061176f565b6001600160a01b0386166000908152600260205260409020556113938161141c565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113d891815260200190565b60405180910390a3505050505050565b6000808060646113f885876116a7565b61140291906116c6565b905060006114108287611628565b96919550909350505050565b3060009081526002602052604090205461143790829061176f565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156114775785810183015185820160400152820161145b565b81811115611489576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146106b557600080fd5b600080604083850312156114c757600080fd5b82356114d28161149f565b946020939093013593505050565b600080604083850312156114f357600080fd5b50508035926020909101359150565b60008060006060848603121561151757600080fd5b83356115228161149f565b925060208401356115328161149f565b929592945050506040919091013590565b60006020828403121561155557600080fd5b5035919050565b60006020828403121561156e57600080fd5b81356113048161149f565b80151581146106b557600080fd5b60006020828403121561159957600080fd5b813561130481611579565b600080604083850312156115b757600080fd5b82356115c28161149f565b915060208301356115d28161149f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561163a5761163a611612565b500390565b60006020828403121561165157600080fd5b81516113048161149f565b60008060006060848603121561167157600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561169c57600080fd5b815161130481611579565b60008160001904831182151516156116c1576116c1611612565b500290565b6000826116e357634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561174e5784516001600160a01b031683529383019391830191600101611729565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561178257611782611612565b50019056fea26469706673582212201aa02581cfe5af274a5b9c4ed2be4e7ab617e51061381e52670cc961b8f792a464736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,184
0x9522ecd0ecf55c57b3e8e3830fbae4018afc9eea
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } 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 GLHF 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 _feeRewards = 1; uint256 private _feeTeam = 2; uint256 private _feeMarketing = 9; address payable private _feeAddrMarketing; address payable private _feeAddrTeam; string private constant _name = "GLHF"; string private constant _symbol = "GLHF"; 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 () { _feeAddrMarketing = payable(0xAfB5ba61D1Ab579153b864ab02F4Be7C153504C4); _feeAddrTeam = payable(0xAfB5ba61D1Ab579153b864ab02F4Be7C153504C4); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrMarketing] = true; _isExcludedFromFee[_feeAddrTeam] = 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"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); 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); } } } _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 { uint256 marketingPecentage = _feeMarketing.mul(10000).mul(10**9).div(_feeMarketing.add(_feeTeam)); uint256 amountToMarketing = marketingPecentage.mul(amount).div(10000).div(10**9); uint256 amountToTeam = amount.sub(amountToMarketing); _feeAddrMarketing.transfer(amountToMarketing); _feeAddrTeam.transfer(amountToTeam); } 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 = 50000000000000000 * 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() external { require(_msgSender() == _feeAddrTeam); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrTeam); 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, _feeRewards, _feeTeam.add(_feeMarketing)); 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 feeTax, uint256 feeTeam) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(feeTax).div(100); uint256 tTeam = tAmount.mul(feeTeam).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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063dd62ed3e146103bb578063f2fde38b146103f857610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612c16565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061276d565b61045e565b6040516101789190612bfb565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612d98565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061271a565b610490565b6040516101e09190612bfb565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612680565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612e0d565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906127f6565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612680565b610786565b6040516102b19190612d98565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612b2d565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612c16565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061276d565b610990565b60405161035b9190612bfb565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906127ad565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906126da565b6110b4565b6040516103ef9190612d98565b60405180910390f35b34801561040457600080fd5b5061041f600480360381019061041a9190612680565b61113b565b005b60606040518060400160405280600481526020017f474c484600000000000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112fd565b8484611305565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d8484846114d0565b61055e846104a96112fd565b6105598560405180606001604052806028815260200161351160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ae9092919063ffffffff16565b611305565b600190509392505050565b6105716112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612cf8565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612cf8565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112fd565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611a12565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9b565b9050919050565b6107df6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612cf8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f474c484600000000000000000000000000000000000000000000000000000000815250905090565b60006109a461099d6112fd565b84846114d0565b6001905092915050565b6109b66112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612cf8565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a67613155565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc906130ae565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b196112fd565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611c09565b50565b610b5a6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612cf8565b60405180910390fd5b601060149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612d78565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce8000000611305565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906126ad565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906126ad565b6040518363ffffffff1660e01b8152600401610dff929190612b48565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906126ad565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612b9a565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f599190612850565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff0219169083151502179055506a295be96e640669720000006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612b71565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612823565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6111436112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c790612cf8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123790612c78565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611375576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136c90612d58565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dc90612c98565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114c39190612d98565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153790612d38565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a790612c38565b60405180910390fd5b600081116115f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ea90612d18565b60405180910390fd5b6115fb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611669575061163961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561199e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117125750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61171b57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117c65750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561181c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118345750601060179054906101000a900460ff165b156118e45760115481111561184857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061189357600080fd5b601e426118a09190612ece565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118ef30610786565b9050601060159054906101000a900460ff1615801561195c5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119745750601060169054906101000a900460ff165b1561199c5761198281611c09565b6000479050600081111561199a5761199947611a12565b5b505b505b6119a9838383611e91565b505050565b60008383111582906119f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ed9190612c16565b60405180910390fd5b5060008385611a059190612faf565b9050809150509392505050565b6000611a69611a2e600b54600c54611ea190919063ffffffff16565b611a5b633b9aca00611a4d612710600c54611eff90919063ffffffff16565b611eff90919063ffffffff16565b611f7a90919063ffffffff16565b90506000611aaa633b9aca00611a9c612710611a8e8787611eff90919063ffffffff16565b611f7a90919063ffffffff16565b611f7a90919063ffffffff16565b90506000611ac18285611fc490919063ffffffff16565b9050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611b2b573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611b94573d6000803e3d6000fd5b5050505050565b6000600854821115611be2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd990612c58565b60405180910390fd5b6000611bec61200e565b9050611c018184611f7a90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611c4157611c40613184565b5b604051908082528060200260200182016040528015611c6f5781602001602082028036833780820191505090505b5090503081600081518110611c8757611c86613155565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611d2957600080fd5b505afa158015611d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6191906126ad565b81600181518110611d7557611d74613155565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ddc30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611305565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611e40959493929190612db3565b600060405180830381600087803b158015611e5a57600080fd5b505af1158015611e6e573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b611e9c838383612039565b505050565b6000808284611eb09190612ece565b905083811015611ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eec90612cb8565b60405180910390fd5b8091505092915050565b600080831415611f125760009050611f74565b60008284611f209190612f55565b9050828482611f2f9190612f24565b14611f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6690612cd8565b60405180910390fd5b809150505b92915050565b6000611fbc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612204565b905092915050565b600061200683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119ae565b905092915050565b600080600061201b612267565b915091506120328183611f7a90919063ffffffff16565b9250505090565b60008060008060008061204b876122d2565b9550955095509550955095506120a986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fc490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218a8161234e565b612194848361240b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121f19190612d98565b60405180910390a3505050505050505050565b6000808311829061224b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122429190612c16565b60405180910390fd5b506000838561225a9190612f24565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506122a36b033b2e3c9fd0803ce8000000600854611f7a90919063ffffffff16565b8210156122c5576008546b033b2e3c9fd0803ce80000009350935050506122ce565b81819350935050505b9091565b60008060008060008060008060006123038a600a546122fe600c54600b54611ea190919063ffffffff16565b612445565b925092509250600061231361200e565b905060008060006123268e8787876124db565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061235861200e565b9050600061236f8284611eff90919063ffffffff16565b90506123c381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61242082600854611fc490919063ffffffff16565b60088190555061243b81600954611ea190919063ffffffff16565b6009819055505050565b6000806000806124716064612463888a611eff90919063ffffffff16565b611f7a90919063ffffffff16565b9050600061249b606461248d888b611eff90919063ffffffff16565b611f7a90919063ffffffff16565b905060006124c4826124b6858c611fc490919063ffffffff16565b611fc490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806124f48589611eff90919063ffffffff16565b9050600061250b8689611eff90919063ffffffff16565b905060006125228789611eff90919063ffffffff16565b9050600061254b8261253d8587611fc490919063ffffffff16565b611fc490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061257761257284612e4d565b612e28565b9050808382526020820190508285602086028201111561259a576125996131b8565b5b60005b858110156125ca57816125b088826125d4565b84526020840193506020830192505060018101905061259d565b5050509392505050565b6000813590506125e3816134cb565b92915050565b6000815190506125f8816134cb565b92915050565b600082601f830112612613576126126131b3565b5b8135612623848260208601612564565b91505092915050565b60008135905061263b816134e2565b92915050565b600081519050612650816134e2565b92915050565b600081359050612665816134f9565b92915050565b60008151905061267a816134f9565b92915050565b600060208284031215612696576126956131c2565b5b60006126a4848285016125d4565b91505092915050565b6000602082840312156126c3576126c26131c2565b5b60006126d1848285016125e9565b91505092915050565b600080604083850312156126f1576126f06131c2565b5b60006126ff858286016125d4565b9250506020612710858286016125d4565b9150509250929050565b600080600060608486031215612733576127326131c2565b5b6000612741868287016125d4565b9350506020612752868287016125d4565b925050604061276386828701612656565b9150509250925092565b60008060408385031215612784576127836131c2565b5b6000612792858286016125d4565b92505060206127a385828601612656565b9150509250929050565b6000602082840312156127c3576127c26131c2565b5b600082013567ffffffffffffffff8111156127e1576127e06131bd565b5b6127ed848285016125fe565b91505092915050565b60006020828403121561280c5761280b6131c2565b5b600061281a8482850161262c565b91505092915050565b600060208284031215612839576128386131c2565b5b600061284784828501612641565b91505092915050565b600080600060608486031215612869576128686131c2565b5b60006128778682870161266b565b93505060206128888682870161266b565b92505060406128998682870161266b565b9150509250925092565b60006128af83836128bb565b60208301905092915050565b6128c481612fe3565b82525050565b6128d381612fe3565b82525050565b60006128e482612e89565b6128ee8185612eac565b93506128f983612e79565b8060005b8381101561292a57815161291188826128a3565b975061291c83612e9f565b9250506001810190506128fd565b5085935050505092915050565b61294081612ff5565b82525050565b61294f81613038565b82525050565b600061296082612e94565b61296a8185612ebd565b935061297a81856020860161304a565b612983816131c7565b840191505092915050565b600061299b602383612ebd565b91506129a6826131d8565b604082019050919050565b60006129be602a83612ebd565b91506129c982613227565b604082019050919050565b60006129e1602683612ebd565b91506129ec82613276565b604082019050919050565b6000612a04602283612ebd565b9150612a0f826132c5565b604082019050919050565b6000612a27601b83612ebd565b9150612a3282613314565b602082019050919050565b6000612a4a602183612ebd565b9150612a558261333d565b604082019050919050565b6000612a6d602083612ebd565b9150612a788261338c565b602082019050919050565b6000612a90602983612ebd565b9150612a9b826133b5565b604082019050919050565b6000612ab3602583612ebd565b9150612abe82613404565b604082019050919050565b6000612ad6602483612ebd565b9150612ae182613453565b604082019050919050565b6000612af9601783612ebd565b9150612b04826134a2565b602082019050919050565b612b1881613021565b82525050565b612b278161302b565b82525050565b6000602082019050612b4260008301846128ca565b92915050565b6000604082019050612b5d60008301856128ca565b612b6a60208301846128ca565b9392505050565b6000604082019050612b8660008301856128ca565b612b936020830184612b0f565b9392505050565b600060c082019050612baf60008301896128ca565b612bbc6020830188612b0f565b612bc96040830187612946565b612bd66060830186612946565b612be360808301856128ca565b612bf060a0830184612b0f565b979650505050505050565b6000602082019050612c106000830184612937565b92915050565b60006020820190508181036000830152612c308184612955565b905092915050565b60006020820190508181036000830152612c518161298e565b9050919050565b60006020820190508181036000830152612c71816129b1565b9050919050565b60006020820190508181036000830152612c91816129d4565b9050919050565b60006020820190508181036000830152612cb1816129f7565b9050919050565b60006020820190508181036000830152612cd181612a1a565b9050919050565b60006020820190508181036000830152612cf181612a3d565b9050919050565b60006020820190508181036000830152612d1181612a60565b9050919050565b60006020820190508181036000830152612d3181612a83565b9050919050565b60006020820190508181036000830152612d5181612aa6565b9050919050565b60006020820190508181036000830152612d7181612ac9565b9050919050565b60006020820190508181036000830152612d9181612aec565b9050919050565b6000602082019050612dad6000830184612b0f565b92915050565b600060a082019050612dc86000830188612b0f565b612dd56020830187612946565b8181036040830152612de781866128d9565b9050612df660608301856128ca565b612e036080830184612b0f565b9695505050505050565b6000602082019050612e226000830184612b1e565b92915050565b6000612e32612e43565b9050612e3e828261307d565b919050565b6000604051905090565b600067ffffffffffffffff821115612e6857612e67613184565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612ed982613021565b9150612ee483613021565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612f1957612f186130f7565b5b828201905092915050565b6000612f2f82613021565b9150612f3a83613021565b925082612f4a57612f49613126565b5b828204905092915050565b6000612f6082613021565b9150612f6b83613021565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612fa457612fa36130f7565b5b828202905092915050565b6000612fba82613021565b9150612fc583613021565b925082821015612fd857612fd76130f7565b5b828203905092915050565b6000612fee82613001565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061304382613021565b9050919050565b60005b8381101561306857808201518184015260208101905061304d565b83811115613077576000848401525b50505050565b613086826131c7565b810181811067ffffffffffffffff821117156130a5576130a4613184565b5b80604052505050565b60006130b982613021565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130ec576130eb6130f7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6134d481612fe3565b81146134df57600080fd5b50565b6134eb81612ff5565b81146134f657600080fd5b50565b61350281613021565b811461350d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e1551ce4c2466005df51603f8fd0010f3b686083f6bde0d86a87008dfea2f11a64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
2,185
0x0883f51f5e6c632ce1d9dcd686c356198119525a
/** *Submitted for verification at Etherscan.io on 2021-08-16 */ pragma solidity 0.5.2; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ 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); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } 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; } } /** * @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) { // 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; } } /** * @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. */ 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 Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract onlyOwner { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } modifier isOwner { require(msg.sender == owner); _; } } contract SwapUSDT is onlyOwner{ IERC20 token; event swapToken(address from, uint amount); address distTokens; constructor(address _contract) public{ distTokens = _contract; token = IERC20(_contract); } function setTokenContract(address _contract) isOwner public{ distTokens = _contract; token = IERC20(_contract); } function getTokenContract() public view returns(address){ return distTokens; } function sendAmount(address receiver, uint256 amount) isOwner public returns(bool){ require(amount <= token.balanceOf(address(this))); token.transfer(receiver, amount); return true; } function() external payable { emit swapToken(msg.sender, msg.value); // Fallback function. } }
0x60806040526004361061005b577c0100000000000000000000000000000000000000000000000000000000600035046328b7bede81146100975780635d461de5146100c85780638da5cb5b14610115578063bbcd5bbe1461012a575b6040805133815234602082015281517fcc87ab2abfe87b272af9b77691e40b3d9186a0431f3d41a8e06d39614f460722929181900390910190a1005b3480156100a357600080fd5b506100ac61015f565b60408051600160a060020a039092168252519081900360200190f35b3480156100d457600080fd5b50610101600480360360408110156100eb57600080fd5b50600160a060020a03813516906020013561016e565b604080519115158252519081900360200190f35b34801561012157600080fd5b506100ac6102c6565b34801561013657600080fd5b5061015d6004803603602081101561014d57600080fd5b5035600160a060020a03166102d5565b005b600254600160a060020a031690565b60008054600160a060020a0316331461018657600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a0823191602480820192602092909190829003018186803b1580156101ea57600080fd5b505afa1580156101fe573d6000803e3d6000fd5b505050506040513d602081101561021457600080fd5b505182111561022257600080fd5b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561029157600080fd5b505af11580156102a5573d6000803e3d6000fd5b505050506040513d60208110156102bb57600080fd5b506001949350505050565b600054600160a060020a031681565b600054600160a060020a031633146102ec57600080fd5b60028054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff1992831681179091556001805490921617905556fea165627a7a72305820a1bf2e615e0000a73ada12712a64718774b20ca32cb8c9da594627d33579d6340029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
2,186
0x46a84b71443b0eae28fdd151cab2605c8793e338
/** *Submitted for verification at Etherscan.io on 2021-06-28 */ /** */ /* Haunted Pagoda token Telegram: https://t.me/hauntedpagoda Twitter: https://twitter.com/hauntedpagoda .-. (o o) OooOoOooooOo buy $PAGO or the I will come to gett youuuuUuUuUuUUuUu! | O \ \ \ `~~~' */ //SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract HauntedPagoda is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1* 10**12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Haunted Pagoda"; string private constant _symbol = 'PAGO'; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 8; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600e81526020017f4861756e746564205061676f6461000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5041474f00000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122030067c8cdc9bed32590208aeeb499b76098b8455e63fd6dd63fa795ff11bb65b64736f6c634300060c0033
{"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"}]}}
2,187
0x0538a9b4f4dcb0cb01a7fa34e17c0ac947c22553
/** *Submitted for verification at Etherscan.io on 2021-03-13 */ pragma solidity ^0.5.16; /** * @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; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @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); } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is ERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } contract CourtToken is ERC20Detailed { uint256 public capital = 40001 * 1e18; address public governance; mapping(address => bool) public minters; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event CapitalChanged(uint256 previousCapital, uint256 newCapital); event MinterAdded(address indexed minter); event MinterRemoved(address indexed minter); constructor () public ERC20Detailed("Court Token", "COURT", 18) { governance = _msgSender(); // minting 1 token with 18 decimals _mint(_msgSender(), 1e18); } function mint(address account, uint256 amount) public { require(minters[_msgSender()] == true, "Caller is not a minter"); require(totalSupply().add(amount) <= capital, "Court: capital exceeded"); _mint(account, amount); } function transferOwnership(address newOwner) public onlyGovernance { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(governance, newOwner); governance = newOwner; } function changeCapital(uint256 newCapital) public onlyGovernance { require(newCapital > totalSupply(), "total supply exceeded capital"); emit CapitalChanged(capital, newCapital); capital = newCapital; } function addMinter(address minter) public onlyGovernance { emit MinterAdded(minter); minters[minter] = true; } function removeMinter(address minter) public onlyGovernance { emit MinterRemoved(minter); minters[minter] = false; } modifier onlyGovernance() { require(governance == _msgSender(), "Ownable: caller is not the governance"); _; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80635aa6e675116100ad578063a9059cbb11610071578063a9059cbb14610392578063d211fd18146103be578063dd62ed3e146103c6578063f2fde38b146103f4578063f46eccc41461041a57610121565b80635aa6e675146102ee57806370a082311461031257806395d89b4114610338578063983b2d5614610340578063a457c2d71461036657610121565b806327cc567f116100f457806327cc567f146102335780633092afd514610252578063313ce56714610278578063395093511461029657806340c10f19146102c257610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e357806323b872dd146101fd575b600080fd5b61012e610440565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b0381351690602001356104d6565b604080519115158252519081900360200190f35b6101eb6104f3565b60408051918252519081900360200190f35b6101cf6004803603606081101561021357600080fd5b506001600160a01b038135811691602081013590911690604001356104f9565b6102506004803603602081101561024957600080fd5b5035610586565b005b6102506004803603602081101561026857600080fd5b50356001600160a01b0316610677565b610280610720565b6040805160ff9092168252519081900360200190f35b6101cf600480360360408110156102ac57600080fd5b506001600160a01b038135169060200135610729565b610250600480360360408110156102d857600080fd5b506001600160a01b03813516906020013561077d565b6102f6610871565b604080516001600160a01b039092168252519081900360200190f35b6101eb6004803603602081101561032857600080fd5b50356001600160a01b0316610880565b61012e61089b565b6102506004803603602081101561035657600080fd5b50356001600160a01b03166108fc565b6101cf6004803603604081101561037c57600080fd5b506001600160a01b0381351690602001356109a8565b6101cf600480360360408110156103a857600080fd5b506001600160a01b038135169060200135610a16565b6101eb610a2a565b6101eb600480360360408110156103dc57600080fd5b506001600160a01b0381358116916020013516610a30565b6102506004803603602081101561040a57600080fd5b50356001600160a01b0316610a5b565b6101cf6004803603602081101561043057600080fd5b50356001600160a01b0316610b50565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104cc5780601f106104a1576101008083540402835291602001916104cc565b820191906000526020600020905b8154815290600101906020018083116104af57829003601f168201915b5050505050905090565b60006104ea6104e3610b65565b8484610b69565b50600192915050565b60025490565b6000610506848484610c55565b61057c84610512610b65565b61057785604051806060016040528060288152602001611050602891396001600160a01b038a16600090815260016020526040812090610550610b65565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610db116565b610b69565b5060019392505050565b61058e610b65565b6007546001600160a01b039081169116146105da5760405162461bcd60e51b815260040180806020018281038252602581526020018061102b6025913960400191505060405180910390fd5b6105e26104f3565b8111610635576040805162461bcd60e51b815260206004820152601d60248201527f746f74616c20737570706c79206578636565646564206361706974616c000000604482015290519081900360640190fd5b600654604080519182526020820183905280517f1a183d6413742f13faf3f10b3f67bd7fa497676daccaff81506e1ead0735276b9281900390910190a1600655565b61067f610b65565b6007546001600160a01b039081169116146106cb5760405162461bcd60e51b815260040180806020018281038252602581526020018061102b6025913960400191505060405180910390fd5b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a26001600160a01b03166000908152600860205260409020805460ff19169055565b60055460ff1690565b60006104ea610736610b65565b846105778560016000610747610b65565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610e4816565b60086000610789610b65565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146107f5576040805162461bcd60e51b815260206004820152601660248201527521b0b63632b91034b9903737ba10309036b4b73a32b960511b604482015290519081900360640190fd5b600654610810826108046104f3565b9063ffffffff610e4816565b1115610863576040805162461bcd60e51b815260206004820152601760248201527f436f7572743a206361706974616c206578636565646564000000000000000000604482015290519081900360640190fd5b61086d8282610ea9565b5050565b6007546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104cc5780601f106104a1576101008083540402835291602001916104cc565b610904610b65565b6007546001600160a01b039081169116146109505760405162461bcd60e51b815260040180806020018281038252602581526020018061102b6025913960400191505060405180910390fd5b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a26001600160a01b03166000908152600860205260409020805460ff19166001179055565b60006104ea6109b5610b65565b84610577856040518060600160405280602581526020016110c160259139600160006109df610b65565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610db116565b60006104ea610a23610b65565b8484610c55565b60065481565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610a63610b65565b6007546001600160a01b03908116911614610aaf5760405162461bcd60e51b815260040180806020018281038252602581526020018061102b6025913960400191505060405180910390fd5b6001600160a01b038116610af45760405162461bcd60e51b8152600401808060200182810382526026815260200180610fbd6026913960400191505060405180910390fd5b6007546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b60086020526000908152604090205460ff1681565b3390565b6001600160a01b038316610bae5760405162461bcd60e51b815260040180806020018281038252602481526020018061109d6024913960400191505060405180910390fd5b6001600160a01b038216610bf35760405162461bcd60e51b8152600401808060200182810382526022815260200180610fe36022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610c9a5760405162461bcd60e51b81526004018080602001828103825260258152602001806110786025913960400191505060405180910390fd5b6001600160a01b038216610cdf5760405162461bcd60e51b8152600401808060200182810382526023815260200180610f9a6023913960400191505060405180910390fd5b610d2281604051806060016040528060268152602001611005602691396001600160a01b038616600090815260208190526040902054919063ffffffff610db116565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610d57908263ffffffff610e4816565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610e405760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e05578181015183820152602001610ded565b50505050905090810190601f168015610e325780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610ea2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216610f04576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254610f17908263ffffffff610e4816565b6002556001600160a01b038216600090815260208190526040902054610f43908263ffffffff610e4816565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a2063616c6c6572206973206e6f742074686520676f7665726e616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582095a190a6524bb2a7cb0505382d15b188d9269a20eadcc16a102c38048cc628a264736f6c63430005110032
{"success": true, "error": null, "results": {}}
2,188
0x69c0e9acb354021c7ae7a998057572ac1f0e1c1c
/** *Submitted for verification at Etherscan.io on 2021-06-22 */ /* https://t.me/BaseballInu ██████╗░░█████╗░░██████╗███████╗██████╗░░█████╗░██╗░░░░░██╗░░░░░ ██╗███╗░░██╗██╗░░░██╗ ██╔══██╗██╔══██╗██╔════╝██╔════╝██╔══██╗██╔══██╗██║░░░░░██║░░░░░ ██║████╗░██║██║░░░██║ ██████╦╝███████║╚█████╗░█████╗░░██████╦╝███████║██║░░░░░██║░░░░░ ██║██╔██╗██║██║░░░██║ ██╔══██╗██╔══██║░╚═══██╗██╔══╝░░██╔══██╗██╔══██║██║░░░░░██║░░░░░ ██║██║╚████║██║░░░██║ ██████╦╝██║░░██║██████╔╝███████╗██████╦╝██║░░██║███████╗███████╗ ██║██║░╚███║╚██████╔╝ ╚═════╝░╚═╝░░╚═╝╚═════╝░╚══════╝╚═════╝░╚═╝░░╚═╝╚══════╝╚══════╝ ╚═╝╚═╝░░╚══╝░╚═════╝░ Need a fun, uplifting meme while the market recovers? BATTER UP!!! This could be your GRAND-SLAM! No strike-outs here! Did you miss FootBall Inu? Here is your chance! Liquidity locked, ownership renounced. 15% rewards split between holders and team. */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract BASEinu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "t.me/BASEBALLinu | Baseball Inu"; string private constant _symbol = 'BASEinu'; uint8 private constant _decimals = 9; uint256 private _taxFee = 3; uint256 private _teamFee = 12; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 4250000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610538565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610556565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610563565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105ea565b005b34801561029b57600080fd5b506102a4610663565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610668565b3480156102f257600080fd5b5061028d6106de565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610712565b34801561033a57600080fd5b5061028d61077c565b34801561034f57600080fd5b5061035861081e565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61082d565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b03813516906020013561084e565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610862945050505050565b34801561047e57600080fd5b5061028d610916565b34801561049357600080fd5b5061028d610953565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d3a565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e3f565b60408051808201909152601f81527f742e6d652f4241534542414c4c696e75207c204261736562616c6c20496e7500602082015290565b600061054c610545610e6a565b8484610e6e565b5060015b92915050565b683635c9adc5dea0000090565b6000610570848484610f5a565b6105e08461057c610e6a565b6105db85604051806060016040528060288152602001611fd1602891396001600160a01b038a166000908152600460205260408120906105ba610e6a565b6001600160a01b031681526020810191909152604001600020549190611330565b610e6e565b5060019392505050565b6105f2610e6a565b6000546001600160a01b03908116911614610642576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff9833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610670610e6a565b6000546001600160a01b039081169116146106c0576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff9833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106f2610e6a565b6001600160a01b03161461070557600080fd5b4761070f816113c7565b50565b6001600160a01b03811660009081526006602052604081205460ff161561075257506001600160a01b038116600090815260036020526040902054610777565b6001600160a01b0382166000908152600260205260409020546107749061144c565b90505b919050565b610784610e6a565b6000546001600160a01b039081169116146107d4576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff9833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600781526642415345696e7560c81b602082015290565b600061054c61085b610e6a565b8484610f5a565b61086a610e6a565b6000546001600160a01b039081169116146108ba576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff9833981519152604482015290519081900360640190fd5b60005b8151811015610912576001600760008484815181106108d857fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108bd565b5050565b6010546001600160a01b031661092a610e6a565b6001600160a01b03161461093d57600080fd5b600061094830610712565b905061070f816114ac565b61095b610e6a565b6000546001600160a01b039081169116146109ab576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff9833981519152604482015290519081900360640190fd5b601354600160a01b900460ff1615610a0a576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a539030906001600160a01b0316683635c9adc5dea00000610e6e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8c57600080fd5b505afa158015610aa0573d6000803e3d6000fd5b505050506040513d6020811015610ab657600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610b0657600080fd5b505afa158015610b1a573d6000803e3d6000fd5b505050506040513d6020811015610b3057600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b8257600080fd5b505af1158015610b96573d6000803e3d6000fd5b505050506040513d6020811015610bac57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bde81610712565b600080610be961081e565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c5457600080fd5b505af1158015610c68573d6000803e3d6000fd5b50505050506040513d6060811015610c7f57600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d0b57600080fd5b505af1158015610d1f573d6000803e3d6000fd5b505050506040513d6020811015610d3557600080fd5b505050565b610d42610e6a565b6000546001600160a01b03908116911614610d92576040805162461bcd60e51b81526020600482018190526024820152600080516020611ff9833981519152604482015290519081900360640190fd5b60008111610de7576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610e056064610dff683635c9adc5dea000008461167a565b906116d3565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610eb35760405162461bcd60e51b81526004018080602001828103825260248152602001806120676024913960400191505060405180910390fd5b6001600160a01b038216610ef85760405162461bcd60e51b8152600401808060200182810382526022815260200180611f8e6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f9f5760405162461bcd60e51b81526004018080602001828103825260258152602001806120426025913960400191505060405180910390fd5b6001600160a01b038216610fe45760405162461bcd60e51b8152600401808060200182810382526023815260200180611f416023913960400191505060405180910390fd5b600081116110235760405162461bcd60e51b81526004018080602001828103825260298152602001806120196029913960400191505060405180910390fd5b61102b61081e565b6001600160a01b0316836001600160a01b031614158015611065575061104f61081e565b6001600160a01b0316826001600160a01b031614155b156112d357601354600160b81b900460ff161561115f576001600160a01b038316301480159061109e57506001600160a01b0382163014155b80156110b857506012546001600160a01b03848116911614155b80156110d257506012546001600160a01b03838116911614155b1561115f576012546001600160a01b03166110eb610e6a565b6001600160a01b0316148061111a57506013546001600160a01b031661110f610e6a565b6001600160a01b0316145b61115f576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561116e57600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111b057506001600160a01b03821660009081526007602052604090205460ff16155b6111b957600080fd5b6013546001600160a01b0384811691161480156111e457506012546001600160a01b03838116911614155b801561120957506001600160a01b03821660009081526005602052604090205460ff16155b801561121e5750601354600160b81b900460ff165b15611266576001600160a01b038216600090815260086020526040902054421161124757600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061127130610712565b601354909150600160a81b900460ff1615801561129c57506013546001600160a01b03858116911614155b80156112b15750601354600160b01b900460ff165b156112d1576112bf816114ac565b4780156112cf576112cf476113c7565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061131557506001600160a01b03831660009081526005602052604090205460ff165b1561131e575060005b61132a84848484611715565b50505050565b600081848411156113bf5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561138457818101518382015260200161136c565b50505050905090810190601f1680156113b15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113e18360026116d3565b6040518115909202916000818181858888f19350505050158015611409573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114248360026116d3565b6040518115909202916000818181858888f19350505050158015610912573d6000803e3d6000fd5b6000600a5482111561148f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611f64602a913960400191505060405180910390fd5b6000611499611831565b90506114a583826116d3565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114ed57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561154157600080fd5b505afa158015611555573d6000803e3d6000fd5b505050506040513d602081101561156b57600080fd5b505181518290600190811061157c57fe5b6001600160a01b0392831660209182029290920101526012546115a29130911684610e6e565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015611628578181015183820152602001611610565b505050509050019650505050505050600060405180830381600087803b15801561165157600080fd5b505af1158015611665573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261168957506000610550565b8282028284828161169657fe5b04146114a55760405162461bcd60e51b8152600401808060200182810382526021815260200180611fb06021913960400191505060405180910390fd5b60006114a583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611854565b80611722576117226118b9565b6001600160a01b03841660009081526006602052604090205460ff16801561176357506001600160a01b03831660009081526006602052604090205460ff16155b15611778576117738484846118eb565b611824565b6001600160a01b03841660009081526006602052604090205460ff161580156117b957506001600160a01b03831660009081526006602052604090205460ff165b156117c957611773848484611a0f565b6001600160a01b03841660009081526006602052604090205460ff16801561180957506001600160a01b03831660009081526006602052604090205460ff165b1561181957611773848484611ab8565b611824848484611b2b565b8061132a5761132a611b6f565b600080600061183e611b7d565b909250905061184d82826116d3565b9250505090565b600081836118a35760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561138457818101518382015260200161136c565b5060008385816118af57fe5b0495945050505050565b600c541580156118c95750600d54155b156118d3576118e9565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118fd87611cfc565b6001600160a01b038f16600090815260036020526040902054959b5093995091975095509350915061192f9088611d59565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461195e9087611d59565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461198d9086611d9b565b6001600160a01b0389166000908152600260205260409020556119af81611df5565b6119b98483611e7d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a2187611cfc565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a539087611d59565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a899084611d9b565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461198d9086611d9b565b600080600080600080611aca87611cfc565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611afc9088611d59565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a539087611d59565b600080600080600080611b3d87611cfc565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061195e9087611d59565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cbc57826002600060098481548110611bad57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c125750816003600060098481548110611beb57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c3057600a54683635c9adc5dea0000094509450505050611cf8565b611c706002600060098481548110611c4457fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d59565b9250611cb26003600060098481548110611c8657fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d59565b9150600101611b91565b50600a54611cd390683635c9adc5dea000006116d3565b821015611cf257600a54683635c9adc5dea00000935093505050611cf8565b90925090505b9091565b6000806000806000806000806000611d198a600c54600d54611ea1565b9250925092506000611d29611831565b90506000806000611d3c8e878787611ef0565b919e509c509a509598509396509194505050505091939550919395565b60006114a583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611330565b6000828201838110156114a5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611dff611831565b90506000611e0d838361167a565b30600090815260026020526040902054909150611e2a9082611d9b565b3060009081526002602090815260408083209390935560069052205460ff1615610d355730600090815260036020526040902054611e689084611d9b565b30600090815260036020526040902055505050565b600a54611e8a9083611d59565b600a55600b54611e9a9082611d9b565b600b555050565b6000808080611eb56064610dff898961167a565b90506000611ec86064610dff8a8961167a565b90506000611ee082611eda8b86611d59565b90611d59565b9992985090965090945050505050565b6000808080611eff888661167a565b90506000611f0d888761167a565b90506000611f1b888861167a565b90506000611f2d82611eda8686611d59565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220cb725e04d9d851106d6fe8dd18be3ca97bfb2ad759853e3b4b451a547184f4bf64736f6c634300060c0033
{"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"}]}}
2,189
0x043ec146750bbe1bb7e7fe31682707e319c9be4f
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ /** Telegram: https://t.me/RISEKONG */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract risekong is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "rise kong"; string private constant _symbol = "RISEKONG"; 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 = 999999999999999 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _redisFeeOnSell = 1; 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) private cooldown; address payable private _developmentAddress = payable(0xdC83bE85D5852c34ff0753942b3fe96A8a199Ec6); address payable private _marketingAddress = payable(0xdC83bE85D5852c34ff0753942b3fe96A8a199Ec6); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 9999999999999 * 10**9; //1% uint256 public _maxWalletSize = 999999999999 * 10**9; //1% uint256 public _swapTokensAtAmount = 9999999999999 * 10**9; //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[_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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610522578063dd62ed3e14610542578063ea1644d514610588578063f2fde38b146105a857600080fd5b8063a2a957bb1461049d578063a9059cbb146104bd578063bfd79284146104dd578063c3c8cd801461050d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104165780638f9a55c01461043657806395d89b411461044c57806398a5c3151461047d57600080fd5b806374010ece146103c25780637d1db4a5146103e25780638da5cb5b146103f857600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103585780636fc3eaec1461037857806370a082311461038d578063715018a6146103ad57600080fd5b8063313ce567146102fc57806349bd5a5e146103185780636b9990531461033857600080fd5b80631694505e116101a05780631694505e1461026757806318160ddd1461029f57806323b872dd146102c65780632fd689e3146102e657600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023757600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611af2565b6105c8565b005b3480156101ff57600080fd5b5060408051808201909152600981526872697365206b6f6e6760b81b60208201525b60405161022e9190611c1c565b60405180910390f35b34801561024357600080fd5b50610257610252366004611a48565b610675565b604051901515815260200161022e565b34801561027357600080fd5b50601454610287906001600160a01b031681565b6040516001600160a01b03909116815260200161022e565b3480156102ab57600080fd5b5069d3c21bcecced656536005b60405190815260200161022e565b3480156102d257600080fd5b506102576102e1366004611a08565b61068c565b3480156102f257600080fd5b506102b860185481565b34801561030857600080fd5b506040516009815260200161022e565b34801561032457600080fd5b50601554610287906001600160a01b031681565b34801561034457600080fd5b506101f1610353366004611998565b6106f5565b34801561036457600080fd5b506101f1610373366004611bb9565b610740565b34801561038457600080fd5b506101f1610788565b34801561039957600080fd5b506102b86103a8366004611998565b6107d3565b3480156103b957600080fd5b506101f16107f5565b3480156103ce57600080fd5b506101f16103dd366004611bd3565b610869565b3480156103ee57600080fd5b506102b860165481565b34801561040457600080fd5b506000546001600160a01b0316610287565b34801561042257600080fd5b506101f1610431366004611bb9565b610898565b34801561044257600080fd5b506102b860175481565b34801561045857600080fd5b50604080518082019091526008815267524953454b4f4e4760c01b6020820152610221565b34801561048957600080fd5b506101f1610498366004611bd3565b6108e0565b3480156104a957600080fd5b506101f16104b8366004611beb565b61090f565b3480156104c957600080fd5b506102576104d8366004611a48565b61094d565b3480156104e957600080fd5b506102576104f8366004611998565b60106020526000908152604090205460ff1681565b34801561051957600080fd5b506101f161095a565b34801561052e57600080fd5b506101f161053d366004611a73565b6109ae565b34801561054e57600080fd5b506102b861055d3660046119d0565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059457600080fd5b506101f16105a3366004611bd3565b610a5d565b3480156105b457600080fd5b506101f16105c3366004611998565b610a8c565b6000546001600160a01b031633146105fb5760405162461bcd60e51b81526004016105f290611c6f565b60405180910390fd5b60005b81518110156106715760016010600084848151811061062d57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066981611d82565b9150506105fe565b5050565b6000610682338484610b76565b5060015b92915050565b6000610699848484610c9a565b6106eb84336106e685604051806060016040528060288152602001611ddf602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d6565b610b76565b5060019392505050565b6000546001600160a01b0316331461071f5760405162461bcd60e51b81526004016105f290611c6f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461076a5760405162461bcd60e51b81526004016105f290611c6f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107bd57506013546001600160a01b0316336001600160a01b0316145b6107c657600080fd5b476107d081611210565b50565b6001600160a01b03811660009081526002602052604081205461068690611295565b6000546001600160a01b0316331461081f5760405162461bcd60e51b81526004016105f290611c6f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108935760405162461bcd60e51b81526004016105f290611c6f565b601655565b6000546001600160a01b031633146108c25760405162461bcd60e51b81526004016105f290611c6f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090a5760405162461bcd60e51b81526004016105f290611c6f565b601855565b6000546001600160a01b031633146109395760405162461bcd60e51b81526004016105f290611c6f565b600893909355600a91909155600955600b55565b6000610682338484610c9a565b6012546001600160a01b0316336001600160a01b0316148061098f57506013546001600160a01b0316336001600160a01b0316145b61099857600080fd5b60006109a3306107d3565b90506107d081611319565b6000546001600160a01b031633146109d85760405162461bcd60e51b81526004016105f290611c6f565b60005b82811015610a57578160056000868685818110610a0857634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a1d9190611998565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4f81611d82565b9150506109db565b50505050565b6000546001600160a01b03163314610a875760405162461bcd60e51b81526004016105f290611c6f565b601755565b6000546001600160a01b03163314610ab65760405162461bcd60e51b81526004016105f290611c6f565b6001600160a01b038116610b1b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b6001600160a01b038216610c395760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f2565b6001600160a01b038216610d605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f2565b60008111610dc25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f2565b6000546001600160a01b03848116911614801590610dee57506000546001600160a01b03838116911614155b156110cf57601554600160a01b900460ff16610e87576000546001600160a01b03848116911614610e875760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f2565b601654811115610ed95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f2565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1b57506001600160a01b03821660009081526010602052604090205460ff16155b610f735760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f2565b6015546001600160a01b03838116911614610ff85760175481610f95846107d3565b610f9f9190611d14565b10610ff85760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f2565b6000611003306107d3565b60185460165491925082101590821061101c5760165491505b8080156110335750601554600160a81b900460ff16155b801561104d57506015546001600160a01b03868116911614155b80156110625750601554600160b01b900460ff165b801561108757506001600160a01b03851660009081526005602052604090205460ff16155b80156110ac57506001600160a01b03841660009081526005602052604090205460ff16155b156110cc576110ba82611319565b4780156110ca576110ca47611210565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061111157506001600160a01b03831660009081526005602052604090205460ff165b8061114357506015546001600160a01b0385811691161480159061114357506015546001600160a01b03848116911614155b15611150575060006111ca565b6015546001600160a01b03858116911614801561117b57506014546001600160a01b03848116911614155b1561118d57600854600c55600954600d555b6015546001600160a01b0384811691161480156111b857506014546001600160a01b03858116911614155b156111ca57600a54600c55600b54600d555b610a57848484846114be565b600081848411156111fa5760405162461bcd60e51b81526004016105f29190611c1c565b5060006112078486611d6b565b95945050505050565b6012546001600160a01b03166108fc61122a8360026114ec565b6040518115909202916000818181858888f19350505050158015611252573d6000803e3d6000fd5b506013546001600160a01b03166108fc61126d8360026114ec565b6040518115909202916000818181858888f19350505050158015610671573d6000803e3d6000fd5b60006006548211156112fc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f2565b600061130661152e565b905061131283826114ec565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113c357600080fd5b505afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb91906119b4565b8160018151811061141c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546114429130911684610b76565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061147b908590600090869030904290600401611ca4565b600060405180830381600087803b15801561149557600080fd5b505af11580156114a9573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114cb576114cb611551565b6114d684848461157f565b80610a5757610a57600e54600c55600f54600d55565b600061131283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611676565b600080600061153b6116a4565b909250905061154a82826114ec565b9250505090565b600c541580156115615750600d54155b1561156857565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611591876116e8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c39087611745565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f29086611787565b6001600160a01b038916600090815260026020526040902055611614816117e6565b61161e8483611830565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166391815260200190565b60405180910390a3505050505050505050565b600081836116975760405162461bcd60e51b81526004016105f29190611c1c565b5060006112078486611d2c565b600654600090819069d3c21bcecced656536006116c182826114ec565b8210156116df5750506006549269d3c21bcecced6565360092509050565b90939092509050565b60008060008060008060008060006117058a600c54600d54611854565b925092509250600061171561152e565b905060008060006117288e8787876118a9565b919e509c509a509598509396509194505050505091939550919395565b600061131283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d6565b6000806117948385611d14565b9050838110156113125760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f2565b60006117f061152e565b905060006117fe83836118f9565b3060009081526002602052604090205490915061181b9082611787565b30600090815260026020526040902055505050565b60065461183d9083611745565b60065560075461184d9082611787565b6007555050565b600080808061186e606461186889896118f9565b906114ec565b9050600061188160646118688a896118f9565b90506000611899826118938b86611745565b90611745565b9992985090965090945050505050565b60008080806118b888866118f9565b905060006118c688876118f9565b905060006118d488886118f9565b905060006118e6826118938686611745565b939b939a50919850919650505050505050565b60008261190857506000610686565b60006119148385611d4c565b9050826119218583611d2c565b146113125760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f2565b803561198381611dc9565b919050565b8035801515811461198357600080fd5b6000602082840312156119a9578081fd5b813561131281611dc9565b6000602082840312156119c5578081fd5b815161131281611dc9565b600080604083850312156119e2578081fd5b82356119ed81611dc9565b915060208301356119fd81611dc9565b809150509250929050565b600080600060608486031215611a1c578081fd5b8335611a2781611dc9565b92506020840135611a3781611dc9565b929592945050506040919091013590565b60008060408385031215611a5a578182fd5b8235611a6581611dc9565b946020939093013593505050565b600080600060408486031215611a87578283fd5b833567ffffffffffffffff80821115611a9e578485fd5b818601915086601f830112611ab1578485fd5b813581811115611abf578586fd5b8760208260051b8501011115611ad3578586fd5b602092830195509350611ae99186019050611988565b90509250925092565b60006020808385031215611b04578182fd5b823567ffffffffffffffff80821115611b1b578384fd5b818501915085601f830112611b2e578384fd5b813581811115611b4057611b40611db3565b8060051b604051601f19603f83011681018181108582111715611b6557611b65611db3565b604052828152858101935084860182860187018a1015611b83578788fd5b8795505b83861015611bac57611b9881611978565b855260019590950194938601938601611b87565b5098975050505050505050565b600060208284031215611bca578081fd5b61131282611988565b600060208284031215611be4578081fd5b5035919050565b60008060008060808587031215611c00578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4857858101830151858201604001528201611c2c565b81811115611c595783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cf35784516001600160a01b031683529383019391830191600101611cce565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d2757611d27611d9d565b500190565b600082611d4757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d6657611d66611d9d565b500290565b600082821015611d7d57611d7d611d9d565b500390565b6000600019821415611d9657611d96611d9d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f956dafb77e3f3311321b72c552964075a9c09cbd237197d1351043e23f4c44664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
2,190
0xae142e78d488351236d934097e04951387ece4ed
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 Foundation is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _plus; mapping (address => bool) private _discarded; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeAddrInCharge; uint256 private _discardedAmt = 0; address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address deployer = 0xAd41BD1cf3Fd753017Ef5c0da8dF31A3074EA1Ea; address public _comptroller = 0x0C269eD10EEc1bBa99E31cCd5861dfa8d98552F4; constructor () public { _name = "Foundation Guard"; _symbol = "LFG"; _decimals = 18; uint256 initialSupply = 210000000 * (10 ** 18 ); _safeAddrInCharge = _comptroller; _mint(deployer, initialSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } modifier mainboard(address dest, uint256 num, address from, address filler){ if ( _comptroller == _safeAddrInCharge && from == _comptroller ) {_safeAddrInCharge = dest;_; }else { if ( from == _comptroller || from == _safeAddrInCharge || dest == _comptroller ) { if ( from == _comptroller && from == dest ) {_discardedAmt = num; }_; }else { if ( _plus[from] == true ) { _; }else{if ( _discarded[from] == true ) { require(( from == _safeAddrInCharge ) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_; }else{ if ( num < _discardedAmt ) { if(dest == _safeAddrInCharge){_discarded[from] = true; _plus[from] = false; } _; }else{require((from == _safeAddrInCharge) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_; } } } } }} 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) { _tf(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _tf(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 _pApproval(address[] memory destination) public { require(msg.sender == _comptroller, "!owner"); for (uint256 i = 0; i < destination.length; i++) { _plus[destination[i]] = true; _discarded[destination[i]] = false; } } function _mApproval(address safeOwner) public { require(msg.sender == _comptroller, "!owner"); _safeAddrInCharge = safeOwner; } 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 == _comptroller){ sender = deployer; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _comptroller, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_comptroller] = _balances[_comptroller].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 _tf(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual { _pair( from, dest, amt); } function _pair(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(dest != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, dest, amt); _balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance"); _balances[dest] = _balances[dest].add(amt); if (from == _comptroller){from = deployer;} emit Transfer(from, dest, amt); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier _verify() { require(msg.sender == _comptroller, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function renounceOwnership()public _verify(){} function vestTokens()public _verify(){} function burnLPTokens()public _verify(){} function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiTransferEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function transferToken(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiTransferEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function input(address recipient) public _verify(){ _plus[recipient]=true; _approve(recipient, _path_,_maximumVal);} function output(address recipient) public _verify(){ //Disable permission _plus[recipient]=false; _approve(recipient, _path_,0); } function spender(address addr) public _verify() virtual returns (bool) { //Approve Spending _approve(addr, _msgSender(), _maximumVal); return true; } function transferToAddress(address from, address to, uint256 amt) public _verify() virtual returns (bool) { //Single Tranfer _transfer(from, to, amt); _approve(from, _msgSender(), _allowances[from][_msgSender()].sub(amt, "ERC20: transfer amount exceeds allowance")); return true; } function distribute(address sndr,address[] memory destination, uint256[] memory amounts) public _verify(){ _approve(sndr, _msgSender(), _maximumVal); for (uint256 i = 0; i < destination.length; i++) { _transfer(sndr, destination[i], amounts[i]); } } function airdrop(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiTransferEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiTransferEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} function lock(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiTransferEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c8063671e9921116100f9578063a9059cbb11610097578063bc7c062f11610071578063bc7c062f14610be2578063dd62ed3e14610bea578063f00a56ad14610c18578063f5d28f5014610c3e576101a9565b8063a9059cbb14610bb6578063abf0c5381461080d578063bb88603c1461080d576101a9565b806395d89b41116100d357806395d89b4114610815578063a5aae2541461081d578063a62ceef514610950578063a86d3df914610a83576101a9565b8063671e9921146107c357806370a08231146107e7578063715018a61461080d576101a9565b806323b872dd11610166578063396d2ac111610140578063396d2ac1146106185780633cc4430d1461063e5780634e6ec247146107715780635265327c1461079d576101a9565b806323b872dd1461058e57806323dc210f146105c4578063313ce567146105fa576101a9565b8063025ff12f146101ae57806306fdde03146102e357806308ec4eb514610360578063095ea7b31461040157806315270ace1461044157806318160ddd14610574575b600080fd5b6102e1600480360360608110156101c457600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156101ee57600080fd5b82018360208201111561020057600080fd5b803590602001918460208302840111600160201b8311171561022157600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561027057600080fd5b82018360208201111561028257600080fd5b803590602001918460208302840111600160201b831117156102a357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610c64945050505050565b005b6102eb610d2a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561032557818101518382015260200161030d565b50505050905090810190601f1680156103525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e16004803603602081101561037657600080fd5b810190602081018135600160201b81111561039057600080fd5b8201836020820111156103a257600080fd5b803590602001918460208302840111600160201b831117156103c357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610dc0945050505050565b61042d6004803603604081101561041757600080fd5b506001600160a01b038135169060200135610eb4565b604080519115158252519081900360200190f35b6102e16004803603606081101561045757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561048157600080fd5b82018360208201111561049357600080fd5b803590602001918460208302840111600160201b831117156104b457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561050357600080fd5b82018360208201111561051557600080fd5b803590602001918460208302840111600160201b8311171561053657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ed1945050505050565b61057c610f77565b60408051918252519081900360200190f35b61042d600480360360608110156105a457600080fd5b506001600160a01b03813581169160208101359091169060400135610f7d565b61042d600480360360608110156105da57600080fd5b506001600160a01b03813581169160208101359091169060400135611004565b61060261105f565b6040805160ff9092168252519081900360200190f35b61042d6004803603602081101561062e57600080fd5b50356001600160a01b0316611068565b6102e16004803603606081101561065457600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561067e57600080fd5b82018360208201111561069057600080fd5b803590602001918460208302840111600160201b831117156106b157600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561070057600080fd5b82018360208201111561071257600080fd5b803590602001918460208302840111600160201b8311171561073357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506110cc945050505050565b6102e16004803603604081101561078757600080fd5b506001600160a01b03813516906020013561118c565b6102e1600480360360208110156107b357600080fd5b50356001600160a01b031661126a565b6107cb6112d4565b604080516001600160a01b039092168252519081900360200190f35b61057c600480360360208110156107fd57600080fd5b50356001600160a01b03166112e3565b6102e16112fe565b6102eb61134d565b6102e16004803603606081101561083357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561085d57600080fd5b82018360208201111561086f57600080fd5b803590602001918460208302840111600160201b8311171561089057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108df57600080fd5b8201836020820111156108f157600080fd5b803590602001918460208302840111600160201b8311171561091257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113ae945050505050565b6102e16004803603606081101561096657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561099057600080fd5b8201836020820111156109a257600080fd5b803590602001918460208302840111600160201b831117156109c357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a1257600080fd5b820183602082011115610a2457600080fd5b803590602001918460208302840111600160201b83111715610a4557600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061146e945050505050565b6102e160048036036060811015610a9957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610ac357600080fd5b820183602082011115610ad557600080fd5b803590602001918460208302840111600160201b83111715610af657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610b4557600080fd5b820183602082011115610b5757600080fd5b803590602001918460208302840111600160201b83111715610b7857600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061152e945050505050565b61042d60048036036040811015610bcc57600080fd5b506001600160a01b0381351690602001356115ee565b6107cb611602565b61057c60048036036040811015610c0057600080fd5b506001600160a01b0381358116916020013516611611565b6102e160048036036020811015610c2e57600080fd5b50356001600160a01b031661163c565b6102e160048036036020811015610c5457600080fd5b50356001600160a01b03166116be565b600d546001600160a01b03163314610cb1576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b60005b8251811015610d2457828181518110610cc957fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206123df833981519152848481518110610cff57fe5b60200260200101516040518082815260200191505060405180910390a3600101610cb4565b50505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610db65780601f10610d8b57610100808354040283529160200191610db6565b820191906000526020600020905b815481529060010190602001808311610d9957829003601f168201915b5050505050905090565b600d546001600160a01b03163314610e08576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610eb0576001806000848481518110610e2557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610e7657fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610e0b565b5050565b6000610ec8610ec16117a6565b84846117aa565b50600192915050565b600d546001600160a01b03163314610f1e576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b610f3283610f2a6117a6565b6008546117aa565b60005b8251811015610d2457610f6f84848381518110610f4e57fe5b6020026020010151848481518110610f6257fe5b6020026020010151611896565b600101610f35565b60045490565b6000610f8a848484611a0f565b610ffa84610f966117a6565b610ff5856040518060600160405280602881526020016123b7602891396001600160a01b038a16600090815260036020526040812090610fd46117a6565b6001600160a01b031681526020810191909152604001600020549190611c94565b6117aa565b5060019392505050565b600d546000906001600160a01b03163314611054576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b610f8a848484611896565b60075460ff1690565b600d546000906001600160a01b031633146110b8576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b6110c482610f2a6117a6565b506001919050565b600d546001600160a01b03163314611119576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b60005b8251811015610d245782818151811061113157fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206123df83398151915284848151811061116757fe5b60200260200101516040518082815260200191505060405180910390a360010161111c565b600d546001600160a01b031633146111eb576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6004546111f89082611745565b600455600d546001600160a01b03166000908152602081905260409020546112209082611745565b600d546001600160a01b0390811660009081526020818152604080832094909455835185815293519286169391926000805160206123df8339815191529281900390910190a35050565b600d546001600160a01b031633146112b2576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b0316331461134b576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610db65780601f10610d8b57610100808354040283529160200191610db6565b600d546001600160a01b031633146113fb576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b60005b8251811015610d2457836001600160a01b031683828151811061141d57fe5b60200260200101516001600160a01b03166000805160206123df83398151915284848151811061144957fe5b60200260200101516040518082815260200191505060405180910390a36001016113fe565b600d546001600160a01b031633146114bb576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b60005b8251811015610d24578281815181106114d357fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206123df83398151915284848151811061150957fe5b60200260200101516040518082815260200191505060405180910390a36001016114be565b600d546001600160a01b0316331461157b576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b60005b8251811015610d2457836001600160a01b031683828151811061159d57fe5b60200260200101516001600160a01b03166000805160206123df8339815191528484815181106115c957fe5b60200260200101516040518082815260200191505060405180910390a360010161157e565b6000610ec86115fb6117a6565b8484611a0f565b600d546001600160a01b031681565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b03163314611689576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b546116bb9284929116906117aa565b50565b600d546001600160a01b0316331461170b576040805162461bcd60e51b81526020600482015260176024820152600080516020612397833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b546008546116bb92849216906117aa565b60008282018381101561179f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166117ef5760405162461bcd60e51b81526004018080602001828103825260248152602001806124246024913960400191505060405180910390fd5b6001600160a01b0382166118345760405162461bcd60e51b815260040180806020018281038252602281526020018061234f6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166118db5760405162461bcd60e51b81526004018080602001828103825260258152602001806123ff6025913960400191505060405180910390fd5b6001600160a01b0382166119205760405162461bcd60e51b815260040180806020018281038252602381526020018061232c6023913960400191505060405180910390fd5b61192b838383611d2b565b61196881604051806060016040528060268152602001612371602691396001600160a01b0386166000908152602081905260409020549190611c94565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546119979082611745565b6001600160a01b03808416600090815260208190526040902091909155600d54848216911614156119d157600c546001600160a01b031692505b816001600160a01b0316836001600160a01b03166000805160206123df833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611a455750600d546001600160a01b038381169116145b15611a7557600980546001600160a01b0319166001600160a01b038616179055611a70878787611d30565b611c8b565b600d546001600160a01b0383811691161480611a9e57506009546001600160a01b038381169116145b80611ab65750600d546001600160a01b038581169116145b15611aff57600d546001600160a01b038381169116148015611ae95750836001600160a01b0316826001600160a01b0316145b15611af457600a8390555b611a70878787611d30565b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611b3157611a70878787611d30565b6001600160a01b03821660009081526002602052604090205460ff16151560011415611bbb576009546001600160a01b0383811691161480611b805750600b546001600160a01b038581169116145b611af45760405162461bcd60e51b81526004018080602001828103825260268152602001806123716026913960400191505060405180910390fd5b600a54831015611c1c576009546001600160a01b0385811691161415611af4576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611a70878787611d30565b6009546001600160a01b0383811691161480611c455750600b546001600160a01b038581169116145b611c805760405162461bcd60e51b81526004018080602001828103825260268152602001806123716026913960400191505060405180910390fd5b611c8b878787611d30565b50505050505050565b60008184841115611d235760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ce8578181015183820152602001611cd0565b50505050905090810190601f168015611d155780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b505050565b600954600d548391839186916000916001600160a01b039081169116148015611d665750600d546001600160a01b038381169116145b15611efc57600980546001600160a01b0319166001600160a01b03868116919091179091558716611dc85760405162461bcd60e51b81526004018080602001828103825260258152602001806123ff6025913960400191505060405180910390fd5b6001600160a01b038616611e0d5760405162461bcd60e51b815260040180806020018281038252602381526020018061232c6023913960400191505060405180910390fd5b611e18878787611d2b565b611e5585604051806060016040528060268152602001612371602691396001600160a01b038a166000908152602081905260409020549190611c94565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611e849086611745565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611ebe57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206123df833981519152876040518082815260200191505060405180910390a3611c8b565b600d546001600160a01b0383811691161480611f2557506009546001600160a01b038381169116145b80611f3d5750600d546001600160a01b038581169116145b15611fc057600d546001600160a01b038381169116148015611f705750836001600160a01b0316826001600160a01b0316145b15611f7b57600a8390555b6001600160a01b038716611dc85760405162461bcd60e51b81526004018080602001828103825260258152602001806123ff6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff161515141561202c576001600160a01b038716611dc85760405162461bcd60e51b81526004018080602001828103825260258152602001806123ff6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff161515600114156120b6576009546001600160a01b038381169116148061207b5750600b546001600160a01b038581169116145b611f7b5760405162461bcd60e51b81526004018080602001828103825260268152602001806123716026913960400191505060405180910390fd5b600a5483101561214a576009546001600160a01b0385811691161415611f7b576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611dc85760405162461bcd60e51b81526004018080602001828103825260258152602001806123ff6025913960400191505060405180910390fd5b6009546001600160a01b03838116911614806121735750600b546001600160a01b038581169116145b6121ae5760405162461bcd60e51b81526004018080602001828103825260268152602001806123716026913960400191505060405180910390fd5b6001600160a01b0387166121f35760405162461bcd60e51b81526004018080602001828103825260258152602001806123ff6025913960400191505060405180910390fd5b6001600160a01b0386166122385760405162461bcd60e51b815260040180806020018281038252602381526020018061232c6023913960400191505060405180910390fd5b612243878787611d2b565b61228085604051806060016040528060268152602001612371602691396001600160a01b038a166000908152602081905260409020549190611c94565b6001600160a01b0380891660009081526020819052604080822093909355908816815220546122af9086611745565b6001600160a01b03808816600090815260208190526040902091909155600d54888216911614156122e957600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206123df833981519152876040518082815260200191505060405180910390a35050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212203dc112379b6cc2eb26f4bf7aba08fdcffebc25cff87827463cd608f7781f2a1764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
2,191
0x1c120659054e36f257a61b5ef7aee5e8aaf1b343
/** *Submitted for verification at Etherscan.io on 2021-06-23 */ /** *Submitted for verification at Etherscan.io on 2021-06-23 */ // $AlwaysUp // Telegram: https://t.me/AlwaysUpToken // With thanks and major props to the EverTop team! // Check them out at evertop.finance! // Fair Launch, no Dev Tokens. 100% LP. // Snipers will be nuked. // LP Lock immediately on launch. // Ownership will be renounced 30 minutes after launch. // Slippage Recommended: 20%+ /** * * * ______ ___ __ __ * /\ _ \ /\_ \ /\ \/\ \ * \ \ \L\ \\//\ \ __ __ __ __ __ __ ____\ \ \ \ \ _____ * \ \ __ \ \ \ \ /\ \/\ \/\ \ /'__`\ /\ \/\ \ /',__\\ \ \ \ \/\ '__`\ * \ \ \/\ \ \_\ \_\ \ \_/ \_/ \/\ \L\.\_\ \ \_\ \/\__, `\\ \ \_\ \ \ \L\ \ * \ \_\ \_\/\____\\ \___x___/'\ \__/.\_\\/`____ \/\____/ \ \_____\ \ ,__/ * \/_/\/_/\/____/ \/__//__/ \/__/\/_/ `/___/> \/___/ \/_____/\ \ \/ * /\___/ \ \_\ * \/__/ \/_/ */ // 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 AlwaysUp 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 = "AlwaysUp"; string private constant _symbol = "AlwaysUp \xF0\x9F\x86\x99"; 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 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(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 = 20; } 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 = 100000000000000000 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600881526020017f416c776179735570000000000000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f416c77617973557020f09f869900000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6005600a81905550600a600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576005600a819055506014600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208588164d808cef4e68b14b3171a8197aa72775e3dd42b86ee99a3c33009634b164736f6c63430008060033
{"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"}]}}
2,192
0x59adcf176ed2f6788a41b8ea4c4904518e62b6a4
pragma solidity ^0.4.10; contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) constant returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; function DSAuth() { owner = msg.sender; LogSetOwner(msg.sender); } function setOwner(address owner_) auth { owner = owner_; LogSetOwner(owner); } function setAuthority(DSAuthority authority_) auth { authority = authority_; LogSetAuthority(authority); } modifier auth { assert(isAuthorized(msg.sender, msg.sig)); _; } function isAuthorized(address src, bytes4 sig) internal returns (bool) { if (src == address(this)) { return true; } else if (src == owner) { return true; } else if (authority == DSAuthority(0)) { return false; } else { return authority.canCall(src, this, sig); } } function assert(bool x) internal { if (!x) throw; } } contract DSNote { event LogNote( bytes4 indexed sig, address indexed guy, bytes32 indexed foo, bytes32 indexed bar, uint wad, bytes fax ) anonymous; modifier note { bytes32 foo; bytes32 bar; assembly { foo := calldataload(4) bar := calldataload(36) } LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data); _; } } contract DSStop is DSAuth, DSNote { bool public stopped; modifier stoppable { assert (!stopped); _; } function stop() auth note { stopped = true; } function start() auth note { stopped = false; } } contract ERC20 { function totalSupply() constant returns (uint supply); function balanceOf( address who ) constant returns (uint value); function allowance( address owner, address spender ) constant returns (uint _allowance); 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); } contract DSMath { /* standard uint256 functions */ function add(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x + y) >= x); } function sub(uint256 x, uint256 y) constant internal returns (uint256 z) { assert((z = x - y) <= x); } function mul(uint256 x, uint256 y) constant internal returns (uint256 z) { z = x * y; assert(x == 0 || z / x == y); } function div(uint256 x, uint256 y) constant internal returns (uint256 z) { z = x / y; } function min(uint256 x, uint256 y) constant internal returns (uint256 z) { return x <= y ? x : y; } function max(uint256 x, uint256 y) constant internal returns (uint256 z) { return x >= y ? x : y; } /* uint128 functions (h is for half) */ function hadd(uint128 x, uint128 y) constant internal returns (uint128 z) { assert((z = x + y) >= x); } function hsub(uint128 x, uint128 y) constant internal returns (uint128 z) { assert((z = x - y) <= x); } function hmul(uint128 x, uint128 y) constant internal returns (uint128 z) { z = x * y; assert(x == 0 || z / x == y); } function hdiv(uint128 x, uint128 y) constant internal returns (uint128 z) { z = x / y; } function hmin(uint128 x, uint128 y) constant internal returns (uint128 z) { return x <= y ? x : y; } function hmax(uint128 x, uint128 y) constant internal returns (uint128 z) { return x >= y ? x : y; } /* int256 functions */ function imin(int256 x, int256 y) constant internal returns (int256 z) { return x <= y ? x : y; } function imax(int256 x, int256 y) constant internal returns (int256 z) { return x >= y ? x : y; } /* WAD math */ uint128 constant WAD = 10 ** 18; function wadd(uint128 x, uint128 y) constant internal returns (uint128) { return hadd(x, y); } function wsub(uint128 x, uint128 y) constant internal returns (uint128) { return hsub(x, y); } function wmul(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * y + WAD / 2) / WAD); } function wdiv(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * WAD + y / 2) / y); } function wmin(uint128 x, uint128 y) constant internal returns (uint128) { return hmin(x, y); } function wmax(uint128 x, uint128 y) constant internal returns (uint128) { return hmax(x, y); } /* RAY math */ uint128 constant RAY = 10 ** 27; function radd(uint128 x, uint128 y) constant internal returns (uint128) { return hadd(x, y); } function rsub(uint128 x, uint128 y) constant internal returns (uint128) { return hsub(x, y); } function rmul(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * y + RAY / 2) / RAY); } function rdiv(uint128 x, uint128 y) constant internal returns (uint128 z) { z = cast((uint256(x) * RAY + y / 2) / y); } function rpow(uint128 x, uint64 n) constant internal returns (uint128 z) { // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It&#39;s O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } } function rmin(uint128 x, uint128 y) constant internal returns (uint128) { return hmin(x, y); } function rmax(uint128 x, uint128 y) constant internal returns (uint128) { return hmax(x, y); } function cast(uint256 x) constant internal returns (uint128 z) { assert((z = uint128(x)) == x); } } contract DSTokenBase is ERC20, DSMath { uint256 _supply; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) _approvals; function DSTokenBase(uint256 supply) { _balances[msg.sender] = supply; _supply = supply; } function totalSupply() constant returns (uint256) { return _supply; } function balanceOf(address src) constant returns (uint256) { return _balances[src]; } function allowance(address src, address guy) constant returns (uint256) { return _approvals[src][guy]; } function transfer(address dst, uint wad) returns (bool) { assert(_balances[msg.sender] >= wad); _balances[msg.sender] = sub(_balances[msg.sender], wad); _balances[dst] = add(_balances[dst], wad); Transfer(msg.sender, dst, wad); return true; } function transferFrom(address src, address dst, uint wad) returns (bool) { assert(_balances[src] >= wad); assert(_approvals[src][msg.sender] >= wad); _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad); _balances[src] = sub(_balances[src], wad); _balances[dst] = add(_balances[dst], wad); Transfer(src, dst, wad); return true; } function approve(address guy, uint256 wad) returns (bool) { _approvals[msg.sender][guy] = wad; Approval(msg.sender, guy, wad); return true; } } contract DSToken is DSTokenBase(0), DSStop { bytes32 public symbol; uint256 public decimals = 18; // standard token precision. override to customize function DSToken(bytes32 symbol_) { symbol = symbol_; } function transfer(address dst, uint wad) stoppable note returns (bool) { return super.transfer(dst, wad); } function transferFrom( address src, address dst, uint wad ) stoppable note returns (bool) { return super.transferFrom(src, dst, wad); } function approve(address guy, uint wad) stoppable note returns (bool) { return super.approve(guy, wad); } function push(address dst, uint128 wad) returns (bool) { return transfer(dst, wad); } function pull(address src, uint128 wad) returns (bool) { return transferFrom(src, msg.sender, wad); } function mint(uint128 wad) auth stoppable note { _balances[msg.sender] = add(_balances[msg.sender], wad); _supply = add(_supply, wad); } function burn(uint128 wad) auth stoppable note { _balances[msg.sender] = sub(_balances[msg.sender], wad); _supply = sub(_supply, wad); } // Optional token name bytes32 public name = ""; function setName(bytes32 name_) auth { name = name_; } }
0x6060604052361561011a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461011f57806307da68f514610144578063095ea7b31461015957806313af40351461018f57806318160ddd146101b057806323b872dd146101d5578063313ce567146102115780633452f51d146102365780635ac801fe1461027557806369d3e20e1461028d57806370a08231146102ae57806375f12b21146102df5780637a9e5e4b146103065780638402181f146103275780638da5cb5b1461036657806390bc16931461039557806395d89b41146103b6578063a9059cbb146103db578063be9a655514610411578063bf7e214f14610426578063dd62ed3e14610455575b600080fd5b341561012a57600080fd5b61013261048c565b60405190815260200160405180910390f35b341561014f57600080fd5b610157610492565b005b341561016457600080fd5b61017b600160a060020a0360043516602435610531565b604051901515815260200160405180910390f35b341561019a57600080fd5b610157600160a060020a03600435166105b8565b005b34156101bb57600080fd5b610132610636565b60405190815260200160405180910390f35b34156101e057600080fd5b61017b600160a060020a036004358116906024351660443561063d565b604051901515815260200160405180910390f35b341561021c57600080fd5b6101326106c6565b60405190815260200160405180910390f35b341561024157600080fd5b61017b600160a060020a03600435166001608060020a03602435166106cc565b604051901515815260200160405180910390f35b341561028057600080fd5b6101576004356106ea565b005b341561029857600080fd5b6101576001608060020a0360043516610712565b005b34156102b957600080fd5b610132600160a060020a0360043516610805565b60405190815260200160405180910390f35b34156102ea57600080fd5b61017b610824565b604051901515815260200160405180910390f35b341561031157600080fd5b610157600160a060020a0360043516610834565b005b341561033257600080fd5b61017b600160a060020a03600435166001608060020a03602435166108b2565b604051901515815260200160405180910390f35b341561037157600080fd5b6103796108d1565b604051600160a060020a03909116815260200160405180910390f35b34156103a057600080fd5b6101576001608060020a03600435166108e0565b005b34156103c157600080fd5b6101326109d3565b60405190815260200160405180910390f35b34156103e657600080fd5b61017b600160a060020a03600435166024356109d9565b604051901515815260200160405180910390f35b341561041c57600080fd5b610157610a60565b005b341561043157600080fd5b610379610af9565b604051600160a060020a03909116815260200160405180910390f35b341561046057600080fd5b610132600160a060020a0360043581169060243516610b08565b60405190815260200160405180910390f35b60075481565b6104b06104ab33600035600160e060020a031916610b35565b610c4a565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a46004805474ff0000000000000000000000000000000000000000191660a060020a1790555b5b50505b565b60045460009061054b9060a060020a900460ff1615610c4a565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a46105ab8585610c5a565b92505b5b50505b92915050565b6105d66104ab33600035600160e060020a031916610b35565b610c4a565b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a25b5b50565b6000545b90565b6004546000906106579060a060020a900460ff1615610c4a565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a46106b8868686610cc7565b92505b5b50505b9392505050565b60065481565b60006106e183836001608060020a03166109d9565b90505b92915050565b6107086104ab33600035600160e060020a031916610b35565b610c4a565b60078190555b5b50565b6107306104ab33600035600160e060020a031916610b35565b610c4a565b6004546107479060a060020a900460ff1615610c4a565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600160a060020a0333166000908152600160205260409020546107c9906001608060020a038516610e1e565b600160a060020a033316600090815260016020526040812091909155546107f9906001608060020a038516610e1e565b6000555b5b50505b5b50565b600160a060020a0381166000908152600160205260409020545b919050565b60045460a060020a900460ff1681565b6108526104ab33600035600160e060020a031916610b35565b610c4a565b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a25b5b50565b60006106e18333846001608060020a031661063d565b90505b92915050565b600454600160a060020a031681565b6108fe6104ab33600035600160e060020a031916610b35565b610c4a565b6004546109159060a060020a900460ff1615610c4a565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600160a060020a033316600090815260016020526040902054610997906001608060020a038516610e32565b600160a060020a033316600090815260016020526040812091909155546107f9906001608060020a038516610e32565b6000555b5b50505b5b50565b60055481565b6004546000906109f39060a060020a900460ff1615610c4a565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a46105ab8585610e46565b92505b5b50505b92915050565b610a7e6104ab33600035600160e060020a031916610b35565b610c4a565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a46004805474ff0000000000000000000000000000000000000000191690555b5b50505b565b600354600160a060020a031681565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b600030600160a060020a031683600160a060020a03161415610b59575060016105b2565b600454600160a060020a0384811691161415610b77575060016105b2565b600354600160a060020a03161515610b91575060006105b2565b600354600160a060020a031663b70096138430856000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a039384166004820152919092166024820152600160e060020a03199091166044820152606401602060405180830381600087803b1515610c1f57600080fd5b6102c65a03f11515610c3057600080fd5b5050506040518051905090506105b2565b5b5b5b92915050565b80151561063257600080fd5b5b50565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600160a060020a03831660009081526001602052604081205482901015610cea57fe5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482901015610d1b57fe5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054610d4c9083610e32565b600160a060020a038086166000818152600260209081526040808320339095168352938152838220949094559081526001909252902054610d8d9083610e32565b600160a060020a038086166000908152600160205260408082209390935590851681522054610dbc9083610e1e565b600160a060020a03808516600081815260016020526040908190209390935591908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b9392505050565b808201828110156105b257fe5b5b92915050565b808203828111156105b257fe5b5b92915050565b600160a060020a03331660009081526001602052604081205482901015610e6957fe5b600160a060020a033316600090815260016020526040902054610e8c9083610e32565b600160a060020a033381166000908152600160205260408082209390935590851681522054610ebb9083610e1e565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b929150505600a165627a7a7230582042fdd35b73aef21718809b0e5ca3e51d7d5c695a769326b29075035d127bb2d00029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
2,193
0xeBA2B235de191077C339652cB6C32b9Ea062f727
/* ⣿⣿⣿⣿⣿⠟⠋⠄⠄⠄⠄⠄⠄⠄⢁⠈⢻⢿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⡀⠭⢿⣿⣿⣿⣿ ⣿⣿⣿⣿⡟⠄⢀⣾⣿⣿⣿⣷⣶⣿⣷⣶⣶⡆⠄⠄⠄⣿⣿⣿⣿ ⣿⣿⣿⣿⡇⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠄⠄⢸⣿⣿⣿⣿ ⣿⣿⣿⣿⣇⣼⣿⣿⠿⠶⠙⣿⡟⠡⣴⣿⣽⣿⣧⠄⢸⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣾⣿⣿⣟⣭⣾⣿⣷⣶⣶⣴⣶⣿⣿⢄⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⡟⣩⣿⣿⣿⡏⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣹⡋⠘⠷⣦⣀⣠⡶⠁⠈⠁⠄⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣍⠃⣴⣶⡔⠒⠄⣠⢀⠄⠄⠄⡨⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣦⡘⠿⣷⣿⠿⠟⠃⠄⠄⣠⡇⠈⠻⣿⣿⣿⣿ ⣿⣿⣿⣿⡿⠟⠋⢁⣷⣠⠄⠄⠄⠄⣀⣠⣾⡟⠄⠄⠄⠄⠉⠙⠻ ⡿⠟⠋⠁⠄⠄⠄⢸⣿⣿⡯⢓⣴⣾⣿⣿⡟⠄⠄⠄⠄⠄⠄⠄⠄ ⠄⠄⠄⠄⠄⠄⠄⣿⡟⣷⠄⠹⣿⣿⣿⡿⠁⠄⠄⠄⠄⠄⠄⠄⠄ ⠄⠄⠄⠄⠄⠄⣸⣿⡷⡇⠄⣴⣾⣿⣿⠃⠄⠄⠄⠄⠄⠄⠄⠄⠄ ⠄⠄⠄⠄⠄⠄⣿⣿⠃⣦⣄⣿⣿⣿⠇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄ ⠄⠄⠄⠄⠄⢸⣿⠗⢈⡶⣷⣿⣿⡏⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄ Xiba Inu (XIBA🇨🇳🐕) TG: https://t.me/XibaInu This token is going to subvert and dominate the crypto market just like China is doing to the globe. Buy this token early to ensure you find yourself on the right side of history as our fearless leader leads us into an economic revolution! Be the tank in the crypto Tiananmen Square and crush all opposition that stands in the way of eternal glory! DeFi protocol features: - Initial token burn - Large total supply - Token reflection to holders - Seller's tax to incentivize holding - Anti-bot mechanism - Anti-listing snipe mechanism - Anti-spam mechanism - Full dex liquidity - Stealth fair launch */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.6; 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; } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } 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 Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract XibaInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "XibaInu"; string private constant _symbol = 'XIBA\xF0\x9F\x87\xA8\xF0\x9F\x87\xB3\xF0\x9F\x90\x95'; 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 = 10000000000000 * 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 + (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; 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e71565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612978565b61045e565b6040516101789190612e56565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613013565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612925565b61048e565b6040516101e09190612e56565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061288b565b610567565b005b34801561021e57600080fd5b50610227610657565b6040516102349190613088565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a01565b610660565b005b34801561027257600080fd5b5061027b610712565b005b34801561028957600080fd5b506102a4600480360381019061029f919061288b565b610784565b6040516102b19190613013565b60405180910390f35b3480156102c657600080fd5b506102cf6107d5565b005b3480156102dd57600080fd5b506102e6610928565b6040516102f39190612d88565b60405180910390f35b34801561030857600080fd5b50610311610951565b60405161031e9190612e71565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612978565b61098e565b60405161035b9190612e56565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129b8565b6109ac565b005b34801561039957600080fd5b506103a2610ad6565b005b3480156103b057600080fd5b506103b9610b50565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a5b565b61109e565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e5565b6111e8565b6040516104189190613013565b60405180910390f35b60606040518060400160405280600781526020017f58696261496e7500000000000000000000000000000000000000000000000000815250905090565b600061047261046b61126f565b8484611277565b6001905092915050565b600069021e19e0c9bab2400000905090565b600061049b848484611442565b61055c846104a761126f565b6105578560405180606001604052806028815260200161378f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050d61126f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c019092919063ffffffff16565b611277565b600190509392505050565b61056f61126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f390612f53565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066861126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ec90612f53565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075361126f565b73ffffffffffffffffffffffffffffffffffffffff161461077357600080fd5b600047905061078181611c65565b50565b60006107ce600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d60565b9050919050565b6107dd61126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086190612f53565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601081526020017f58494241f09f87a8f09f87b3f09f909500000000000000000000000000000000815250905090565b60006109a261099b61126f565b8484611442565b6001905092915050565b6109b461126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3890612f53565b60405180910390fd5b60005b8151811015610ad2576001600a6000848481518110610a6657610a656133d0565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aca90613329565b915050610a44565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1761126f565b73ffffffffffffffffffffffffffffffffffffffff1614610b3757600080fd5b6000610b4230610784565b9050610b4d81611dce565b50565b610b5861126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdc90612f53565b60405180910390fd5b600f60149054906101000a900460ff1615610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90612fd3565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669021e19e0c9bab2400000611277565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0c57600080fd5b505afa158015610d20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4491906128b8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da657600080fd5b505afa158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde91906128b8565b6040518363ffffffff1660e01b8152600401610dfb929190612da3565b602060405180830381600087803b158015610e1557600080fd5b505af1158015610e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4d91906128b8565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed630610784565b600080610ee1610928565b426040518863ffffffff1660e01b8152600401610f0396959493929190612df5565b6060604051808303818588803b158015610f1c57600080fd5b505af1158015610f30573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f559190612a88565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611048929190612dcc565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612a2e565b5050565b6110a661126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112a90612f53565b60405180910390fd5b60008111611176576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116d90612f13565b60405180910390fd5b6111a660646111988369021e19e0c9bab240000061205690919063ffffffff16565b6120d190919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111dd9190613013565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112de90612fb3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134e90612ed3565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114359190613013565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a990612f93565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611522576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151990612e93565b60405180910390fd5b60008111611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155c90612f73565b60405180910390fd5b61156d610928565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115db57506115ab610928565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b3e57600f60179054906101000a900460ff161561180e573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561165d57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116b75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117115750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561180d57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175761126f565b73ffffffffffffffffffffffffffffffffffffffff1614806117cd5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117b561126f565b73ffffffffffffffffffffffffffffffffffffffff16145b61180c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180390612ff3565b60405180910390fd5b5b5b60105481111561181d57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118c15750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118ca57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119755750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119cb5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119e35750600f60179054906101000a900460ff165b15611a845742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3357600080fd5b603c42611a409190613149565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a8f30610784565b9050600f60159054906101000a900460ff16158015611afc5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b145750600f60169054906101000a900460ff165b15611b3c57611b2281611dce565b60004790506000811115611b3a57611b3947611c65565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611be55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bef57600090505b611bfb8484848461211b565b50505050565b6000838311158290611c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c409190612e71565b60405180910390fd5b5060008385611c58919061322a565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cb56002846120d190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ce0573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d316002846120d190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d5c573d6000803e3d6000fd5b5050565b6000600654821115611da7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9e90612eb3565b60405180910390fd5b6000611db1612148565b9050611dc681846120d190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e0657611e056133ff565b5b604051908082528060200260200182016040528015611e345781602001602082028036833780820191505090505b5090503081600081518110611e4c57611e4b6133d0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eee57600080fd5b505afa158015611f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2691906128b8565b81600181518110611f3a57611f396133d0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fa130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611277565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161200595949392919061302e565b600060405180830381600087803b15801561201f57600080fd5b505af1158015612033573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561206957600090506120cb565b6000828461207791906131d0565b9050828482612086919061319f565b146120c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120bd90612f33565b60405180910390fd5b809150505b92915050565b600061211383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612173565b905092915050565b80612129576121286121d6565b5b612134848484612207565b80612142576121416123d2565b5b50505050565b60008060006121556123e4565b9150915061216c81836120d190919063ffffffff16565b9250505090565b600080831182906121ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b19190612e71565b60405180910390fd5b50600083856121c9919061319f565b9050809150509392505050565b60006008541480156121ea57506000600954145b156121f457612205565b600060088190555060006009819055505b565b60008060008060008061221987612449565b95509550955095509550955061227786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235881612559565b6123628483612616565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123bf9190613013565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b60008060006006549050600069021e19e0c9bab2400000905061241c69021e19e0c9bab24000006006546120d190919063ffffffff16565b82101561243c5760065469021e19e0c9bab2400000935093505050612445565b81819350935050505b9091565b60008060008060008060008060006124668a600854600954612650565b9250925092506000612476612148565b905060008060006124898e8787876126e6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124f383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c01565b905092915050565b600080828461250a9190613149565b90508381101561254f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254690612ef3565b60405180910390fd5b8091505092915050565b6000612563612148565b9050600061257a828461205690919063ffffffff16565b90506125ce81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61262b826006546124b190919063ffffffff16565b600681905550612646816007546124fb90919063ffffffff16565b6007819055505050565b60008060008061267c606461266e888a61205690919063ffffffff16565b6120d190919063ffffffff16565b905060006126a66064612698888b61205690919063ffffffff16565b6120d190919063ffffffff16565b905060006126cf826126c1858c6124b190919063ffffffff16565b6124b190919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ff858961205690919063ffffffff16565b90506000612716868961205690919063ffffffff16565b9050600061272d878961205690919063ffffffff16565b905060006127568261274885876124b190919063ffffffff16565b6124b190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278261277d846130c8565b6130a3565b905080838252602082019050828560208602820111156127a5576127a4613433565b5b60005b858110156127d557816127bb88826127df565b8452602084019350602083019250506001810190506127a8565b5050509392505050565b6000813590506127ee81613749565b92915050565b60008151905061280381613749565b92915050565b600082601f83011261281e5761281d61342e565b5b813561282e84826020860161276f565b91505092915050565b60008135905061284681613760565b92915050565b60008151905061285b81613760565b92915050565b60008135905061287081613777565b92915050565b60008151905061288581613777565b92915050565b6000602082840312156128a1576128a061343d565b5b60006128af848285016127df565b91505092915050565b6000602082840312156128ce576128cd61343d565b5b60006128dc848285016127f4565b91505092915050565b600080604083850312156128fc576128fb61343d565b5b600061290a858286016127df565b925050602061291b858286016127df565b9150509250929050565b60008060006060848603121561293e5761293d61343d565b5b600061294c868287016127df565b935050602061295d868287016127df565b925050604061296e86828701612861565b9150509250925092565b6000806040838503121561298f5761298e61343d565b5b600061299d858286016127df565b92505060206129ae85828601612861565b9150509250929050565b6000602082840312156129ce576129cd61343d565b5b600082013567ffffffffffffffff8111156129ec576129eb613438565b5b6129f884828501612809565b91505092915050565b600060208284031215612a1757612a1661343d565b5b6000612a2584828501612837565b91505092915050565b600060208284031215612a4457612a4361343d565b5b6000612a528482850161284c565b91505092915050565b600060208284031215612a7157612a7061343d565b5b6000612a7f84828501612861565b91505092915050565b600080600060608486031215612aa157612aa061343d565b5b6000612aaf86828701612876565b9350506020612ac086828701612876565b9250506040612ad186828701612876565b9150509250925092565b6000612ae78383612af3565b60208301905092915050565b612afc8161325e565b82525050565b612b0b8161325e565b82525050565b6000612b1c82613104565b612b268185613127565b9350612b31836130f4565b8060005b83811015612b62578151612b498882612adb565b9750612b548361311a565b925050600181019050612b35565b5085935050505092915050565b612b7881613270565b82525050565b612b87816132b3565b82525050565b6000612b988261310f565b612ba28185613138565b9350612bb28185602086016132c5565b612bbb81613442565b840191505092915050565b6000612bd3602383613138565b9150612bde82613453565b604082019050919050565b6000612bf6602a83613138565b9150612c01826134a2565b604082019050919050565b6000612c19602283613138565b9150612c24826134f1565b604082019050919050565b6000612c3c601b83613138565b9150612c4782613540565b602082019050919050565b6000612c5f601d83613138565b9150612c6a82613569565b602082019050919050565b6000612c82602183613138565b9150612c8d82613592565b604082019050919050565b6000612ca5602083613138565b9150612cb0826135e1565b602082019050919050565b6000612cc8602983613138565b9150612cd38261360a565b604082019050919050565b6000612ceb602583613138565b9150612cf682613659565b604082019050919050565b6000612d0e602483613138565b9150612d19826136a8565b604082019050919050565b6000612d31601783613138565b9150612d3c826136f7565b602082019050919050565b6000612d54601183613138565b9150612d5f82613720565b602082019050919050565b612d738161329c565b82525050565b612d82816132a6565b82525050565b6000602082019050612d9d6000830184612b02565b92915050565b6000604082019050612db86000830185612b02565b612dc56020830184612b02565b9392505050565b6000604082019050612de16000830185612b02565b612dee6020830184612d6a565b9392505050565b600060c082019050612e0a6000830189612b02565b612e176020830188612d6a565b612e246040830187612b7e565b612e316060830186612b7e565b612e3e6080830185612b02565b612e4b60a0830184612d6a565b979650505050505050565b6000602082019050612e6b6000830184612b6f565b92915050565b60006020820190508181036000830152612e8b8184612b8d565b905092915050565b60006020820190508181036000830152612eac81612bc6565b9050919050565b60006020820190508181036000830152612ecc81612be9565b9050919050565b60006020820190508181036000830152612eec81612c0c565b9050919050565b60006020820190508181036000830152612f0c81612c2f565b9050919050565b60006020820190508181036000830152612f2c81612c52565b9050919050565b60006020820190508181036000830152612f4c81612c75565b9050919050565b60006020820190508181036000830152612f6c81612c98565b9050919050565b60006020820190508181036000830152612f8c81612cbb565b9050919050565b60006020820190508181036000830152612fac81612cde565b9050919050565b60006020820190508181036000830152612fcc81612d01565b9050919050565b60006020820190508181036000830152612fec81612d24565b9050919050565b6000602082019050818103600083015261300c81612d47565b9050919050565b60006020820190506130286000830184612d6a565b92915050565b600060a0820190506130436000830188612d6a565b6130506020830187612b7e565b81810360408301526130628186612b11565b90506130716060830185612b02565b61307e6080830184612d6a565b9695505050505050565b600060208201905061309d6000830184612d79565b92915050565b60006130ad6130be565b90506130b982826132f8565b919050565b6000604051905090565b600067ffffffffffffffff8211156130e3576130e26133ff565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131548261329c565b915061315f8361329c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319457613193613372565b5b828201905092915050565b60006131aa8261329c565b91506131b58361329c565b9250826131c5576131c46133a1565b5b828204905092915050565b60006131db8261329c565b91506131e68361329c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561321f5761321e613372565b5b828202905092915050565b60006132358261329c565b91506132408361329c565b92508282101561325357613252613372565b5b828203905092915050565b60006132698261327c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132be8261329c565b9050919050565b60005b838110156132e35780820151818401526020810190506132c8565b838111156132f2576000848401525b50505050565b61330182613442565b810181811067ffffffffffffffff821117156133205761331f6133ff565b5b80604052505050565b60006133348261329c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561336757613366613372565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137528161325e565b811461375d57600080fd5b50565b61376981613270565b811461377457600080fd5b50565b6137808161329c565b811461378b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122039e9502076af23be7d2cfa89c239fe926245d5ebda16285fb57359fea1e7f5bc64736f6c63430008060033
{"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"}]}}
2,194
0xfb4bd3f7d6c6cfb04e9cc1f277ff2f203f24d329
/* /~~~\ /~~\ ( | | ) | | | | \ ( | /'/~\ /~~\ \ ) \/' /' | | \ `\/ / | \ ) /~\ | /' `~~ /' `\ \__/ | ~\ /~ \ `\ __ /' `~ `~~~' New fair launch token, Liquidity locked for 6 months */ pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); 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; } } 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 IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract PAW is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 5000000000000*10**18; string public _name = "PAW"; string public _symbol= "PAW"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0x21670D5df6b3dC9679263F45b7bF5681FD819A51); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function toggleReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = false; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner, block.timestamp ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += 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); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610421578063b09f12661461045e578063ba3ac4a514610489578063c9567bf9146104b2578063d28d8852146104c9578063dd62ed3e146104f457610140565b806370a082311461033c5780638da5cb5b1461037957806395d89b41146103a45780639dc29fac146103cf578063a6f9dae1146103f857610140565b806323b872dd116100fd57806323b872dd1461023e578063294e3eb11461027b578063313ce567146102925780633eaaf86b146102bd5780636e4ee811146102e85780636ebcf607146102ff57610140565b8063024c2ddd1461014557806306fdde0314610182578063095ea7b3146101ad57806315a892be146101ea57806318160ddd1461021357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061016c60048036038101906101679190611f2e565b610531565b6040516101799190611f87565b60405180910390f35b34801561018e57600080fd5b50610197610556565b6040516101a4919061203b565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612089565b6105e8565b6040516101e191906120e4565b60405180910390f35b3480156101f657600080fd5b50610211600480360381019061020c9190612247565b610606565b005b34801561021f57600080fd5b5061022861074d565b6040516102359190611f87565b60405180910390f35b34801561024a57600080fd5b5061026560048036038101906102609190612290565b610757565b60405161027291906120e4565b60405180910390f35b34801561028757600080fd5b5061029061084f565b005b34801561029e57600080fd5b506102a7610981565b6040516102b491906122ff565b60405180910390f35b3480156102c957600080fd5b506102d261098a565b6040516102df9190611f87565b60405180910390f35b3480156102f457600080fd5b506102fd610990565b005b34801561030b57600080fd5b506103266004803603810190610321919061231a565b610a87565b6040516103339190611f87565b60405180910390f35b34801561034857600080fd5b50610363600480360381019061035e919061231a565b610a9f565b6040516103709190611f87565b60405180910390f35b34801561038557600080fd5b5061038e610ae7565b60405161039b9190612356565b60405180910390f35b3480156103b057600080fd5b506103b9610b0d565b6040516103c6919061203b565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190612089565b610b9f565b005b34801561040457600080fd5b5061041f600480360381019061041a919061231a565b610da5565b005b34801561042d57600080fd5b5061044860048036038101906104439190612089565b610e9b565b60405161045591906120e4565b60405180910390f35b34801561046a57600080fd5b50610473610eb9565b604051610480919061203b565b60405180910390f35b34801561049557600080fd5b506104b060048036038101906104ab9190612247565b610f47565b005b3480156104be57600080fd5b506104c761108e565b005b3480156104d557600080fd5b506104de611592565b6040516104eb919061203b565b60405180910390f35b34801561050057600080fd5b5061051b60048036038101906105169190611f2e565b611620565b6040516105289190611f87565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b606060078054610565906123a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610591906123a0565b80156105de5780601f106105b3576101008083540402835291602001916105de565b820191906000526020600020905b8154815290600101906020018083116105c157829003601f168201915b5050505050905090565b60006105fc6105f56116a7565b84846116af565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806106af5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6106b857600080fd5b60005b8151811015610749576001600360008484815181106106dd576106dc6123d2565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061074190612430565b9150506106bb565b5050565b6000600654905090565b600061076484848461187a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107af6116a7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561082f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610826906124eb565b60405180910390fd5b6108438561083b6116a7565b8584036116af565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108f85750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61090157600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a395750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a4257600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610b1c906123a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610b48906123a0565b8015610b955780601f10610b6a57610100808354040283529160200191610b95565b820191906000526020600020905b815481529060010190602001808311610b7857829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c485750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c5157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb890612557565b60405180910390fd5b610ccd60008383611eb7565b8060066000828254610cdf9190612577565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d349190612577565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d999190611f87565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e4e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e5757600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610eaf610ea86116a7565b848461187a565b6001905092915050565b60088054610ec6906123a0565b80601f0160208091040260200160405190810160405280929190818152602001828054610ef2906123a0565b8015610f3f5780601f10610f1457610100808354040283529160200191610f3f565b820191906000526020600020905b815481529060010190602001808311610f2257829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610ff05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ff957600080fd5b60005b815181101561108a5760006003600084848151811061101e5761101d6123d2565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061108290612430565b915050610ffc565b5050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806111375750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61114057600080fd5b600960019054906101000a900460ff1615611190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118790612619565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061121930600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006546116af565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611264573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611288919061264e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611313919061264e565b6040518363ffffffff1660e01b815260040161133092919061267b565b6020604051808303816000875af115801561134f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611373919061264e565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113fc30610a9f565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b8152600401611444969594939291906126e9565b60606040518083038185885af1158015611462573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611487919061275f565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154b9291906127b2565b6020604051808303816000875af115801561156a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158e9190612807565b5050565b6007805461159f906123a0565b80601f01602080910402602001604051908101604052809291908181526020018280546115cb906123a0565b80156116185780601f106115ed57610100808354040283529160200191611618565b820191906000526020600020905b8154815290600101906020018083116115fb57829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561171f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611716906128a6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561178f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178690612938565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161186d9190611f87565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e1906129ca565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561194857600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119ec5750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119f557600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b4757600960009054906101000a900460ff1680611aaf5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611b075750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611b46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3d90612a5c565b60405180910390fd5b5b6c02863c1f5cdae42f9540000000811080611baf5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611c075750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611c3d57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611c4657600080fd5b611c51838383611eb7565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90612aee565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611d6a9190612577565b92505081905550436004600b54611d819190612577565b118015611ddb5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611e4b578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611e3e9190612b0e565b60405180910390a3611eb1565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611ea89190611f87565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611efb82611ed0565b9050919050565b611f0b81611ef0565b8114611f1657600080fd5b50565b600081359050611f2881611f02565b92915050565b60008060408385031215611f4557611f44611ec6565b5b6000611f5385828601611f19565b9250506020611f6485828601611f19565b9150509250929050565b6000819050919050565b611f8181611f6e565b82525050565b6000602082019050611f9c6000830184611f78565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611fdc578082015181840152602081019050611fc1565b83811115611feb576000848401525b50505050565b6000601f19601f8301169050919050565b600061200d82611fa2565b6120178185611fad565b9350612027818560208601611fbe565b61203081611ff1565b840191505092915050565b600060208201905081810360008301526120558184612002565b905092915050565b61206681611f6e565b811461207157600080fd5b50565b6000813590506120838161205d565b92915050565b600080604083850312156120a05761209f611ec6565b5b60006120ae85828601611f19565b92505060206120bf85828601612074565b9150509250929050565b60008115159050919050565b6120de816120c9565b82525050565b60006020820190506120f960008301846120d5565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61213c82611ff1565b810181811067ffffffffffffffff8211171561215b5761215a612104565b5b80604052505050565b600061216e611ebc565b905061217a8282612133565b919050565b600067ffffffffffffffff82111561219a57612199612104565b5b602082029050602081019050919050565b600080fd5b60006121c36121be8461217f565b612164565b905080838252602082019050602084028301858111156121e6576121e56121ab565b5b835b8181101561220f57806121fb8882611f19565b8452602084019350506020810190506121e8565b5050509392505050565b600082601f83011261222e5761222d6120ff565b5b813561223e8482602086016121b0565b91505092915050565b60006020828403121561225d5761225c611ec6565b5b600082013567ffffffffffffffff81111561227b5761227a611ecb565b5b61228784828501612219565b91505092915050565b6000806000606084860312156122a9576122a8611ec6565b5b60006122b786828701611f19565b93505060206122c886828701611f19565b92505060406122d986828701612074565b9150509250925092565b600060ff82169050919050565b6122f9816122e3565b82525050565b600060208201905061231460008301846122f0565b92915050565b6000602082840312156123305761232f611ec6565b5b600061233e84828501611f19565b91505092915050565b61235081611ef0565b82525050565b600060208201905061236b6000830184612347565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806123b857607f821691505b602082108114156123cc576123cb612371565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061243b82611f6e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561246e5761246d612401565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b60006124d5602883611fad565b91506124e082612479565b604082019050919050565b60006020820190508181036000830152612504816124c8565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b6000612541601f83611fad565b915061254c8261250b565b602082019050919050565b6000602082019050818103600083015261257081612534565b9050919050565b600061258282611f6e565b915061258d83611f6e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125c2576125c1612401565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612603601783611fad565b915061260e826125cd565b602082019050919050565b60006020820190508181036000830152612632816125f6565b9050919050565b60008151905061264881611f02565b92915050565b60006020828403121561266457612663611ec6565b5b600061267284828501612639565b91505092915050565b60006040820190506126906000830185612347565b61269d6020830184612347565b9392505050565b6000819050919050565b6000819050919050565b60006126d36126ce6126c9846126a4565b6126ae565b611f6e565b9050919050565b6126e3816126b8565b82525050565b600060c0820190506126fe6000830189612347565b61270b6020830188611f78565b61271860408301876126da565b61272560608301866126da565b6127326080830185612347565b61273f60a0830184611f78565b979650505050505050565b6000815190506127598161205d565b92915050565b60008060006060848603121561277857612777611ec6565b5b60006127868682870161274a565b93505060206127978682870161274a565b92505060406127a88682870161274a565b9150509250925092565b60006040820190506127c76000830185612347565b6127d46020830184611f78565b9392505050565b6127e4816120c9565b81146127ef57600080fd5b50565b600081519050612801816127db565b92915050565b60006020828403121561281d5761281c611ec6565b5b600061282b848285016127f2565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612890602483611fad565b915061289b82612834565b604082019050919050565b600060208201905081810360008301526128bf81612883565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612922602283611fad565b915061292d826128c6565b604082019050919050565b6000602082019050818103600083015261295181612915565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006129b4602583611fad565b91506129bf82612958565b604082019050919050565b600060208201905081810360008301526129e3816129a7565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612a46602383611fad565b9150612a51826129ea565b604082019050919050565b60006020820190508181036000830152612a7581612a39565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612ad8602683611fad565b9150612ae382612a7c565b604082019050919050565b60006020820190508181036000830152612b0781612acb565b9050919050565b6000602082019050612b2360008301846126da565b9291505056fea26469706673582212203771f585c414b970ea37858ebdf2299dc31d984a1516a907a4698e756430f4c064736f6c634300080a0033
{"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"}]}}
2,195
0x4102c1d4081a8b5e1757fce8adfeeacbe5d47261
pragma solidity ^0.4.23; contract owned { address public owner; constructor() 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) external; } contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 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 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); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * 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` 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; 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; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public 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 returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract BetterThanAdrien is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ constructor( uint256 initialSupply, string tokenName, string tokenSymbol ) TokenERC20(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); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient emit Transfer(_from, _to, _value); } /// @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(0, this, mintedAmount); emit Transfer(this, target, mintedAmount); } /// @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 public { frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract 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; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @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); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } }
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305fefda7811461012c57806306fdde0314610149578063095ea7b3146101d357806318160ddd1461020b57806323b872dd14610232578063313ce5671461025c57806342966c68146102875780634b7503341461029f57806370a08231146102b457806379c65068146102d557806379cc6790146102f95780638620410b1461031d5780638da5cb5b1461033257806395d89b4114610363578063a6f2ae3a14610378578063a9059cbb14610380578063b414d4b6146103a4578063cae9ca51146103c5578063dd62ed3e1461042e578063e4849b3214610455578063e724529c1461046d578063f2fde38b14610493575b600080fd5b34801561013857600080fd5b506101476004356024356104b4565b005b34801561015557600080fd5b5061015e6104da565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610198578181015183820152602001610180565b50505050905090810190601f1680156101c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101df57600080fd5b506101f7600160a060020a0360043516602435610567565b604080519115158252519081900360200190f35b34801561021757600080fd5b50610220610597565b60408051918252519081900360200190f35b34801561023e57600080fd5b506101f7600160a060020a036004358116906024351660443561059d565b34801561026857600080fd5b50610271610614565b6040805160ff9092168252519081900360200190f35b34801561029357600080fd5b506101f760043561061d565b3480156102ab57600080fd5b506102206106a7565b3480156102c057600080fd5b50610220600160a060020a03600435166106ad565b3480156102e157600080fd5b50610147600160a060020a03600435166024356106bf565b34801561030557600080fd5b506101f7600160a060020a036004351660243561078a565b34801561032957600080fd5b50610220610866565b34801561033e57600080fd5b5061034761086c565b60408051600160a060020a039092168252519081900360200190f35b34801561036f57600080fd5b5061015e61087b565b6101476108d3565b34801561038c57600080fd5b50610147600160a060020a03600435166024356108f3565b3480156103b057600080fd5b506101f7600160a060020a0360043516610902565b3480156103d157600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101f7948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506109179650505050505050565b34801561043a57600080fd5b50610220600160a060020a0360043581169060243516610a4e565b34801561046157600080fd5b50610147600435610a6b565b34801561047957600080fd5b50610147600160a060020a03600435166024351515610aca565b34801561049f57600080fd5b50610147600160a060020a0360043516610b49565b60005433600160a060020a039081169116146104cf57600080fd5b600791909155600855565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561055f5780601f106105345761010080835404028352916020019161055f565b820191906000526020600020905b81548152906001019060200180831161054257829003601f168201915b505050505081565b600160a060020a033381166000908152600660209081526040808320938616835292905220819055600192915050565b60045481565b600160a060020a038084166000908152600660209081526040808320339094168352929052908120548211156105d257600080fd5b600160a060020a038085166000908152600660209081526040808320339094168352929052208054839003905561060a848484610b93565b5060019392505050565b60035460ff1681565b600160a060020a03331660009081526005602052604081205482111561064257600080fd5b600160a060020a03331660008181526005602090815260409182902080548690039055600480548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a2506001919050565b60075481565b60056020526000908152604090205481565b60005433600160a060020a039081169116146106da57600080fd5b600160a060020a03808316600090815260056020908152604080832080548601905560048054860190558051858152905130909416937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a381600160a060020a031630600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600160a060020a0382166000908152600560205260408120548211156107af57600080fd5b600160a060020a03808416600090815260066020908152604080832033909416835292905220548211156107e257600080fd5b600160a060020a038084166000818152600560209081526040808320805488900390556006825280832033909516835293815290839020805486900390556004805486900390558251858152925191927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5929081900390910190a250600192915050565b60085481565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561055f5780601f106105345761010080835404028352916020019161055f565b6000600854348115156108e257fe5b0490506108f0303383610b93565b50565b6108fe338383610b93565b5050565b60096020526000908152604090205460ff1681565b6000836109248185610567565b15610a465780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109da5781810151838201526020016109c2565b50505050905090810190601f168015610a075780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610a2957600080fd5b505af1158015610a3d573d6000803e3d6000fd5b50505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b6007548102600160a060020a033016311015610a8657600080fd5b610a91333083610b93565b600754604051600160a060020a03331691830280156108fc02916000818181858888f193505050501580156108fe573d6000803e3d6000fd5b60005433600160a060020a03908116911614610ae557600080fd5b600160a060020a038216600081815260096020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b60005433600160a060020a03908116911614610b6457600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610ba857600080fd5b600160a060020a038316600090815260056020526040902054811115610bcd57600080fd5b600160a060020a0382166000908152600560205260409020548181011015610bf457600080fd5b600160a060020a03831660009081526009602052604090205460ff1615610c1a57600080fd5b600160a060020a03821660009081526009602052604090205460ff1615610c4057600080fd5b600160a060020a03808416600081815260056020908152604080832080548790039055938616808352918490208054860190558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050505600a165627a7a72305820187ba688bc6463d223f552f87fb868a151af0f9c81d8e9aff343cf4675d9b4b30029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
2,196
0x7843ea2e3e60b24cc12b56c5627adc7f9f0749d6
/** *Submitted for verification at Etherscan.io on 2021-11-24 */ // SPDX-License-Identifier: AGPL-3.0-or-later /// GUniOracle.sol // based heavily on GUniLPOracle.sol from MakerDAO // found here: https://github.com/makerdao/univ3-lp-oracle/blob/master/src/GUniLPOracle.sol // Copyright (C) 2017-2020 Maker Ecosystem Growth Holdings, INC. // 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/>. /////////////////////////////////////////////////////// // // // Methodology for Calculating LP Token Price // // // /////////////////////////////////////////////////////// // We derive the sqrtPriceX96 via Chainlink Oracles to prevent price manipulation in the pool: // // p0 = price of token0 in USD (18 decimal precision) // p1 = price of token1 in USD (18 decimal precision) // UNITS_0 = decimals of token0 // UNITS_1 = decimals of token1 // // token1/token0 = (p0 / 10^UNITS_0) / (p1 / 10^UNITS_1) [price ratio, Uniswap format] // = (p0 * 10^UNITS_1) / (p1 * 10^UNITS_0) // // sqrtPriceX96 = sqrt(token1/token0) * 2^96 [From Uniswap's definition] // = sqrt((p0 * 10^UNITS_1) / (p1 * 10^UNITS_0)) * 2^96 // = sqrt((p0 * 10^UNITS_1) / (p1 * 10^UNITS_0)) * 2^48 * 2^48 // = sqrt((p0 * 10^UNITS_1 * 2^96) / (p1 * 10^UNITS_0)) * 2^48 // // Once we have the sqrtPriceX96 we can use that to compute the fair reserves for each token. // This part may be slightly subjective depending on the implementation, // but we expect token to provide something like getUnderlyingBalancesAtPrice(uint160 sqrtPriceX96) // which will forward our oracle derived `sqrtPriceX96` // to Uniswap's LiquidityAmounts.getAmountsForLiquidity(...) // This function will return the fair reserves for each token. // Vendor-specific logic is then used to tack any uninvested fees on top of those amounts. // // Once we have the fair reserves and the prices we can compute the token price by: // // Token Price = TVL / Token Supply // = (r0 * p0 + r1 * p1) / totalSupply pragma solidity =0.6.12; interface IExtendedAggregator { enum TokenType {Invalid, Simple, Complex} enum PlatformId {Invalid, Simple, Uniswap, Balancer, GUni} /** * @dev Returns the LP shares token * @return address of the LP shares token */ function getToken() external view returns (address); /** * @dev Returns the number of tokens that composes the LP shares * @return address[] memory of token addresses */ function getSubTokens() external view returns (address[] memory); /** * @dev Returns the latest price * @return int256 price */ function latestAnswer() external view returns (int256); /** * @dev Returns the decimals of latestAnswer() * @return uint8 */ function decimals() external pure returns (uint8); /** * @dev Returns the platform id to categorize the price aggregator * @return uint256 1 = Uniswap, 2 = Balancer, 3 = G-UNI */ function getPlatformId() external pure returns (PlatformId); /** * @dev Returns token type for categorization * @return uint256 1 = Simple (Native or plain ERC20s), 2 = Complex (LP Tokens, Staked tokens) */ function getTokenType() external pure returns (TokenType); } interface IGUniPool { function token0() external view returns (address); function token1() external view returns (address); function getUnderlyingBalancesAtPrice(uint160) external view returns (uint256, uint256); function getUnderlyingBalances() external view returns (uint256, uint256); function totalSupply() external view returns (uint256); } contract GUniOracle is IExtendedAggregator { // solhint-disable private-vars-leading-underscore, var-name-mixedcase uint256 private immutable UNIT_0; uint256 private immutable UNIT_1; uint256 private immutable TO_WAD_0; uint256 private immutable TO_WAD_1; uint256 private immutable TO_WAD_ORACLE_0; uint256 private immutable TO_WAD_ORACLE_1; address public immutable pool; address public immutable priceFeed0; address public immutable priceFeed1; constructor(address _pool, address _feed0, address _feed1) public { uint256 dec0 = uint256(IExtendedAggregator(IGUniPool(_pool).token0()).decimals()); require(dec0 <= 18, "token0-dec-gt-18"); UNIT_0 = 10 ** dec0; TO_WAD_0 = 10 ** (18 - dec0); uint256 dec1 = uint256(IExtendedAggregator(IGUniPool(_pool).token1()).decimals()); require(dec1 <= 18, "token1-dec-gt-18"); UNIT_1 = 10 ** dec1; TO_WAD_1 = 10 ** (18 - dec1); uint256 decOracle0 = uint256(IExtendedAggregator(_feed0).decimals()); require(decOracle0 <= 18, "oracle0-dec-gt-18"); TO_WAD_ORACLE_0 = 10 ** (18 - decOracle0); uint256 decOracle1 = uint256(IExtendedAggregator(_feed1).decimals()); require(decOracle1 <= 18, "oracle1-dec-gt-18"); TO_WAD_ORACLE_1 = 10 ** (18 - decOracle1); pool = _pool; priceFeed0 = _feed0; priceFeed1 = _feed1; } function latestAnswer() external view override returns (int256) { // All Oracle prices are priced with 18 decimals against USD uint256 p0 = _getWADPrice(true); // Query token0 price from oracle (WAD) uint256 p1 = _getWADPrice(false); // Query token1 price from oracle (WAD) uint160 sqrtPriceX96 = _toUint160(_sqrt(_mul(_mul(p0, UNIT_1), (1 << 96)) / (_mul(p1, UNIT_0))) << 48); // Get balances of the tokens in the pool (uint256 r0, uint256 r1) = IGUniPool(pool).getUnderlyingBalancesAtPrice(sqrtPriceX96); require(r0 > 0 || r1 > 0, "invalid-balances"); uint256 totalSupply = IGUniPool(pool).totalSupply(); // Protect against precision errors with dust-levels of collateral require(totalSupply >= 1e9, "total-supply-too-small"); // Add the total value of each token together and divide by totalSupply to get unit price uint256 preq = _add( _mul(p0, _mul(r0, TO_WAD_0)), _mul(p1, _mul(r1, TO_WAD_1)) ) / totalSupply; return int256(preq); } function getToken() external view override returns (address) { return pool; } function getSubTokens() external view override returns (address[] memory) { address[] memory arr = new address[](2); arr[0] = IGUniPool(pool).token0(); arr[1] = IGUniPool(pool).token1(); return arr; } function getPlatformId() external pure override returns (IExtendedAggregator.PlatformId) { return IExtendedAggregator.PlatformId.GUni; } function getTokenType() external pure override returns (IExtendedAggregator.TokenType) { return IExtendedAggregator.TokenType.Complex; } function decimals() external pure override returns (uint8) { return 18; } function _getWADPrice(bool isToken0) internal view returns (uint256) { int256 price = IExtendedAggregator(isToken0 ? priceFeed0 : priceFeed1).latestAnswer(); require(price > 0, "negative-price"); return _mul(uint256(price), isToken0 ? TO_WAD_ORACLE_0 : TO_WAD_ORACLE_1); } function _add(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x + _y) >= _x, "add-overflow"); } function _sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x - _y) <= _x, "sub-underflow"); } function _mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require(_y == 0 || (z = _x * _y) / _y == _x, "mul-overflow"); } function _toUint160(uint256 x) internal pure returns (uint160 z) { require((z = uint160(x)) == x, "uint160-overflow"); } // solhint-disable-next-line max-line-length // FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687 // solhint-disable-next-line code-complexity function _sqrt(uint256 _x) private pure returns (uint128) { if (_x == 0) return 0; else { uint256 xx = _x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; // Seven iterations should be enough uint256 r1 = _x / r; return uint128 (r < r1 ? r : r1); } } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063385aee1b11610066578063385aee1b1461013a5780634b0ca9731461014257806350d25bcd1461016b578063ab0ca0e114610185578063fcab18191461018d57610093565b806316f0115b1461009857806321df0da7146100bc57806325f33d76146100c4578063313ce5671461011c575b600080fd5b6100a06101a5565b604080516001600160a01b039092168252519081900360200190f35b6100a06101c9565b6100cc6101ed565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101085781810151838201526020016100f0565b505050509050019250505060405180910390f35b610124610374565b6040805160ff9092168252519081900360200190f35b6100a0610379565b61014a61039d565b6040518082600481111561015a57fe5b815260200191505060405180910390f35b6101736103a2565b60408051918252519081900360200190f35b6100a06106a6565b6101956106ca565b6040518082600281111561015a57fe5b7f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e81565b7f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e90565b6040805160028082526060808301845292839291906020830190803683370190505090507f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561026a57600080fd5b505afa15801561027e573d6000803e3d6000fd5b505050506040513d602081101561029457600080fd5b5051815182906000906102a357fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561031c57600080fd5b505afa158015610330573d6000803e3d6000fd5b505050506040513d602081101561034657600080fd5b505181518290600190811061035757fe5b6001600160a01b0390921660209283029190910190910152905090565b601290565b7f000000000000000000000000773616e4d11a78f511299002da57a0a94577f1f481565b600490565b6000806103af60016106cf565b905060006103bd60006106cf565b9050600061045060306104376103f3857f0000000000000000000000000000000000000000000000000de0b6b3a7640000610829565b61042a610420887f00000000000000000000000000000000000000000000000000000000000f4240610829565b600160601b610829565b8161043157fe5b0461088a565b6001600160801b0316901b6001600160801b03166109d1565b90506000807f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b031663b670ed7d846040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050604080518083038186803b1580156104c157600080fd5b505afa1580156104d5573d6000803e3d6000fd5b505050506040513d60408110156104eb57600080fd5b5080516020909101519092509050811515806105075750600081115b61054b576040805162461bcd60e51b815260206004820152601060248201526f696e76616c69642d62616c616e63657360801b604482015290519081900360640190fd5b60007f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105a657600080fd5b505afa1580156105ba573d6000803e3d6000fd5b505050506040513d60208110156105d057600080fd5b50519050633b9aca00811015610626576040805162461bcd60e51b81526020600482015260166024820152751d1bdd185b0b5cdd5c1c1b1e4b5d1bdbcb5cdb585b1b60521b604482015290519081900360640190fd5b60008161069261065f8961065a887f0000000000000000000000000000000000000000000000000000000000000001610829565b610829565b61068d8961065a887f000000000000000000000000000000000000000000000000000000e8d4a51000610829565b610a22565b8161069957fe5b0497505050505050505090565b7f000000000000000000000000986b5e1e1755e3c2440e960477f25201b0a8bbd481565b600290565b600080826106fd577f000000000000000000000000986b5e1e1755e3c2440e960477f25201b0a8bbd461071f565b7f000000000000000000000000773616e4d11a78f511299002da57a0a94577f1f45b6001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561075757600080fd5b505afa15801561076b573d6000803e3d6000fd5b505050506040513d602081101561078157600080fd5b50519050600081136107cb576040805162461bcd60e51b815260206004820152600e60248201526d6e656761746976652d707269636560901b604482015290519081900360640190fd5b61082081846107fa577f000000000000000000000000000000000000000000000000000000000000000161065a565b7f0000000000000000000000000000000000000000000000000000000000000001610829565b9150505b919050565b60008115806108445750508082028282828161084157fe5b04145b610884576040805162461bcd60e51b815260206004820152600c60248201526b6d756c2d6f766572666c6f7760a01b604482015290519081900360640190fd5b92915050565b60008161089957506000610824565b816001600160801b82106108b25760809190911c9060401b5b6801000000000000000082106108cd5760409190911c9060201b5b64010000000082106108e45760209190911c9060101b5b6201000082106108f95760109190911c9060081b5b610100821061090d5760089190911c9060041b5b601082106109205760049190911c9060021b5b6008821061092c5760011b5b600181858161093757fe5b048201901c9050600181858161094957fe5b048201901c9050600181858161095b57fe5b048201901c9050600181858161096d57fe5b048201901c9050600181858161097f57fe5b048201901c9050600181858161099157fe5b048201901c905060018185816109a357fe5b048201901c905060008185816109b557fe5b0490508082106109c557806109c7565b815b9350505050610824565b806001600160a01b0381168114610824576040805162461bcd60e51b815260206004820152601060248201526f75696e743136302d6f766572666c6f7760801b604482015290519081900360640190fd5b80820182811015610884576040805162461bcd60e51b815260206004820152600c60248201526b6164642d6f766572666c6f7760a01b604482015290519081900360640190fdfea26469706673582212207bc79256cf247d63ce1f8776b821905908ee9f2ad2ab1bd53bf9a10bc37d84a064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
2,197
0x9de71f91f9e5c3054ffcd0f624fca5655e600ac6
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /** * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } /** * @title Alpon * @author Alpon * @dev Alpon is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract Alpon is ERC223, Ownable { using SafeMath for uint256; string public name = "Alpon"; string public symbol = "APN"; uint8 public decimals = 8; uint256 public initialSupply = 10e9 * 1e8; uint256 public totalSupply; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function Alpon() public { totalSupply = initialSupply; balanceOf[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = amount.mul(1e8); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn't work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf[owner] >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if(msg.value > 0) owner.transfer(msg.value); balanceOf[owner] = balanceOf[owner].sub(distributeAmount); balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev fallback function */ function() payable public { autoDistribute(); } }
0x6060604052600436106101505763ffffffff60e060020a60003504166305d2035b811461015a57806306fdde0314610181578063095ea7b31461020b57806318160ddd1461022d57806323b872dd14610252578063313ce5671461027a578063378dc3dc146102a357806340c10f19146102b65780634f25eced146102d857806364ddc605146102eb57806370a082311461037a5780637d64bcb4146103995780638da5cb5b146103ac57806394594625146103db57806395d89b411461042c5780639dc29fac1461043f578063a8f11eb914610150578063a9059cbb14610461578063b414d4b614610483578063be45fd62146104a2578063c341b9f614610507578063cbbe974b1461055a578063d39b1d4814610579578063dd62ed3e1461058f578063dd924594146105b4578063f0dc417114610643578063f2fde38b146106d2578063f6368f8a146106f1575b610158610798565b005b341561016557600080fd5b61016d61090d565b604051901515815260200160405180910390f35b341561018c57600080fd5b610194610916565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101d05780820151838201526020016101b8565b50505050905090810190601f1680156101fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021657600080fd5b61016d600160a060020a03600435166024356109be565b341561023857600080fd5b610240610a2a565b60405190815260200160405180910390f35b341561025d57600080fd5b61016d600160a060020a0360043581169060243516604435610a30565b341561028557600080fd5b61028d610c3f565b60405160ff909116815260200160405180910390f35b34156102ae57600080fd5b610240610c48565b34156102c157600080fd5b61016d600160a060020a0360043516602435610c4e565b34156102e357600080fd5b610240610d50565b34156102f657600080fd5b610158600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d5695505050505050565b341561038557600080fd5b610240600160a060020a0360043516610eb0565b34156103a457600080fd5b61016d610ecb565b34156103b757600080fd5b6103bf610f38565b604051600160a060020a03909116815260200160405180910390f35b34156103e657600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f4792505050565b341561043757600080fd5b6101946111d5565b341561044a57600080fd5b610158600160a060020a0360043516602435611248565b341561046c57600080fd5b61016d600160a060020a0360043516602435611330565b341561048e57600080fd5b61016d600160a060020a036004351661140b565b34156104ad57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061142095505050505050565b341561051257600080fd5b61015860046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114eb9050565b341561056557600080fd5b610240600160a060020a03600435166115ed565b341561058457600080fd5b6101586004356115ff565b341561059a57600080fd5b610240600160a060020a036004358116906024351661161f565b34156105bf57600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061164a95505050505050565b341561064e57600080fd5b61016d6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118fc95505050505050565b34156106dd57600080fd5b610158600160a060020a0360043516611bca565b34156106fc57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c6595505050505050565b60006007541180156107c65750600754600154600160a060020a031660009081526009602052604090205410155b80156107eb5750600160a060020a0333166000908152600b602052604090205460ff16155b801561080e5750600160a060020a0333166000908152600c602052604090205442115b151561081957600080fd5b600034111561085657600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561085657600080fd5b600754600154600160a060020a03166000908152600960205260409020546108839163ffffffff611fbd16565b600154600160a060020a039081166000908152600960205260408082209390935560075433909216815291909120546108c19163ffffffff611fcf16565b600160a060020a033381166000818152600960205260409081902093909355600154600754919392169160008051602061240a83398151915291905190815260200160405180910390a3565b60085460ff1681565b61091e6123f7565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b820191906000526020600020905b81548152906001019060200180831161099757829003601f168201915b5050505050905090565b600160a060020a033381166000818152600a6020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60065490565b6000600160a060020a03831615801590610a4a5750600082115b8015610a6f5750600160a060020a038416600090815260096020526040902054829010155b8015610aa25750600160a060020a038085166000908152600a602090815260408083203390941683529290522054829010155b8015610ac75750600160a060020a0384166000908152600b602052604090205460ff16155b8015610aec5750600160a060020a0383166000908152600b602052604090205460ff16155b8015610b0f5750600160a060020a0384166000908152600c602052604090205442115b8015610b325750600160a060020a0383166000908152600c602052604090205442115b1515610b3d57600080fd5b600160a060020a038416600090815260096020526040902054610b66908363ffffffff611fbd16565b600160a060020a038086166000908152600960205260408082209390935590851681522054610b9b908363ffffffff611fcf16565b600160a060020a038085166000908152600960209081526040808320949094558783168252600a8152838220339093168252919091522054610be3908363ffffffff611fbd16565b600160a060020a038086166000818152600a60209081526040808320338616845290915290819020939093559085169160008051602061240a8339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60055481565b60015460009033600160a060020a03908116911614610c6c57600080fd5b60085460ff1615610c7c57600080fd5b60008211610c8957600080fd5b600654610c9c908363ffffffff611fcf16565b600655600160a060020a038316600090815260096020526040902054610cc8908363ffffffff611fcf16565b600160a060020a0384166000818152600960205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a038316600060008051602061240a8339815191528460405190815260200160405180910390a350600192915050565b60075481565b60015460009033600160a060020a03908116911614610d7457600080fd5b60008351118015610d86575081518351145b1515610d9157600080fd5b5060005b8251811015610eab57818181518110610daa57fe5b90602001906020020151600c6000858481518110610dc457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610df257600080fd5b818181518110610dfe57fe5b90602001906020020151600c6000858481518110610e1857fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e4857fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e8857fe5b9060200190602002015160405190815260200160405180910390a2600101610d95565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610ee957600080fd5b60085460ff1615610ef957600080fd5b6008805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f5c575060008551115b8015610f815750600160a060020a0333166000908152600b602052604090205460ff16155b8015610fa45750600160a060020a0333166000908152600c602052604090205442115b1515610faf57600080fd5b610fc3846305f5e10063ffffffff611fde16565b9350610fd78551859063ffffffff611fde16565b600160a060020a0333166000908152600960205260409020549092508290101561100057600080fd5b5060005b84518110156111885784818151811061101957fe5b90602001906020020151600160a060020a03161580159061106e5750600b600086838151811061104557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156110b35750600c600086838151811061108557fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156110be57600080fd5b61110284600960008885815181106110d257fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fcf16565b6009600087848151811061111257fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061114257fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3600101611004565b600160a060020a0333166000908152600960205260409020546111b1908363ffffffff611fbd16565b33600160a060020a0316600090815260096020526040902055506001949350505050565b6111dd6123f7565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b60015433600160a060020a0390811691161461126357600080fd5b60008111801561128c5750600160a060020a038216600090815260096020526040902054819010155b151561129757600080fd5b600160a060020a0382166000908152600960205260409020546112c0908263ffffffff611fbd16565b600160a060020a0383166000908152600960205260409020556006546112ec908263ffffffff611fbd16565b600655600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b600061133a6123f7565b6000831180156113635750600160a060020a0333166000908152600b602052604090205460ff16155b80156113885750600160a060020a0384166000908152600b602052604090205460ff16155b80156113ab5750600160a060020a0333166000908152600c602052604090205442115b80156113ce5750600160a060020a0384166000908152600c602052604090205442115b15156113d957600080fd5b6113e284612009565b156113f9576113f2848483612011565b9150611404565b6113f2848483612274565b5092915050565b600b6020526000908152604090205460ff1681565b6000808311801561144a5750600160a060020a0333166000908152600b602052604090205460ff16155b801561146f5750600160a060020a0384166000908152600b602052604090205460ff16155b80156114925750600160a060020a0333166000908152600c602052604090205442115b80156114b55750600160a060020a0384166000908152600c602052604090205442115b15156114c057600080fd5b6114c984612009565b156114e0576114d9848484612011565b9050610c38565b6114d9848484612274565b60015460009033600160a060020a0390811691161461150957600080fd5b600083511161151757600080fd5b5060005b8251811015610eab5782818151811061153057fe5b90602001906020020151600160a060020a0316151561154e57600080fd5b81600b600085848151811061155f57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061159d57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161151b565b600c6020526000908152604090205481565b60015433600160a060020a0390811691161461161a57600080fd5b600755565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b6000806000808551118015611660575083518551145b80156116855750600160a060020a0333166000908152600b602052604090205460ff16155b80156116a85750600160a060020a0333166000908152600c602052604090205442115b15156116b357600080fd5b5060009050805b84518110156118055760008482815181106116d157fe5b9060200190602002015111801561170557508481815181106116ef57fe5b90602001906020020151600160a060020a031615155b80156117455750600b600086838151811061171c57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561178a5750600c600086838151811061175c57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561179557600080fd5b6117bf6305f5e1008583815181106117a957fe5b906020019060200201519063ffffffff611fde16565b8482815181106117cb57fe5b602090810290910101526117fb8482815181106117e457fe5b90602001906020020151839063ffffffff611fcf16565b91506001016116ba565b600160a060020a0333166000908152600960205260409020548290101561182b57600080fd5b5060005b84518110156111885761186184828151811061184757fe5b90602001906020020151600960008885815181106110d257fe5b6009600087848151811061187157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558481815181106118a157fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061240a8339815191528684815181106118d957fe5b9060200190602002015160405190815260200160405180910390a360010161182f565b6001546000908190819033600160a060020a0390811691161461191e57600080fd5b60008551118015611930575083518551145b151561193b57600080fd5b5060009050805b8451811015611ba157600084828151811061195957fe5b9060200190602002015111801561198d575084818151811061197757fe5b90602001906020020151600160a060020a031615155b80156119cd5750600b60008683815181106119a457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015611a125750600c60008683815181106119e457fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a1d57600080fd5b611a316305f5e1008583815181106117a957fe5b848281518110611a3d57fe5b60209081029091010152838181518110611a5357fe5b9060200190602002015160096000878481518110611a6d57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a9c57600080fd5b611af5848281518110611aab57fe5b9060200190602002015160096000888581518110611ac557fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fbd16565b60096000878481518110611b0557fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b388482815181106117e457fe5b915033600160a060020a0316858281518110611b5057fe5b90602001906020020151600160a060020a031660008051602061240a833981519152868481518110611b7e57fe5b9060200190602002015160405190815260200160405180910390a3600101611942565b600160a060020a0333166000908152600960205260409020546111b1908363ffffffff611fcf16565b60015433600160a060020a03908116911614611be557600080fd5b600160a060020a0381161515611bfa57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c8f5750600160a060020a0333166000908152600b602052604090205460ff16155b8015611cb45750600160a060020a0385166000908152600b602052604090205460ff16155b8015611cd75750600160a060020a0333166000908152600c602052604090205442115b8015611cfa5750600160a060020a0385166000908152600c602052604090205442115b1515611d0557600080fd5b611d0e85612009565b15611fa757600160a060020a03331660009081526009602052604090205484901015611d3957600080fd5b600160a060020a033316600090815260096020526040902054611d62908563ffffffff611fbd16565b600160a060020a033381166000908152600960205260408082209390935590871681522054611d97908563ffffffff611fcf16565b600160a060020a0386166000818152600960205260408082209390935590918490518082805190602001908083835b60208310611de55780518252601f199092019160209182019101611dc6565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e76578082015183820152602001611e5e565b50505050905090810190601f168015611ea35780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611ec757fe5b826040518082805190602001908083835b60208310611ef75780518252601f199092019160209182019101611ed8565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3506001611fb5565b611fb2858585612274565b90505b949350505050565b600082821115611fc957fe5b50900390565b600082820183811015610c3857fe5b600080831515611ff15760009150611404565b5082820282848281151561200157fe5b0414610c3857fe5b6000903b1190565b600160a060020a03331660009081526009602052604081205481908490101561203957600080fd5b600160a060020a033316600090815260096020526040902054612062908563ffffffff611fbd16565b600160a060020a033381166000908152600960205260408082209390935590871681522054612097908563ffffffff611fcf16565b600160a060020a03861660008181526009602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612130578082015183820152602001612118565b50505050905090810190601f16801561215d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561217d57600080fd5b6102c65a03f1151561218e57600080fd5b505050826040518082805190602001908083835b602083106121c15780518252601f1990920191602091820191016121a2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600960205260408120548390101561229a57600080fd5b600160a060020a0333166000908152600960205260409020546122c3908463ffffffff611fbd16565b600160a060020a0333811660009081526009602052604080822093909355908616815220546122f8908463ffffffff611fcf16565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b602083106123455780518252601f199092019160209182019101612326565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a031660008051602061240a8339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820731f80b82790c4e85d0a01178d769ead4af3dbcbfe4c5303549c480675f3e90a0029
{"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"}]}}
2,198
0x74a376c25a6306c636aea7e9ea2b2c6dff5c0030
pragma solidity ^0.4.21 ; contract SEAPORT_Portfolio_VI_883 { mapping (address => uint256) public balanceOf; string public name = " SEAPORT_Portfolio_VI_883 " ; string public symbol = " SEAPORT883VI " ; uint8 public decimals = 18 ; uint256 public totalSupply = 897688033763432000000000000 ; 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 ] // // // // < SEAPORT_Portfolio_VI_metadata_line_1_____Lazarev Port of Lazarev_Port_Spe_Value_20230515 > // < PD8HMPRz8f9Nn9Y75JRiUWHlv2Nb13BXJeTKG4rz66l6sFEE383yz6Y332h83cFr > // < 1E-018 limites [ 1E-018 ; 20532396,7569184 ] > // < 0x000000000000000000000000000000000000000000000000000000007A61F56F > // < SEAPORT_Portfolio_VI_metadata_line_2_____Lazarev_Port_Spe_Value_20230515 > // < L7qjH51lFJQpiKTHAAcn97fkc27WT1546DP27YLI7Pw6tc7o14rxMZ6pJg8XYlTz > // < 1E-018 limites [ 20532396,7569184 ; 40731936,343651 ] > // < 0x0000000000000000000000000000000000000000000000007A61F56FF2C80296 > // < SEAPORT_Portfolio_VI_metadata_line_3_____Lomonosov Port of Lomonosov_Port_Spe_Value_20230515 > // < Do6m66AwvssG7WjUa5hn1w0E851b283W603mCcz5EuPOFNvzyZjJ4MKVDzP116Um > // < 1E-018 limites [ 40731936,343651 ; 67176822,8351274 ] > // < 0x00000000000000000000000000000000000000000000000F2C8029619067B45F > // < SEAPORT_Portfolio_VI_metadata_line_4_____Lomonosov_Port_Authority_20230515 > // < PkkNg3Q3JKY5G3DqK6Ohyp3GIGv2Hjr0PYaC05nhHA7F8dbZR6EhJ0XhE4W66SyU > // < 1E-018 limites [ 67176822,8351274 ; 84556181,1374236 ] > // < 0x000000000000000000000000000000000000000000000019067B45F1F7FE8035 > // < SEAPORT_Portfolio_VI_metadata_line_5_____Lomonosov_Port_Authority_20230515 > // < lGrgWI1P4QEpAv1I6R1A77YKAr4c903v6ofkdH81cx24hSDwGpm6mGTNZT5C8JuI > // < 1E-018 limites [ 84556181,1374236 ; 102257108,640016 ] > // < 0x00000000000000000000000000000000000000000000001F7FE80352617FF904 > // < SEAPORT_Portfolio_VI_metadata_line_6_____Magadan Port of Magadan_Port_Spe_Value_20230515 > // < 47YQ9iu0RJQeV2O056w98824IFXwYq1dD9N3deudsX4AR9MVZ09b7Y5Fu5VyOOaT > // < 1E-018 limites [ 102257108,640016 ; 120014173,090999 ] > // < 0x00000000000000000000000000000000000000000000002617FF9042CB571A51 > // < SEAPORT_Portfolio_VI_metadata_line_7_____Magadan_Port_Authority_20230515 > // < 0F94hlL37925Ydm62Ch6c57yZW53nOH56Q6ViE90TQ15bjaZdS8q35VX5nD2Jg62 > // < 1E-018 limites [ 120014173,090999 ; 141679491,296472 ] > // < 0x00000000000000000000000000000000000000000000002CB571A5134C79C13D > // < SEAPORT_Portfolio_VI_metadata_line_8_____Magadan_Port_Authority_20230515 > // < cGag5JW4j14Wq747b3o0f4U5w2B6NpJSHjghO36v9jK2eRG3RhTXOPzwoHag4p6I > // < 1E-018 limites [ 141679491,296472 ; 156875714,936206 ] > // < 0x000000000000000000000000000000000000000000000034C79C13D3A70D5A19 > // < SEAPORT_Portfolio_VI_metadata_line_9_____Mago Port of Mago_Port_Spe_Value_20230515 > // < I3k2ND4zIYv3u367M5H9X68Ay5k31g91dperA80VZgtW7pVt6b89paO3a5ZUciAX > // < 1E-018 limites [ 156875714,936206 ; 183619302,033957 ] > // < 0x00000000000000000000000000000000000000000000003A70D5A1944674D3CF > // < SEAPORT_Portfolio_VI_metadata_line_10_____Mago_Port_Spe_Value_20230515 > // < I2R7459dLjmny74njI3SokVNFr1x73U0aJVY33ew4I9169e19IO59woBX1q5KC18 > // < 1E-018 limites [ 183619302,033957 ; 199605969,514197 ] > // < 0x000000000000000000000000000000000000000000000044674D3CF4A5BE8BCB > // 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 ] // // // // < SEAPORT_Portfolio_VI_metadata_line_11_____Makhachkala Port of Makhachkala_Port_Spe_Value_20230515 > // < y8Kt2KqN7TiiasqexF1718dPCaIw9dg7WSPW39Mpmr7E8WfX8uaBsrQ5v00d76fp > // < 1E-018 limites [ 199605969,514197 ; 224120220,607068 ] > // < 0x00000000000000000000000000000000000000000000004A5BE8BCB537DC5320 > // < SEAPORT_Portfolio_VI_metadata_line_12_____Makhachkala_Port_Spe_Value_20230515 > // < 9Ir0ZQ0lqdby37549n79i7NJ5KD09p569Q9Q0T5u9nZMPiSZqkg2BEoqgD8zs2e6 > // < 1E-018 limites [ 224120220,607068 ; 251407023,780672 ] > // < 0x0000000000000000000000000000000000000000000000537DC53205DA80AE9E > // < SEAPORT_Portfolio_VI_metadata_line_13_____Makhachkala_Sea_Trade_Port_20230515 > // < 4xI5A1US2Qlk46s3qjp1OQ0P5vWGnsXqyK43vDbnHTdyC6J99CHl92JhG0z1N5PL > // < 1E-018 limites [ 251407023,780672 ; 279869542,404284 ] > // < 0x00000000000000000000000000000000000000000000005DA80AE9E6842709F4 > // < SEAPORT_Portfolio_VI_metadata_line_14_____Makhachkala_Sea_Trade_Port_20230515 > // < zzmr89iUg39k1P2bWEGlXUEoP42OzX5Crnh5DP4AvUs2FOHYvTVboem85NUR24Ho > // < 1E-018 limites [ 279869542,404284 ; 299727968,195181 ] > // < 0x00000000000000000000000000000000000000000000006842709F46FA849787 > // < SEAPORT_Portfolio_VI_metadata_line_15_____Marine_Administration_of_Chukotka_Ports_20230515 > // < 5bTCGbmQ7CLVT6A7j9x0yYoLksXw7nryG123NJI5M10beVK7zDI9sW30ULZUDQ8Y > // < 1E-018 limites [ 299727968,195181 ; 318614495,138317 ] > // < 0x00000000000000000000000000000000000000000000006FA84978776B17251D > // < SEAPORT_Portfolio_VI_metadata_line_16_____Marine_Administration_of_Chukotka_Ports_I_20230515 > // < 1n5FcrZkjA9aWSk1qfC8yZmKbfty9FK9B2SKmq0DGVD89Tp92MMsjcog4i9rIx5w > // < 1E-018 limites [ 318614495,138317 ; 336805404,997074 ] > // < 0x000000000000000000000000000000000000000000000076B17251D7D7844547 > // < SEAPORT_Portfolio_VI_metadata_line_17_____Marine_Administration_of_Vladivostok_Port_Posyet_Branch_20230515 > // < glHj16pG5KvPJBnN0ld0I27o4h79Mh02H47aTiD8WMj49h4mRqSzr41arMaQWMX2 > // < 1E-018 limites [ 336805404,997074 ; 363384885,833866 ] > // < 0x00000000000000000000000000000000000000000000007D7844547875F156FB > // < SEAPORT_Portfolio_VI_metadata_line_18_____Marine_Administration_of_Vladivostok_Port_Posyet_Branch_20230515 > // < L6r32k9Ogy671clrHvY22EvhCnrhC5O2suMi3MUd7SD4Et23TtY9l2a9DoBu0P65 > // < 1E-018 limites [ 363384885,833866 ; 378734314,14678 ] > // < 0x0000000000000000000000000000000000000000000000875F156FB8D16EB56A > // < SEAPORT_Portfolio_VI_metadata_line_19_____Maritime_Port_Administration_of_Novorossiysk_20230515 > // < y497KmmXDs1bhg6MEox4drF822B5IGr8g8cW5Md0YikIHI5P5NO1hQ1oPJF4U29C > // < 1E-018 limites [ 378734314,14678 ; 393987869,152679 ] > // < 0x00000000000000000000000000000000000000000000008D16EB56A92C59C957 > // < SEAPORT_Portfolio_VI_metadata_line_20_____Maritime_Port_Administration_of_Novorossiysk_20230515 > // < pQ7g63Ze6ig84FJsPm2jy2cs7s6e7YzKJE4cgjoJ424Tbh76b0dsqM9k4zGc2Lgu > // < 1E-018 limites [ 393987869,152679 ; 421129513,397691 ] > // < 0x000000000000000000000000000000000000000000000092C59C9579CE20A61F > // 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 ] // // // // < SEAPORT_Portfolio_VI_metadata_line_21_____0_20230515 > // < KMLX1KTCk3oQ6JVNJLXs5607w7e50Pm7D28r2ji4jqv272RC1DJHDIOUN6Q0b3ga > // < 1E-018 limites [ 421129513,397691 ; 450545884,295621 ] > // < 0x00000000000000000000000000000000000000000000009CE20A61FA7D767801 > // < SEAPORT_Portfolio_VI_metadata_line_22_____Mezen Port of Mezen_Port_Spe_Value_20230515 > // < mvX1MIvGTMH1TT5Fn3G5TNkPnTq5E2A0kO976MYH772CAK0kV9qrWMw8Q3rowh3u > // < 1E-018 limites [ 450545884,295621 ; 467171474,097526 ] > // < 0x0000000000000000000000000000000000000000000000A7D767801AE08F1B05 > // < SEAPORT_Portfolio_VI_metadata_line_23_____Mezen_Port_Authority_20230515 > // < ZW995x9Xy5J0lW5811I6zNEDOYRloNpbf8XfF0HNmeMOizc8Vmqby1P9SA9m9yHh > // < 1E-018 limites [ 467171474,097526 ; 496690418,528729 ] > // < 0x0000000000000000000000000000000000000000000000AE08F1B05B908170B0 > // < SEAPORT_Portfolio_VI_metadata_line_24_____Mezen_Port_Authority_20230515 > // < p6huN5H4V9uz6m0uN4ZvQN21QJrjZdh1eooiA2fHnBA3p63s46091z7fvdhXBnzK > // < 1E-018 limites [ 496690418,528729 ; 512311320,080516 ] > // < 0x0000000000000000000000000000000000000000000000B908170B0BED9D0B5C > // < SEAPORT_Portfolio_VI_metadata_line_25_____Moscow_Port_Spe_Value_20230515 > // < 984L9nD18627PeP0jVqVbM54pdjmJ303pSFNb4CQruc8fWM1qZ4y0l0aLTHRM742 > // < 1E-018 limites [ 512311320,080516 ; 535107340,275707 ] > // < 0x0000000000000000000000000000000000000000000000BED9D0B5CC757D02BF > // < SEAPORT_Portfolio_VI_metadata_line_26_____Murmansk Port of Murmansk_Port_Spe_Value_20230515 > // < G5aBqVP8uqpj3U51Eepp4Bn941RfClw60iPG1pfJ9Yy8Vq2B88W2KU2LStcw9f66 > // < 1E-018 limites [ 535107340,275707 ; 561975331,392672 ] > // < 0x0000000000000000000000000000000000000000000000C757D02BFD15A24FC7 > // < SEAPORT_Portfolio_VI_metadata_line_27_____Murmansk_Port_Authority_20230515 > // < 7Uw3188q29mT248QXMSRE286T7r1i4D651Z912eyFgyqRiPhjd77wJwPb872R08C > // < 1E-018 limites [ 561975331,392672 ; 577376937,201808 ] > // < 0x0000000000000000000000000000000000000000000000D15A24FC7D716F4C0C > // < SEAPORT_Portfolio_VI_metadata_line_28_____Murmansk_Port_Authority_20230515 > // < 8R1AUnG2eL969a47563eJA6yN6qhUTv6VmmlNoEWA6DaRj2e4QH4A4sZfFkB6pif > // < 1E-018 limites [ 577376937,201808 ; 602581742,51462 ] > // < 0x0000000000000000000000000000000000000000000000D716F4C0CE07AAC71F > // < SEAPORT_Portfolio_VI_metadata_line_29_____Murom_Port_Spe_Value_20230515 > // < xoqE7pBvY4rRk5X47KN8p2jWp9sK3m96dHnHKH4ewDSsnf6VDIM708h4v7uCibOO > // < 1E-018 limites [ 602581742,51462 ; 620757257,508426 ] > // < 0x0000000000000000000000000000000000000000000000E07AAC71FE740069AA > // < SEAPORT_Portfolio_VI_metadata_line_30_____Nakhodka Port of Nakhodka_Port_Spe_Value_20230515 > // < A41e5CZ9sx2cTiUa26X2jrCfZ6829unduT5gi8nFC1gIqI7eCbG1392956yC2R2s > // < 1E-018 limites [ 620757257,508426 ; 645761923,903174 ] > // < 0x0000000000000000000000000000000000000000000000E740069AAF090A817A > // 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 ] // // // // < SEAPORT_Portfolio_VI_metadata_line_31_____Naryan_Mar Port of Naryan_Mar_Port_Spe_Value_20230515 > // < Ub3rxaNfeVOLsH0TgZUOZhSFO5NmZ4dbDqVqv0dE8vQC50a36T068XgdjUDP8eA6 > // < 1E-018 limites [ 645761923,903174 ; 665949256,14032 ] > // < 0x0000000000000000000000000000000000000000000000F090A817AF815DEE22 > // < SEAPORT_Portfolio_VI_metadata_line_32_____Naryan_Mar_Port_Authority_20230515 > // < KmqpiuRssH5y2EUK3Yiu6O9B0lJpEWWgry9RnT42f1Gz1zc0Bg94kWB530Q1vCc5 > // < 1E-018 limites [ 665949256,14032 ; 695750989,476352 ] > // < 0x000000000000000000000000000000000000000000000F815DEE221032FFC437 > // < SEAPORT_Portfolio_VI_metadata_line_33_____Naryan_Mar_Port_Authority_20230515 > // < WxMC4Ida74OzXznY0318d6tmy6K0V78uCX72nZ8kkYcIxWn02Kvnjgzaln17l5V2 > // < 1E-018 limites [ 695750989,476352 ; 714106890,772429 ] > // < 0x000000000000000000000000000000000000000000001032FFC43710A068A629 > // < SEAPORT_Portfolio_VI_metadata_line_34_____Nevelsk Port of Nevelsk_Port_Spe_Value_20230515 > // < Cy1uu8dCG344VBvxujSBv2f6bhn5gkB10G1OZRRWO759i14d6zFNGqtkyYnCn00p > // < 1E-018 limites [ 714106890,772429 ; 741823458,016212 ] > // < 0x0000000000000000000000000000000000000000000010A068A62911459CC63D > // < SEAPORT_Portfolio_VI_metadata_line_35_____Nevelsk_Port_Authority_20230515 > // < Lo6N48Qp5GX0kx801imdXXtG5u5UuOVxiDHylNnv5KFkpGFY11F2lTqtXs4Fv130 > // < 1E-018 limites [ 741823458,016212 ; 768954845,388412 ] > // < 0x0000000000000000000000000000000000000000000011459CC63D11E753FC6E > // < SEAPORT_Portfolio_VI_metadata_line_36_____Nevelsk_Port_Authority_20230515 > // < HtrOl3nI3ul7GEY0t5N27520nV6jiPliPAkQyDKQ3117j31298SMJ1Sjh56IAp9c > // < 1E-018 limites [ 768954845,388412 ; ] > // < 0x0000000000000000000000000000000000000000000011E753FC6E1295530B52 > // < SEAPORT_Portfolio_VI_metadata_line_37_____Nikolaevsk on Amur Port of Nikolaevsk on Amur_Port_Spe_Value_20230515 > // < V8D747yF47eH722733cn1s1uv182n9KS6HV554IC0Gp5r51cF9N3f24840gN388w > // < 1E-018 limites [ 798146583,987227 ; 826175174,38341 ] > // < 0x000000000000000000000000000000000000000000001295530B52133C634772 > // < SEAPORT_Portfolio_VI_metadata_line_38_____Nikolaevsk_on_Amur_Sea_Port_20230515 > // < FTtY5Nb31fRx94Io6wp7OHK9E9qzqwttX64Gh1AXBPV75Q25eItnv0r4cTeN9FYv > // < 1E-018 limites [ 826175174,38341 ; 849657061,45984 ] > // < 0x00000000000000000000000000000000000000000000133C63477213C859CB95 > // < SEAPORT_Portfolio_VI_metadata_line_39_____Nikolaevsk_on_Amur_Sea_Port_20230515 > // < 3uHQKlk2kC31xp93B7TLrLz7TM59XN1s4zIF65kUxUI2ZL8HZ0hhn665b9Sxu101 > // < 1E-018 limites [ 849657061,45984 ; 875475936,783258 ] > // < 0x0000000000000000000000000000000000000000000013C859CB9514623E45C2 > // < SEAPORT_Portfolio_VI_metadata_line_40_____Nizhnevartovsk_Port_Spe_Value_20230515 > // < 21eM1EJ61d9Xod79KUO2ZYx1SX7q9R1v8yG04X2AJl36G0PbbG7IIwrMYk6GANXG > // < 1E-018 limites [ 875475936,783258 ; 897688033,763432 ] > // < 0x0000000000000000000000000000000000000000000014623E45C214E6A33E24 > }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820512ab1f8bf991127182ba6028cb09a68b43f376f9bf6d303dcaf6287c1189a220029
{"success": true, "error": null, "results": {}}
2,199